gcloud组件更新权限被拒绝 [英] gcloud components update permission denied
问题描述
突然,当我尝试运行诸如gcloud components update
之类的任何gcloud命令时,我开始遇到权限被拒绝"的问题-如果我运行sudo gcloud components update
,就避免了该问题,但是我不清楚为什么sudo命令是突然需要?我实际上一直在尝试运行GCMLE实验,它具有相同的错误/警告,因此我尝试更新组件,但仍然遇到了此问题.我已经旅行了几天,但自几天前执行相同命令以来,没有进行任何更改.此外,我没有更改操作系统(Mac High Sierra 10.13.3)-Google方面是否有任何更改可以解释这种行为更改?永久解决此警告的最佳方法是什么?
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屋!