[英]error: chmod on config.lock failed: Operation not permitted
I'm trying to deploy Atlantis on a Cloud Run Gen2 service with a GCS bucket mounted to it via gcsfuse .我正在尝试在 Cloud Run Gen2 服务上部署Atlantis ,并通过gcsfuse安装了 GCS 存储桶。
Most seems to work fine, the atlantis server starts and can handle requests properly.大多数似乎工作正常,亚特兰蒂斯服务器启动并可以正确处理请求。 Files are also written to the GCS bucket through gcsfuse.
文件也通过 gcsfuse 写入 GCS bucket。
But, when Atlantis tries to clone a git repository (as part of the: atlantis plan
commmand) it returns the following error:但是,当 Atlantis 尝试克隆 git 存储库(作为
atlantis plan
命令的一部分)时,它会返回以下错误:
running git clone --branch f/gcsfuse-cloudrun --depth=1 --single-branch https://xxxxxxxx:<redacted>@github.com/xxxxxxxx/xxxxxxxx.git /app/atlantis/repos/xxxxxxxx/xxxxxxxx/29/default: Cloning into '/app/atlantis/repos/xxxxxxxx/xxxxxxxx/29/default'...
error: chmod on /app/atlantis/repos/xxxxxxxx/xxxxxxxx/29/default/.git/config.lock failed: Operation not permitted
fatal: could not set 'core.filemode' to 'false'
: exit status 128
I believe that I'm very close but I'm not too knowledgeable on Linux file system permissions.我相信我非常接近,但我对 Linux 文件系统权限不太了解。
My Dockerfile is as following:我的 Dockerfile 如下:
FROM ghcr.io/runatlantis/atlantis:v0.21.1-pre.20221213-debian
USER root
# Install Python
ENV PYTHONUNBUFFERED=1
RUN apt-get update -y
RUN apt-get install -y python3 python3-pip
# 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 clean
# Set fallback mount directory
ENV MNT_DIR /app/atlantis
# Create mount directory for service
RUN mkdir -p ${MNT_DIR}
RUN chown -R atlantis /app/atlantis/
RUN chmod -R 777 /app/atlantis/
WORKDIR $MNT_DIR
# Copy local code to the container image.
ENV APP_HOME /app
WORKDIR $APP_HOME
COPY gcsfuse_run.sh ./
# Make the script an executable
RUN chmod +x /app/gcsfuse_run.sh
ENTRYPOINT ["/app/gcsfuse_run.sh"]
The entrypoint script ^, is as following:入口点脚本^,如下:
#!/usr/bin/env bash
set -eo pipefail
echo "Mounting GCS Fuse to $MNT_DIR"
gcsfuse -o allow_other -file-mode=777 -dir-mode=777 --implicit-dirs --debug_gcs --debug_fuse $BUCKET $MNT_DIR
echo "Mounting completed."
# This is a atlantis provided docker script that comes from the base image
/usr/local/bin/docker-entrypoint.sh server
Help is highly appreciated!非常感谢您的帮助!
We simulated the exact steps, but didn't face the issue.我们模拟了确切的步骤,但没有遇到问题。 Also we found the same type of issue on many places and for them below solutions worked:
我们还在许多地方发现了相同类型的问题,以下解决方案对它们有效:
The chmod operation is not supported by gcsfuse. gcsfuse 不支持 chmod 操作。 As such, the suggestion by @tulsi-shah (
git config --global --replace-all core.fileMode false
) would provide a work-around.因此,@tulsi-shah (
git config --global --replace-all core.fileMode false
) 的建议将提供一种解决方法。
https://github.com/googlecloudplatform/gcsfuse/blob/master/docs/semantics.md#inodes https://github.com/googlecloudplatform/gcsfuse/blob/master/docs/semantics.md#inodes
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.