CEF 5249下载第三方工具时遇Google Cloud服务权限错误求助
环境
- Windows 10
- VS2019
执行的update.bat脚本
set GN_DEFINES=is_component_build=true set GN_ARGUMENTS=--ide=vs2019 --sln=cef --filters=//cef/* python3 ..\automate\automate-git.py --download-dir=c:\code\chromium_git --depot-tools-dir=c:\code\depot_tools --no-distrib --no-build --force-clean --force-clean-deps --branch=5249
错误信息
Running hooks: 42% (56/131) tools_traffic_annotation_windows
________ running 'python3 src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --num_threads=4 --bucket chromium-tools-traffic_annotation -d src/tools/traffic_annotation/bin/win32' in 'c:\code\chromium_git\chromium'
Failed to fetch file gs://chromium-tools-traffic_annotation/6b6864f1c8afbcdae654582e5f3309d7b1d5a6ad for src/tools/traffic_annotation/bin/win32\traffic_annotation_auditor.exe. [Err: ServiceException: 401 Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object. Permission 'storage.objects.get' denied on resource (or it may not exist).
原因及解决方法
- 问题根源是
--no_auth参数强制匿名访问,但目标Google Cloud Storage存储桶已不再允许匿名下载,导致权限被拒。 - 解决步骤:
- 若
download_from_google_storage.py调用是automate-git.py内部触发的,需找到对应hook配置,移除其中的--no_auth参数。 - 在命令行执行
gcloud auth application-default login,按照提示完成Google账号登录授权,配置好本地认证信息。 - 重新运行update.bat脚本,工具会自动使用已授权的账号访问存储桶,完成文件下载。
- 若
内容的提问来源于stack exchange,提问作者wixom

