google cloud platform – Docker Push Request to GCP throws error for being unauthenticated

I am trying to push a Dockerfile to GCP with this command:

docker --debug push us-east4-docker.pkg.dev/my-gcp-project/my-function-name

I created the my-function-name repository under the artifact registry for my-gcp-project. I also ran gcloud auth configure-docker us-east4-docker.pkg.dev and I am logged into a GCP account with the Artifact Registry Writer permission.

However, when I run the push command, I get this error:

time="2025-03-22T17:36:52-04:00" level=debug msg="otel error" error="1 errors occurred detecting resource:\n\t* conflicting Schema URL: https://opentelemetry.io/schemas/1.21.0 and https://opentelemetry.io/schemas/1.26.0"
The push refers to repository [us-east4-docker.pkg.dev/my-gcp-project/my-function-name]

denied: Unauthenticated request. Unauthenticated requests do not have permission "artifactregistry.repositories.uploadArtifacts" on resource "projects/my-gcp-project/locations/us-east4/repositories/my-function-name" (or it may not exist)

How can I fix this? Why is it saying that I am not authenticated?

Read more here: Source link