[英]IBM Cloud Code Engine: Build fails in step “step-build-and-push” with error UNAUTHORIZED
I have an existing IBM Cloud Code Engine project which was working before.我有一个以前运行过的现有 IBM Cloud Code Engine 项目。 I submitted a new buildrun, but it fails.
我提交了一个新的构建运行,但它失败了。 Based on the error message it is due to permissions with the private image registry (IBM Cloud Container Registry).
根据错误消息,这是由于私有映像注册表 (IBM Cloud Container Registry) 的权限所致。 The IAM API Key is valid and is working for other tasks.
IAM API 密钥有效并且适用于其他任务。 There are no quota issues.
不存在配额问题。
ibmcloud ce buildrun submit --build mybuild
Checking the status it shows failed.检查它显示的状态失败。 Getting to the logs, these are the lines of question:
进入日志,这些是问题所在:
myproject-build-run-n9xm6-xxx-pod-yyy/step-build-and-push: error checking push permissions -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again: checking push permission for "us.icr.io/henrik/myproject:latest": creating push check transport for us.icr.io failed: GET https://us.icr.io/oauth/token?scope=repository%3Ahenrik%myproject%3Apush%2Cpull&service=registry : UNAUTHORIZED: The login credentials are not valid, or your IBM Cloud account is not active.;
myproject-build-run-n9xm6-xxx-pod-yyy/step-build-and-push:错误检查推送权限——确保您输入了正确的标签名称,并且您已通过正确的身份验证,然后重试:检查推送“us.icr.io/henrik/myproject:latest”的权限:为 us.icr.io 创建推送检查传输失败:GET https://us.icr.io/oauth/token?scope=repository%3Ahenrik%myproject %3Apush%2Cpull&service=registry : UNAUTHORIZED : 登录凭证无效,或者您的 IBM Cloud 帐户未激活。; The login credentials are not valid, or your IBM Cloud account is not active.
登录凭证无效,或者您的 IBM Cloud 帐户未激活。
The error is the same regardless of whether I use the CLI or browser console.无论我使用 CLI 还是浏览器控制台,错误都是一样的。
It turns out that I had enabled enforced private endpoint access for the container registry, a security best practice.事实证明,我为容器注册表启用了强制私有端点访问,这是一种安全最佳实践。 However, with that I needed the right credentials in Code Engine to access the container registry .
但是,我需要在代码引擎中使用正确的凭据来访问容器注册表。 Using the IBM Cloud Container Registry, in Code Engine I needed to
使用 IBM Cloud Container Registry,在代码引擎中我需要
With both the credentials and the image name having matching server names, I succeeded and the error were gone.凭据和图像名称都具有匹配的服务器名称,我成功了,错误消失了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.