I have an issue with Artifact Registry when want to redirect back it to Container registry.
gcloud artifacts settings disable-upgrade-redirection --project=xx
- IAM roles are set
roles/artifactregistry.admin, roles/artifactregistry.createOnPushRepoAdmin - Previously there were images and kubectl pods running on these images, after removing all and trying to revert, the issue appeared
- Logs:
gcloud artifacts settings disable-upgrade-redirection --log-http --verbosity=debug
File "/home/xx/google-cloud-sdk/lib/third_party/apitools/base/py/base_api.py", line 612, in __ProcessHttpResponse
raise exceptions.HttpError.FromResponse(
apitools.base.py.exceptions.HttpBadRequestError: HttpError accessing <https://artifactregistry.googleapis.com/v1/projects/xxx/projectSettings?alt=json&updateMask=legacy_redirection_state>: response: <{'vary': 'Origin, X-Origin, Referer', 'content-type': 'application/json; charset=UTF-8', 'content-encoding': 'gzip', 'date': 'Fri, 10 Jan 2025 14:33:45 GMT', 'server': 'ESF', 'cache-control': 'private', 'x-xss-protection': '0', 'x-frame-options': 'SAMEORIGIN', 'x-content-type-options': 'nosniff', 'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000', 'transfer-encoding': 'chunked', 'status': 400}>, content <{
"error": {
"code": 400,
"message": "Precondition check failed.",
"status": "FAILED_PRECONDITION"
}
}
- Push and pull for Docker images in Artifact registry still working.
How could I resolve this issue?
projects.updateProjectSettingsgcloudfrom the issue. Igcloud iam roles describe(1)roles/artifactregistry.containerRegistryMigrationAdmin(which you don't have) and it includesartifactregistry.projectsettings.updatewhich (2)roles/artifactregistry.createOnPushRepoAdmindoes not. I think that's your issue