Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker push denied: Unable to determine the upload's size

I have created application image on google cloud and while trying to push through google cloud shell, getting following error:

08db9ff34fc6: Pushing [==================================================>] 73.38 MB
5313937c4c49: Pushing [==========================================>        ] 62.36 MB/73.37 MB
162f935b1198: Pushing [==========================>                        ] 84.09 MB/155.9 MB
dcf909146faa: Pushing [==================================================>] 6.787 MB
23b9c7b43573: Pushing [==================================================>]  4.23 MB
**denied: Unable to determine the upload's size.**

I tried hard while searching for solutions but didn't find a single. Please help.

like image 230
user1662655 Avatar asked Dec 02 '22 12:12

user1662655


2 Answers

Had the same problem. Can you try to pull another image that you have configured there:

docker pull gcr.io/...

For me it initially failed with AccessDenied.

Solution:

To fix it, I went to the Storage browser in Google Cloud UI interface:

https://console.cloud.google.com/storage/browser

Go to the artifacts.<project-name>.appspot.com bucket and give yourself Storage access. Then it worked

like image 84
Daniel Hasegan Avatar answered Dec 05 '22 06:12

Daniel Hasegan


I just ran into this, for a container registry that had been working.

We had set the registry as private and then went to the storage level, and added an identity from a customer organization as a Storage Viewer. We changed the permission granularity from object-level to bucket-level policy, to simplify permission management.

Setting bucket-level policy was the mistake

Reverting permission granularity to object level cured the problem.

Update: Daniel Hasegan's answer below is correct. It is possible to enable bucket-level permissions as long as any account accessing the bucket has the correct rights to push or pull as necessary. If you are running on Google Kubernetes Engine, you must ensure that the service account that's running your cluster nodes has at least Storage Object Viewer permissions, else your pods will fail with ImagePullBackoff errors.

like image 41
Eric Schoen Avatar answered Dec 05 '22 08:12

Eric Schoen