google-cloud-platformgoogle-cloud-rungcsfuse

Bad gateway error while installing GCSFuse


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.


Solution

  • 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