简体   繁体   English

错误:config.lock 上的 chmod 失败:不允许操作

[英]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:我们还在许多地方发现了相同类型的问题,以下解决方案对它们有效:

  1. Run the server with sudo permission.使用 sudo 权限运行服务器。
  2. Restart the system.重启系统。
  3. git config --global --replace-all core.fileMode false git 配置 --global --replace-all core.fileMode false

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.

相关问题 无法设置文件修改时间,路径 = './pubspec.lock'(操作系统错误:不允许操作,errno = 1) - Failed to set file modification time, path = './pubspec.lock' (OS Error: Operation not permitted, errno = 1) 运行中的 Docker 容器内不允许执行 chmod 0777 操作 - Operation chmod 0777 not permitted inside a running Docker container Docker Apache:&#39;chmod:更改“文件”操作的权限不允许&#39; - Docker Apache: 'chmod: changing permissions of "file" Operation not permitted' RUN systemctl启动newrelic-infra,错误:无法获得D-Bus连接:不允许操作 - RUN systemctl start newrelic-infra,error :Failed to get D-Bus connection: Operation not permitted postgresql 容器未启动:chmod:更改“/bitnami/postgresql/data”的权限:不允许操作 - postgresql container not starting: chmod: changing permissions of '/bitnami/postgresql/data': Operation not permitted 使用 docker 文件错误构建映像:无法获得 D-Bus 连接:不允许操作 - Build image with docker file error: Failed to get D-Bus connection: Operation not permitted docker 中的 suricata 不允许操作错误 - suricata in docker have Operation not permitted Error Docker Centos7:无法将 tmpfs 挂载为 /run:不允许操作 - Docker Centos7: Failed to mount tmpfs as /run: Operation not permitted getsockopt奇怪地失败:在Docker-Compose中不允许进行该操作 - getsockopt failed strangely: Operation not permitted in Docker-Compose 无法获得 D-Bus 连接:不允许操作 - Failed to get D-Bus connection: Operation not permitted
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM