All Articles

GCR; Permission Denied - Unable to Determine Upload Size

Google Cloud has excellent container support, including GCR - a private container registry that automatically stores your containers on GCS. But GCR has a weird bug.

The first time I try to push a new image:

docker push $IMAGE_URI

The upload runs for a few seconds and then fails with the curious error:

denied: Unable to determine the upload's size

What’s going on?

GCR works by creating a bucket in GCS for your container. For reasons best known to Google, project owners do not automatically get write access to GCR buckets. You need to explicitly give yourself permission.

To do this, follow this guide. Click the bucket, then permissions, add member. Enter your Google or Service account. Search for and select the role ‘Storage Admin’.

You should know be able to push to your own GCR.

Happy coding,

Mike