gcloud 组件更新权限被拒绝 [英] gcloud components update permission denied

查看:18
本文介绍了gcloud 组件更新权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试运行任何 gcloud 命令(例如 gcloud components update)时,突然间我开始遇到权限被拒绝"问题——如果我运行 sudo gcloud components update 就可以避免这个问题 但我不清楚为什么突然需要 sudo 命令?我实际上一直在尝试运行 GCMLE 实验并且它有相同的错误/警告,所以我尝试更新组件但仍然遇到了这个问题.我已经旅行了几天并且没有做任何更改,因为这些相同的命令在几天前起作用了.此外,我没有改变我的操作系统(Mac High Sierra 10.13.3)——谷歌方面是否有任何变化可以解释这种行为变化?永久绕过此警告的最佳行动方案是什么?

All of a sudden I started getting "Permission Denied" issues when trying to run any gcloud commands such as gcloud components update -- the issue was avoided if I ran sudo gcloud components update but it's not clear to my why the sudo command is suddenly required? I have actually been trying to run a GCMLE experiment and it had the same error/warning, so I tried updating components and still ran into this issue. I have been travelling for a couple days and did not make any changes since these same commands worked a few days ago. Further, I did not changed my OS (Mac High Sierra 10.13.3) -- were there any changes on the Google side that might explain this change in behavior? What is the best course of action to permanently get around this warning?

(conda-env) MacBook-Pro:user$ gcloud components update
WARNING: Could not setup log file in /Users/$USERNAME/.config/gcloud/logs, (IOError: [Errno 13] Permission denied: u'/Users/$USERNAME/.config/gcloud/logs/2018.03.10/XX.XX.XX.XXXXXX.log')

sudo gcloud components update 之后,我能够启动 GCMLE 实验,但我也收到相同的警告(尽管我的作业现在已成功提交).

after sudo gcloud components update I was able to kick off a GCMLE experiment, but I also get the same warning (though my job now submits successfully).

WARNING: Could not setup log file in /Users/#USERNAME/.config/gcloud/logs, (IOError: [Errno 13] Permission denied: u'/Users/$USERNAME/.config/gcloud/logs/2018.03.10/XX.XX.XX.XXXXXX.log')

推荐答案

基于对类似问题的回答,您可能需要更改相应目录的权限:

Based on an answer to a similar question, you probably need to change the permissions to the appropriate directories:

sudo chown -R $USER ~/.config/gcloud

同一篇文章表明,通过使用 sudo 运行 gcloud 命令,权限可能已经失控.

That same post suggests that permissions may have gotten out-of-whack by running a gcloud command with sudo.

这篇关于gcloud 组件更新权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆