gcsfuse: Error Encountered When Mounting GCS Bucket using gcsfuse on Cloud Run following Official Tutorial
I have been following the official tutorial Using Cloud Storage FUSE with Cloud Run to mount a Google Cloud Storage bucket using gcsfuse on Cloud Run, and encountered an error during the deployment process.
Here’s the Dockerfile snippet based on the tutorial:
Dockerfile
FROM python:3.11-buster
Install system dependencies
RUN set -e;
apt-get update -y && apt-get install -y
tini
lsb-release;
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 cleanSet fallback mount directory
ENV MNT_DIR /mnt/gcs …
During the deployment, 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.
Any help to resolve this issue would be greatly appreciated as it’s crucial for our application to have a mounted GCS bucket for storing and accessing data.
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Reactions: 7
- Comments: 29
Commits related to this issue
- Work around broken gcsfuse apt repository Apply the workaround given in GoogleCloudPlatform/gcsfuse#1424. — committed to populationgenomics/hail by jmarshall 9 months ago
- Work around broken gcsfuse apt repository Apply the workaround given in GoogleCloudPlatform/gcsfuse#1424. — committed to populationgenomics/hail by jmarshall 9 months ago
- Installing and deploying GCFuse bug work around Google cloud is having issues with previous guidance pulling in gcsfuse: https://github.com/GoogleCloudPlatform/gcsfuse/issues/1424 — committed to JoeShook/udap-dotnet by deleted user 9 months ago
- change gcsfuse install due to https://github.com/GoogleCloudPlatform/gcsfuse/issues/1424#issuecomment-1749161971 — committed to fersantxez/transmission-ovpn-gcs by fersantxez 8 months ago
Thanks @kojima-takeo & @rmoskal for reporting the issue. We are investigating the issue and update here with fix as soon as possible. Meanwhile, could you please try using the below code for installing GCSFuse in your Ubuntu/Debian based Dockerfile:
@kojima-takeo for your use-case, the Dockerfile mentioned in https://github.com/GoogleCloudPlatform/gcsfuse/issues/1424#issue-1927877132 would look like:
Please reach out if you face issues with above installations.
http -> https is working! http://packages.cloud.google.com/apt -> https://packages.cloud.google.com/apt ~
Install gcsfuse
RUN apt-get update && apt-get install -y curl gnupg lsb-release RUN echo “deb https://packages.cloud.google.com/apt gcsfuse-buster main” > /etc/apt/sources.list.d/gcsfuse.list RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - RUN apt-get update && apt-get install -y gcsfuse
Hey @jaakkom & @aamarques . Apologies for the inconvenience here. The problem is arising due to use of “http://packages.cloud.google.com/” instead of “https://packages.cloud.google.com/” in cloud run’s document for installation of GCSFuse (e.g. Node.js Dockerfile).
We are working to get the Cloud run documents updated with the correct and official installation command i.e. (https://cloud.google.com/storage/docs/gcsfuse-install). e.g. we have updated the Python Dockerfile.
Meanwhile, we suggest to use the officially documented installation commands (https://cloud.google.com/storage/docs/gcsfuse-install) or the workarounds mentioned in this issue.
This fixed it for me: -RUN echo “deb http://packages.cloud.google.com/apt gcsfuse-bionic main” | tee /etc/apt/sources.list.d/gcsfuse.list +RUN echo “deb https://packages.cloud.google.com/apt gcsfuse-bionic main” | tee /etc/apt/sources.list.d/gcsfuse.list
@rmoskal Thank you for sharing your experience, and I appreciate the suggestion to rephrase the issue to highlight the problem with installing gcsfuse from the repo. It seems like this is a recent occurrence as the Dockerfile worked perfectly up until a week ago, with the issue starting around 2-3 days ago.
I share your surprise regarding the lack of widespread discussion on this matter, which may indeed suggest a limited number of users mounting GCS on Cloud Run with gcsfuse. However, the impact is significant for those of us relying on this setup for our applications.
I hope this issue gains the necessary attention for a prompt resolution. In the meantime, if anyone has discovered a workaround or alternative approach to mount GCS on Cloud Run, sharing it here would be immensely beneficial. Thank you again for your input and shared concern.
This should more likely be called, unable to install gcsFuse from the repo. In any case it’s happening to me as well, and is breaking my ability to deploy workloads based on the docker image. I’m surprisedf the internet is not BLOWING up about this!
Dear @sethiay
Thank you for your continuous support and insight. It was indeed a very basic oversight on my part. I have confirmed that the original code also installs curl. After applying your suggested code once again, I was able to successfully deploy. Your guidance has been invaluable, and I am deeply appreciative.
Thank you for the persistent support which has enabled me to deploy after a week, and I am looking forward to the progression of the project with great anticipation.
Best regards,