docker-library / python

Docker Official Image packaging for Python
https://www.python.org/
MIT License
2.54k stars 1.07k forks source link

Issue with pushing certain layers (received unexpected HTTP status: 503 Service Unavailable) #829

Closed kristiangronberg closed 1 year ago

kristiangronberg commented 1 year ago

I'm trying to push an image to an acr repo by following the instructions on this page: https://learn.microsoft.com/en-gb/azure/container-instances/container-instances-tutorial-prepare-acr

After repeatedly having pushed to the repo do I keep getting the following error (503 Service Unavailable):

4e3c4bdd8bfe: Layer already exists
cdae82220b48: Layer already exists
d3425a455cb5: Layer already exists
8fbb024a9e28: Layer already exists
3bb921ccd79d: Pushing [==============================================>    ]  10.24MB/10.99MB
f0d12f622fa6: Layer already exists
b7fe4d3535be: Retrying in 20 seconds
7663e4e44dcd: Layer already exists
00db256c021d: Layer already exists
626941e0d298: Layer already exists
03d5e23e1dd0: Layer already exists
40683d611cd5: Layer already exists
received unexpected HTTP status: 503 Service Unavailable

The error is always for two specific layers, with status "Retrying" and "Pushing" (but will fail).

I inspected the problematic layers with dive (since I'm on MacOS)

Cmp   Size  Command
56 MB  RUN /bin/sh -c set -eux;         wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYT ...
11 MB  RUN /bin/sh -c set -eux;         wget -O get-pip.py "$PYTHON_GET_PIP_URL";     echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha25...

The layers which fail to be pushed look like this (identified by their digest sha256 hash. (The full command is not displayed since it is cut of by dive.)

Problematic layer 1:

Tags:   (unavailable)
Id:     8cf7d0e0050abc76db256a5e312baf1ee8a3cacdf60e185e96ac676e9868b2a4
Digest: sha256:b7fe4d3535be9e73191e41a0d212629840faedea9bf9482219a46b47ee1f8618
Command:
RUN /bin/sh -c set -eux;         wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.ta

Problematic layer 2:

Tags:   (unavailable)
Id:     164ddaa51a1726d2c5ee755241be4790dbcf7475dbf9b14ad844ebc780b4a9d5
Digest: sha256:3bb921ccd79db85deeec8666f06ef210581d1cfacb0e1a7b1db5028e1a69520b
Command:
RUN /bin/sh -c set -eux;         wget -O get-pip.py "$PYTHON_GET_PIP_URL";     echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -;

It looks like both these layers are coming from the python:bullseye image.

I'm still however curious if anyone else here have had the same issue with pushing layers to acr?

I fast glance at the different layers singles out the two problematic ones in such a way that these are both doing RUN commands with wget. Not sure why that would be an issue though.

Any help in understanding the issue is welcome.

Thank you.

I have posted the same question on Microsoft Azure Docs but got unsure if this is a better place to post this issue in and then posted the same question here. I'll follow-up, update solution and close them both when a solution is found.

ad-m-ss commented 1 year ago

The error response HTTP status: 503 Service Unavailable is reported by your registry provider, so you should reach them first. Maybe it has deduplication implemented in the wrong way, or something else in its container implementation is broken, but it's unlikely that it was the description of the image that is managed in this repository.