1

我最近升级了我的云 SDK,现在我不能再灵活地部署到应用引擎。我使用以下命令部署我的应用程序:

C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.cmd preview app deploy --promote vm.yaml

我得到以下输出和崩溃(删节):

WARNING: Could not acquire lock C:\Users\Michael\AppData\Roaming\gcloud\credentials.lock in 0 seconds
WARNING: The credentials file (C:\Users\Michael\AppData\Roaming\gcloud\credentials) is not writable. Opening in read-only mode. Any refreshed credentials will only be valid for this run.
WARNING: Could not acquire lock C:\Users\Michael\AppData\Roaming\gcloud\credentials.lock in 0 seconds
WARNING: The credentials file (C:\Users\Michael\AppData\Roaming\gcloud\credentials) is not writable. Opening in read-only mode. Any refreshed credentials will only be valid for this run.
WARNING: Could not acquire lock C:\Users\Michael\AppData\Roaming\gcloud\credentials.lock in 0 seconds
WARNING: The credentials file (C:\Users\Michael\AppData\Roaming\gcloud\credentials) is not writable. Opening in read-only mode. Any refreshed credentials will only be valid for this run.
...
ERROR: gcloud crashed (OSError): [Errno 13] Permission denied: 'C:\\Users\\Michael\\AppData\\Roaming\\gcloud\\credentials.lock'

If you would like to report this issue, please run the following command:
  gcloud feedback

下面是一些输出gcloud feedback

Trace:
C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\gcloud_main.py:171
 gcloud_cli.Execute()
C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\calliope\cli.py:719
 result = args.calliope_command.Run(cli=s...
C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\calliope\backend.py:1404
 resources = command_instance.Run(args)
C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\surface\app\deploy.py:91
 return deploy_util.RunDeploy(self, args,...
C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\command_lib\app\deploy_util.py:206
 service, code_bucket_ref)
C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\api_lib\app\deploy_app_command_util.py:233
 _UploadFiles(files_to_upload, bucket_ref...
C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\api_lib\app\deploy_app_command_util.py:175
 results = pool.map(_UploadFile, tasks)
c:\Python27\lib\multiprocessing\pool.py:251
 return self.map_async(func, iterable, ch...
c:\Python27\lib\multiprocessing\pool.py:567
 raise self._value
OSError: [Errno 13] Permission denied: 'C:\\Users\\Michael\\AppData\\Roaming\\gcloud\\credentials.lock'


Installation information:

Google Cloud SDK [120.0.0]

Platform: [Windows, x86_64]
Python Version: [2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)]]
Python Location: [c:\Python27\python.exe]
[output truncated]

有任何想法吗?

4

4 回答 4

5

这是2016 年 6 月引入的 Google SDK并行上传功能的错误。通过使用以下命令关闭该功能来解决该错误:

gcloud config set app/num_file_upload_processes 1

上面的命令将并行上传的数量限制为 1 个线程/进程,因此它们不会踩到对方的脚。

于 2016-08-09T01:44:49.577 回答
1

我最近有同样的问题。转到错误消息中显示的目录。您会找到两个凭证文件。删除带有 LOCK 扩展名的那个(它将是空的)。然后重新部署您的项目。非常适合我。

于 2017-04-23T10:40:13.450 回答
0

我也遇到过这个问题。它是怎么发生的 --> 我运行了 gcloud app deploy 命令,但后来意识到部署需要更长的时间才能完成(可能挂起),然后我终止了批处理,即 CTRL + C。当我重新发出命令时,这就是我遇到这个问题的时候。所以解决方案,执行上面已经说过的操作,即去删除 credentials.lock 文件(在我的情况下,它在 C:\Users\Sam\AppData\Roaming\gcloud 目录中找到)

于 2017-05-12T14:26:58.383 回答
0

解决这个错误的更好方法是删除锁定文件所在的根目录后重新安装。

于 2017-07-05T05:45:19.793 回答