简体   繁体   English

gcloud '没有这样的文件或目录'

[英]gcloud 'no such file or directory'

On Ubuntu 20.04, gcloud installed with snap install google-cloud-sdk --classic ...在 Ubuntu 20.04 上,gcloud 安装了snap install google-cloud-sdk --classic ...

Today it no longer works.今天它不再起作用了。 Yesterday there was an auto update.昨天有一个自动更新。

$ kubectl get all
Unable to connect to the server: error executing access token command "/snap/google-cloud-sdk/188/bin/gcloud config config-helper --format=json": err=fork/exec /snap/google-cloud-sdk/188/bin/gcloud: no such file or directory output= stderr=

Version 188 it is referencing is gone, and it is now at 190. (Version 189 is also present.)它引用的版本 188 不见了,现在是 190。(版本 189 也存在。)

I've uninstalled and deleted the.config/gcloud, and reinstalled, but still have the same error.我已经卸载并删除了.config/gcloud,并重新安装,但仍然有同样的错误。

Any tips on where to look for that stale path?关于在哪里寻找陈旧路径的任何提示?

I suspect it is to be found in your kubectl config file (on Linux: ${HOME}/.kube/config or possibly as the value of ${KUBECONFIG} .我怀疑它可以在您的kubectl配置文件中找到(在 Linux 上: ${HOME}/.kube/config或可能作为${KUBECONFIG}的值。

For GKE clusters, the relevant user , auth-provider , config will include something similar to cmd-path: /.../google-cloud-sdk/bin/gcloud and I think that's what you'll want to edit.对于 GKE 集群,相关的userauth-providerconfig将包含类似于cmd-path: /.../google-cloud-sdk/bin/gcloud ,我认为这就是您想要编辑的内容。

The problem is that gcloud stores the absolete reference to the gcloud binary to ~/.kube/config.问题是 gcloud 将对 gcloud 二进制文件的绝对引用存储到 ~/.kube/config。 The solution is to replace /snap/google-cloud-sdk/.*/gcloud -> /snap/bin/gcloud in ~/.kube/config .解决方案是替换~/.kube/config /snap/google-cloud-sdk/.*/gcloud -> /snap/bin/gcloud

Example of accomplishing this with perl on the command line:在命令行上使用perl完成此操作的示例:

perl -i -p -e 's/\/snap\/google-cloud-sdk\/.*?\/gcloud/\/snap\/bin\/gcloud/' ~/.kube/config

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 gcloud SDK:无法写入文件 - gcloud SDK: Unable to write file 如何将 gke-gcloud-auth-plugin 与 gcloud 服务帐户密钥文件一起使用? - How to use gke-gcloud-auth-plugin with a gcloud service account key file? gcloud alpha storage ls 找不到上传的文件 - gcloud alpha storage ls isn't finding uploaded file 如何使用 gcloud bash 命令检查 Google Cloud Storage 中是否存在文件? - How to check if file exists in Google Cloud Storage with the gcloud bash command? 如何将 sql 文件传递给 gcloud sql 导出而不是内联 sql? - How to pass a sql file to gcloud sql export instead of inline sql? 如何通过覆盖 default.gcloudignore 设置将 .env 文件上传到 gcloud - How to upload .env file to gcloud by overriding default .gcloudignore settings 为什么将 --package-path 设置为本地目录会在 gcloud 中出现 python not found 错误? - Why does setting --package-path to a local directory give python not found error in gcloud? GCloud 签名不匹配 - GCloud SignatureDoesNotMatch gcloud 更新组件 - 文件权限被拒绝...\kuberun_licenses\LICENSES.txt - gcloud update components - permission denied on file ...\kuberun_licenses\LICENSES.txt 为什么 Cloud Code 不尊重我的 cloudbuild.yaml 文件,但 gcloud beta 构建提交是? - Why isn't Cloud Code honoring my cloudbuild.yaml file but gcloud beta builds submit is?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM