【问题标题】:ddev on ZFS: Service 'db' failed to build : failed to copy files: copy file range failed: invalid argumentZFS 上的 ddev:服务“db”构建失败:复制文件失败:复制文件范围失败:参数无效
【发布时间】:2021-01-05 18:12:44
【问题描述】:

服务“db”构建失败:复制文件失败:复制文件范围失败:参数无效 发生在任何新项目之后

启动我的任何 ddev 项目或使用 ddev config 创建新项目时都会发生此错误。

更新:仅当 docker 数据(默认为 /var/lib/docker)位于 ZFS 卷上时才会发生这种情况。我将其移至 EXT4 后问题就消失了。

docker 或 docker compose 似乎没有问题,因为我已经成功启动了两个项目的 example/hello-world 容器。

我已尝试删除 ~/.ddev、降级 ddev 和降级 docker。我无法降级 docker-compose。

日志:

$ ddev start                                                                                                                                     
Starting test... 
mkcert may not be properly installed, we suggest installing it for trusted https support, `brew install mkcert nss`, `choco install -y mkcert`, etc. and then `mkcert -install` 
Running   Command=ip address show dev docker0
Building db 
Service 'db' failed to build : failed to copy files: copy file range failed: invalid argument 
Failed to start test: Failed to run docker-compose [-f /home/tester/htdocs/test/.ddev/.ddev-docker-compose-full.yaml up --build -d], err='exit status 1', stdout='Step 1/6 : ARG BASE_IMAGE
Step 2/6 : FROM $BASE_IMAGE
 ---> 33f3288968e4
Step 3/6 : ARG username
', stderr='Building db
Service 'db' failed to build : failed to copy files: copy file range failed: invalid argument' 

config.yml

name: test
type: php
docroot: ""
php_version: "7.3"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
mariadb_version: "10.2"
mysql_version: ""
provider: default
use_dns_when_possible: true
composer_version: ""

系统:

  • Docker 20.10.1
  • docker-compose 1.27.4
  • Manjaro Linux(Arch 衍生版)
  • ZFS 2.0.0-1(在根上)

码头工人信息

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-tp-docker)

Server:
 Containers: 1
  Running: 1
  Paused: 0
  Stopped: 0
 Images: 27
 Server Version: 20.10.1
 Storage Driver: zfs
  Zpool: rpool
  Zpool Health: ONLINE
  Parent Dataset: rpool/root
  Space Used By Parent: 20958640128
  Space Available: 282678809088
  Parent Quota: no
  Compression: off
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b.m
 runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.10.2-2-MANJARO
 Operating System: Manjaro Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 30.9GiB
 Name: testpc
 ID: BKDP:GAWJ:BUCV:OVP6:QUKY:UQCZ:AESP:V3AN:EXHE:BWJU:4TT7:YPEO
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

更新:这在重新安装完整系统后自行修复;不幸的是,我不知道重新安装可能有什么帮助。

【问题讨论】:

  • 很遗憾,我无法再将 Manjaro 带到 Parallels 上。但是您能否简要介绍一下此脚本的输出:gist.github.com/rfay/361c4e1df165774a5262268ef6768884 并在此处发布链接?正在构建数据库的所有内容是 gist.github.com/rfay/20f519f3ad7aecc6f63109857cc92d2a 我建议您删除所有图像 docker rmi -f $(docker images -q) - 这样如果有损坏的图像可以为您重新拉出。
  • @rfay 感谢您对此进行调查。我删除了图像并运行了脚本。构建 db 服务时发生了同样的错误。 gist.github.com/gbytedev/aa06933122aca020bbeafdd7783cbd87
  • 我刚刚安装了 Manjaro 20.2.1,安装了 docker (20.10.1) 和 docker-compose (1.27.4) ,安装了 ddev (1.16.5)。没有任何麻烦。恐怕就像经常发生的那样,Manjaro/Arch 已经把你搞砸了。内核 5.9.16-1 和 5.10.2-2 都可以工作。我只能建议您完全卸载 docker 并清除所有数据并重新安装。除此之外……你的系统出了点问题。
  • @rfay 感谢您为我解决所有麻烦。我刚刚发现只有当 docker 文件夹位于 ZFS 卷上时才会发生错误。我把它移到了一个外部 EXT4 格式的 SSD 上,瞧,至少我可以继续工作。如果您有更多指点,请告诉我。
  • @gbyte 感谢您的报告。我建议更改问题的标题:添加提及 zfs。例如。 "从 zfs 分区复制文件失败"

标签: docker docker-compose zfs ddev


【解决方案1】:

(没有足够的声誉来发表评论,但这不是一个完整的答案。)

我遇到了同样的问题,在带有 ZFS 的 Arch 上的 Docker 也是如此。我能够通过传递DOCKER_BUILDKIT=0 docker build ... 来“修复”它。这似乎是 buildkit 中某处的问题。

我还没有进一步研究具体是什么导致了这个问题。

【讨论】:

  • 感谢您提供的解决方法。您应该可以在您的 .zshrc、.profile 或其他文件中使用 export DOCKER_BUILDKIT=0 关闭您的环境中的 buildkit。
  • 问题来了:github.com/moby/buildkit/issues/1758 - 你们中的哪一个可以跟进一个他们可以使用的测试用例吗?
  • @rfay 环境变量的解决方法对我不起作用。我将 DOCKER_BUILDKIT=0 放入 /etc/environment 并重新登录以确保。
  • @gbyte 你是直接使用 Docker 还是 docker-compose。如果您使用 docker-compose,您可能还需要设置 COMPOSE_DOCKER_CLI_BUILD=1。编辑:在提到错误的用户。
  • 感谢@Jack,是的,我相信 ddev 使用 docker-compose,但我仍然收到这些错误,即使在验证两个 env 变量设置正确之后也是如此。
猜你喜欢
  • 2020-05-02
  • 1970-01-01
  • 1970-01-01
  • 2018-11-08
  • 1970-01-01
  • 1970-01-01
  • 2019-11-28
  • 2017-01-24
  • 1970-01-01
相关资源
最近更新 更多