Bad gateway error while installing GCSFuse
Asked Answered
I

2

5

I am trying to install GCSFuse using the following command:

gcsFuseRepo=gcsfuse-`lsb_release -c -s`; \     
echo "deb http://packages.cloud.google.com/apt $gcsFuseRepo main" | \     
tee /etc/apt/sources.list.d/gcsfuse.list; \     
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \     
apt-key add -; \     
apt-get update; \     
apt-get install -y gcsfuse \     
&& apt-get clean

I received the following error:

E: Failed to fetch http://packages.cloud.google.com/apt/pool/gcsfuse-buster/gcsfuse_1.2.0_amd64_0e91d38c68c91349633d37c17e1586e6.deb 502 Bad Gateway [IP: xxx.xxx.xx.xxx 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

The error log suggests a failure in fetching the gcsfuse package due to a 502 Bad Gateway error. I tried running apt-get update and --fix-missing as suggested by the error message, but the issue persists.

I was expecting successful installation of GCSFuse. Any help to resolve this issue would be greatly appreciated.

Insufferable answered 12/10, 2023 at 5:30 Comment(0)
I
11

The error occured because the url used in /etc/apt/sources.list.d/gcsfuse.list file used HTTP protocol instead of HTTPS protocol. After updating /etc/apt/sources.list.d/gcsfuse.list file with the https:// url, installation worked fine:

sudo rm /etc/apt/sources.list.d/gcsfuse.list
export GCSFUSE_REPO=gcsfuse-`lsb_release -c -s`
echo "deb https://packages.cloud.google.com/apt $GCSFUSE_REPO main" | sudo tee /etc/apt/sources.list.d/gcsfuse.list
Insufferable answered 12/10, 2023 at 5:38 Comment(1)
Thank you, this solved my issue when installing gcloud in a Docker containerAdah
H
0

Another source of error can come from this issue. A workaround has been proposed here.

GCSFUSE_VERSION=1.2.0

apt-get update -y && \
    curl -LJO "https://github.com/GoogleCloudPlatform/gcsfuse/releases/download/v${GCSFUSE_VERSION}/gcsfuse_${GCSFUSE_VERSION}_amd64.deb" && \
    apt-get -y install fuse && \
    apt-get clean && \
    dpkg -i "gcsfuse_${GCSFUSE_VERSION}_amd64.deb"
Harding answered 15/1, 2024 at 10:52 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.