ddev on ZFS: Service 'db' failed to build : failed to copy files: copy file range failed: invalid argument - docker

Service 'db' failed to build : failed to copy files: copy file range failed: invalid argument
Happens with any new project after
This error happens when launching any of my ddev projects or when creating a new one with ddev config.
Update: This happens only when docker data (/var/lib/docker by default) is on a ZFS volume. The problem disappeared as soon as I moved it to EXT4.
It does not seem to be a problem with docker or docker compose, as I have launched the example/hello-world containers of both projects successfully.
I have tried removing ~/.ddev, downgrading ddev, and downgrading docker. I was not able to downgrade docker-compose.
Log:
$ 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: ""
System:
Docker 20.10.1
docker-compose 1.27.4
Manjaro Linux (Arch derivative)
ZFS 2.0.0-1 (on root)
docker info
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
Update: This fixed itself after a complete system reinstall; unfortunately I have no idea how the reinstall might have helped.

(Don't have enough reputation to comment, but this isn't a full answer.)
I hit the same issue, also with Docker on Arch w/ZFS. I was able to "fix" it by passing DOCKER_BUILDKIT=0 docker build .... It appears to be an issue somewhere in buildkit.
I haven't dug in any further to see what specifically is causing the issue.

Related

Running docker I got error : Bind address needs a port: 127.0.0.1

After reinstalling my Kubuntu 18 I try to install docker-ce
and running app I got error :
$ docker-compose up
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
serge#AtHome:/mnt/_work_sdb8/wwwroot/lar/PerlerWealth/master$ export DOCKER_HOST=127.0.0.1
serge#AtHome:/mnt/_work_sdb8/wwwroot/lar/PerlerWealth/master$ docker-compose up -d --build
Traceback (most recent call last):
File "/usr/bin/docker-compose", line 11, in <module>
load_entry_point('docker-compose==1.17.1', 'console_scripts', 'docker-compose')()
File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 68, in main
command()
...
File "/usr/lib/python2.7/dist-packages/docker/utils/utils.py", line 373, in parse_host
"Bind address needs a port: {0}".format(addr))
docker.errors.DockerException: Bind address needs a port: 127.0.0.1
Why errors and how to fix this error ?
Related app versions and config info :
root#AtHome:~/Downloads# docker --version
Docker version 19.03.13, build 4484c46d9d
root#AtHome:~/Downloads# docker-compose --version
docker-compose version 1.17.1, build unknown
root#AtHome:~/Downloads# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
root#AtHome:~/Downloads# docker info
Client:
Debug Mode: false
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 19.03.13
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
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: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 8fba4e9a7d01810a393d5d25a3621dc101981175
runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
init version: fec3683
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.15.0-20-generic
Operating System: Ubuntu 18.04.5 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.711GiB
Name: AtHome
ID: FGEV:TTKB:COS7:VUEW:7C2T:UJWK:2L66:Y6UE:APLU:M5HG:R5DG:3RN7
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
WARNING: No swap limit support
MODIFIED :
root#AtHome:~/Downloads# docker --version
Docker version 19.03.13, build 4484c46d9d
root#AtHome:~/Downloads# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
root#AtHome:~/Downloads# sudo usermod -aG docker $USER
root#AtHome:~/Downloads# sudo newgrp - docker
root#AtHome:/root# sudo systemctl enable docker
Synchronizing state of docker.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable docker
root#AtHome:/root# sudo systemctl start docker
root#AtHome:/root# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
I have all /etc files from prior working installation, but which config
files have I to look at or some missing options or permissions lacking ?
Thanks in advance!

Error response "proxyconnect tcp: EOF" from daemon when running docker run hello-world in docker quickstart terminal

I'm running docker toolbox on windows version 10.0.15063 behind corporate proxy, and I'm getting the following error when i run the command docker run hello-world
Unable to find image 'hello-world:latest' locally
C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: Get https://registry-1.docker.io/v2/: proxyconnect tcp: EOF.
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'
I'm getting the same error on attempting to login to docker using docker login.
I've already tried exporting HTTPS_PROXY and HTTP_PROXY in /Docker Toolbox/start.sh and adding the same to my environment variables but none of these approaches seem to be working.
Here's my docker info
$ docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 18.09.6
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: bb71b10fd8f58240ca47fbb579b9d1028eea7c84
runc version: 2b18fe1d885ee5083ef9f0838fee39b62d653e30
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.14.116-boot2docker
Operating System: Boot2Docker 18.09.6 (TCL 8.2.1)
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 989.4MiB
Name: default
ID: PNCR:EWZF:D4O3:7KDP:UW7W:4NEO:YGTT:CHWV:VF5U:YTE6:GD66:WKHS
Docker Root Dir: /mnt/sda1/var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
HTTP Proxy: http://xxxx:xxxx
HTTPS Proxy: https://xxxxx:xxxx
No Proxy: 192.168.99.100
Registry: https://index.docker.io/v1/
Labels:
provider=virtualbox
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Here's what i get on ssh-ing into the default machine and running sudo vi /var/lib/boot2docker/profile
CACERT=/var/lib/boot2docker/ca.pem
DOCKER_HOST='-H tcp://0.0.0.0:2376'
DOCKER_STORAGE=aufs
DOCKER_TLS=auto
SERVERKEY=/var/lib/boot2docker/server-key.pem
SERVERCERT=/var/lib/boot2docker/server.pem
export "HTTP_PROXY=http://proxy2:8080"
export "HTTPS_PROXY=https://proxy2:8080"
export "NO_PROXY=192.168.99.100"
I'm I missing something? I've been working on this for the last hour without any luck.
I actually figured it out.
I was initially using corporate network while working on this, and the networking team has blacklisted every ip and then white-listed the trusted ones. That was what was causing the whole problem while trying to connect to an external registry.
These are the steps I followed to fix the issue:
I switched to my personal network then disabled the proxy ie. Under Internet Properties > Switch to automatic Configuration > Automatically detect settings.
Removed the HTTP_PROXY and HTTPS_PROXY exports from start.sh in C:\Program Files\Docker Toolbox
Opened Windows Firewall > Advanced Settings > Inbound Rules > Add New Rule; Then
Created a Custom rule with a range ip range of 1-100, then named it Docker.
Deleted the .Virtualbox folder from C:\Users\myusername*
Restarted Docker Quickstart Terminal. It created a new default docker-machine and updated the configuration settings, and now pulling images from external registries is working fine.

exec: "docker-runc": executable file not found in $PATH: unknown

Using ubuntu 18.04
after upgrading docker to "Docker version 18.09.0-ce-tp5, build 9eb3d36"
Everything works fine before updating docker
Getting following error on docker-compose up:
ERROR: for mysql_1 Cannot start service mysql: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/containerd/io.containerd.runtime.v1.linux/moby/242793c2e7ad05e93ccff53ae37e5d8b054a72f9c2076c1b480f33929dbb45aa/log.json: no such file or directory): exec: "docker-runc": executable file not found in $PATH: unknown
docker info gives
linux#linux-linux:/$ docker info
Containers: 14
Running: 14
Paused: 0
Stopped: 0
Images: 1091
Server Version: 18.09.0-ce-tp5
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 1038
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: containerd runc
Default Runtime: containerd
Init Binary: docker-init
containerd version: ce243288e27971e324363de8f322d221635a8521 (expected: 468a545b9edcd5932818eb9de8e72413e616e86e)
runc version: 1555a78945e56737bc3d15565191d857ee6fa2b9 (expected: 69663f0bd4b60df09991c08812a60108003fa340)
init version: fec3683
Security Options:
apparmor
Kernel Version: 4.15.0-32-generic
Operating System: Ubuntu 18.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.719GiB
Name: linux-linux
ID: F475:F7JY:3HSG:XLGM:BAPD:CZYD:HRRO:SN3N:SFSX:7XOK:VDZ4:SNMV
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
WARNING: No swap limit support
Using ubuntu 18.04 after upgrading docker to "Docker version 18.09.0-ce-tp5, build 9eb3d36"
The TP# releases are pre beta (I suspect it stands for technical preview). These will have issues, and there were lots of changes with the containerd integration. You can try upgrading to beta1, or go back to the stable 18.06.1 release. You can see the releases here:
https://github.com/docker/docker-ce/releases
Issue:
I faced the same issue.
Solution
first i restart docker,but when i tried to start my container i was having Error response from daemon: OCI runtime create failed: container with id exists:xxxxxxxxxx
but in ps -a it was showing nothing.
while i was able to run the new container using the same id.
than tried
reboot my server and it is working fine.
as you can see in this 2 rows:
containerd version: ce243288e27971e324363de8f322d221635a8521 (expected: 468a545b9edcd5932818eb9de8e72413e616e86e)
runc version: 1555a78945e56737bc3d15565191d857ee6fa2b9 (expected: 69663f0bd4b60df09991c08812a60108003fa340)
docker expects another internal container id as the tagged container has. i guess this causes the problem.
have you tried to rebuild your container?
I faced a similar problem.
Try committing your container.
Then run it again.
e.g.
docker commit RUNNING_CONTAINER IMAGE1
docker run -d IMAGE1
service docker restart solved the problem in my case

Cannot exec to a running container

After running docker container,docker run -d --name nginx nginx, I cannot use "docker exec", docker exec nginx echo 123, on this container.
I'm receiving an error:
ERRO[2018-08-19T11:09:10.909894729+03:00] stream copy error: reading from a closed fifo
ERRO[2018-08-19T11:09:10.909988081+03:00] stream copy error: reading from a closed fifo
ERRO[2018-08-19T11:09:10.931102317+03:00] Error running exec 19c6ae3c5d796180e02577f037f6a1bd1453b70393098643719dea3537933ae2 in container: OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "process_linux.go:86: executing setns process caused \"exit status 22\"": unknown`
OS: ubuntu 14.04
Kernel: 3.13.0-153-generic
Docker: Docker version 18.06.0-ce, build 0ffa825
Docker Info:
Containers: 1
Running: 1
Paused: 0
Stopped: 0
Images: 1
Server Version: 18.06.0-ce
Storage Driver: aufs
Root Dir: /var/lib/docker/165536.165536/aufs
Backing Filesystem: extfs
Dirs: 5
Dirperm1 Supported: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: d64c661f1d51c48782c9cec8fda7604785f93587
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
apparmor
userns
Kernel Version: 3.13.0-153-generic
Operating System: Ubuntu 14.04.5 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 3.86GiB
Name: **************
ID: OL25:ISXX:RWR7:EY76:OQ6O:XLWG:ETWJ:FV2A:MC6A:ROP7:6DWD:DJX4
Docker Root Dir: /var/lib/docker/165536.165536
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Thanks!
That can happen when them use ENTRYPOINT instead of CMD. Check your image/container with "docker inspect". Your commandline argument becomes a CMD of ENTRYPOINT.
https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact
I could reproduce this issue whenever I executed docker run -it opensuse/leap followed by exit command. The container is actually stopped after exit command, but still showed running in docker ps.
Solution: Restart your docker daemon. And then try running your containers once again. If they stop, they won't show running status.
command: service docker restart
This worked in my case.
Please update your Kernel. Although Docker should work with most Kernel 3.10+ versions, there are often low level issues with older Kernels. See also https://github.com/moby/moby/issues/36084#issuecomment-364886573 for a seemingly same issue with a working solution:
updated to HWE ( 4.13.0-32-generic) and exec works again, however keep in mind that stock 16.04 uses 4.4.0 kernels - there should some kind of warning (at least) that specific versions combination will not work

Docker Hub login behind a proxy

I recently installed Docker 18.04.0-ce on my Ubuntu 17.10 VM. While working behind a proxy I got stuck trying to log in into the Docker Hub registry. So when I run:
docker login -u <username> -p <cool password>
And I get this message:
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http:
request canceled while waiting for connection (Client.Timeout exceeded while
awaiting headers)
As far as my understanding goes from the research I did is that when you are behind a proxy and you want to use Docker you need to configure it accordingly even though having set your environment variable like so:
http_proxy=<my_proxy>
https_proxy=<my_proxy>
HTTP_PROXY=<my_proxy>
HTTPS_PROXY=<my_proxy>
Second, it looks like that Docker has multiple levels of proxy configurations meaning different configuration for build, containers, and the daemon.
I went and configured all of those to match my proxy, but I still get that message. YES, I DID RESTART the service and the daemon.
UPDATE:
$ docker info
Containers: 8
Running: 0
Paused: 0
Stopped: 8
Images: 12
Server Version: 18.04.0-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 773c489c9c1b21a6d78b5c538cd395416ec50f88
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.13.0-39-generic
Operating System: Ubuntu 17.10
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 7.79GiB
Name: docker-vb
ID: 447I:6DFI:JZ7V:F6SZ:BUCB:IFB2:4HGT:MXK2:Y5H5:EECC:FIQN:SZOH
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
HTTP Proxy: http://<proxy_ip>:<proxy_port>
HTTPS Proxy: http://<proxy_ip>:<proxy_port>
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
The docker login typically needs to be run with sudo priviledges, so ensure that the HTTPS_PROXY environment is actually preserved. Simply done by
export HTTPS_PROXY=<your proxy>
Or simply pass it on the command line:
sudo HTTPS_PROXY=<your proxy> docker login -u <user> <registry>
The docker daemon doesn't need to be restarted.
The above works fine (we use extensivelye proxies at work).
There may be some issues with your network reachability, proxy, and possibly the registry. The docker log can provide some clues:
Ubuntu: sudo journalctl -fu docker.service
RHEL: /var/log/messages | grep docker

Resources