简体   繁体   English

推送到 Google Artifact Repository 时出现身份验证错误

[英]Auth error when pushing to Google Artifact Repository

I'm trying to push to GAR from my local machine, but I always get this error:我正在尝试从本地机器推送到 GAR,但我总是收到此错误:

failed to authorize: failed to fetch anonymous token: unexpected status: 403 Forbidden

First, I've confirmed that my account has the Artifact Registry Writer role through IAM.首先,我已通过 IAM 确认我的账户具有 Artifact Registry Writer 角色。

I have done the following locally:我在本地做了以下事情:

# Login with my Google account
gcloud auth login --update-adc --force

# Configure docker to use the gcloud CLI auth helper
gcloud auth configure-docker us-west1-docker.pkg.dev

# docker login for good measure
docker login

# Tag my image (already built)
docker tag myimage us-west1-docker.pkg.dev/myproject/myrepo/myimage

# Push it
docker push us-west1-docker.pkg.dev/myproject/myrepo/myimage

On this final command I get the error above.在这个最终命令上,我得到了上面的错误。

I have read all the Google documentation I could find but they all suggest the above steps:我已经阅读了我能找到的所有谷歌文档,但它们都建议了上述步骤:

Note: I can't pull either, using the command provided directly from the GCP web UI.注意:我也不能拉,使用直接从 GCP web UI 提供的命令。

I'm on M1 Mac.我在 M1 Mac 上。

So I was able to solve this problem by completely nuking Docker, specifically with these steps: https://stackoverflow.com/a/69437543/3846032 .因此,我能够通过完全消除 Docker 来解决这个问题,特别是通过以下步骤: https://stackoverflow.com/a/69437543/3846032 I couldn't uninstall it by normal means, it would just hang, implying that the problems I was getting were a result of my Docker installation being very broken.我无法通过正常方式卸载它,它只会挂起,这意味着我遇到的问题是我的 Docker 安装非常损坏的结果。 Indeed, I managed to follow the above steps on another machine and it worked, which led me to conclude the steps above and my credentials were totally fine.事实上,我设法在另一台机器上按照上述步骤操作并且它工作正常,这使我得出上述步骤并且我的凭据完全没问题。

The 403 was a red herring, it must have come from my local Docker being broken in such a way that it doesn't send properly authenticated requests. 403 是一个红鲱鱼,它一定来自我当地的 Docker 被破坏,以至于它没有发送经过正确身份验证的请求。

暂无
暂无

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

相关问题 推送到工件存储库未触发 GCP 容器扫描 - GCP Container Scanning not triggered by pushing to Artifact Repository 使用 Artifact Repository 时如何查看在我的 Google Cloud Platform Cloud Run 服务上运行的文件? - How to see the files running on my Google Cloud Platform Cloud Run service when using Artifact Repository? 使用 terraform 和 helm 部署 GKE 时出现 Google 云工件注册表问题 - Google cloud artifact registry issue when deploying GKE with terraform and helm 通过 App Engine 中的 Google Auth 库请求 ID 令牌时出现混合内容错误 - Mixed Content error when requesting ID token through Google Auth Library in App Engine 使用 Eclipse AWS 插件时如何解决丢失的工件错误? - How to resolve missing artifact error when using Eclipse AWS plugin? GitKraken:推送许多文件时出错(块 Header 问题) - GitKraken: Error when pushing many files (Chunk Header Problem) 谷歌云 SDK:gcloud auth login 给我一个错误 - Google Cloud SDK: gcloud auth login gives me an error 谷歌云:Artifact Registry 与 Container Registry - Google Cloud: Artifact Registry vs Container Registry 来自不同项目的 Google Artifact Registry 访问 - Google Artifact Registry access from different projects 使用 Google 的 API Explorer 发送 Firebase 云消息时,如何解决“THIRD_PARTY_AUTH_ERROR”背后的问题? - How do I fix the problem behind "THIRD_PARTY_AUTH_ERROR" when using Google's API Explorer to send a Firebase Cloud Messaging message?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM