GCloud CLI install failing because of Bad Gateway 502 error

Good afternoon,

I am trying to install the Gcloud CLI in the standard (public) Python 3.10-slim and 3.9-slim image from Dockerhub

When running the command as defined here :

 
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && apt-get --allow-releaseinfo-change update -y && \
apt-get install google-cloud-sdk -y
 
I get the following error:

502 Bad Gateway [IP: 108.177.127.138 80]
#4 7.764 Fetched 1712 B in 7s (230 B/s)
#4 7.764 Reading package lists...
#4 8.213 W: Failed to fetch http://packages.cloud.google.com/apt/dists/cloud-sdk/main/binary-all/Packages 502 Bad Gateway [IP: 108.177.127.138 80]
#4 8.213 W: Some index files failed to download. They have been ignored, or old ones used instead.
 
The above always used to work, but now it doesnt anymore.
Could it be that something has shifted around in the GCP package repo?
 
Many thanks in advance,

 

Solved Solved
4 9 1,406
1 ACCEPTED SOLUTION

This appears to be fixed for me now. 

View solution in original post

9 REPLIES 9

I share your frustration. The instability of Google's APT repositories has severely disrupted my CI/CD processes as well.

I also just started having the same problem. 

I've been having the same problem all day. 

This appears to be fixed for me now. 

I'm facing the same issue, since few hours ago.

7.969 W: Failed to fetch http://packages.cloud.google.com/apt/dists/cloud-sdk/main/binary-arm64/Packages 502 Bad Gateway [IP: 142.250.179.110 80]
7.969 W: Some index files failed to download. They have been ignored, or old ones used instead.

Hello, 

I have same problem, 

Err:11 http://packages.cloud.google.com/apt cloud-sdk-buster/main all Packages
502 Bad Gateway [IP: 74.125.140.100 80]

i am also facing the same issue

Err:6 http://packages.cloud.google.com/apt cloud-sdk/main amd64 Packages
502 Bad Gateway [IP: 142.251.175.102 80]
Err:7 http://packages.cloud.google.com/apt cloud-sdk/main all Packages

I fixed it using https instead of http

This once again started happening a few hours ago. Moving from `http` to `https` seems to have fixed the issue as @Bruno_G suggested.