8000 Docker daemon crash on copy file · Issue #49886 · moby/moby · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Docker daemon crash on copy file #49886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
noahfraiture opened this issue Apr 27, 2025 · 2 comments
Closed

Docker daemon crash on copy file #49886

noahfraiture opened this issue Apr 27, 2025 · 2 comments

Comments

@noahfraiture
Copy link
noahfraiture commented Apr 27, 2025

Description

Hello,

I'm writing an application in Go that test code in docker container. I've created image ready to test code, so I simply copy files on the container, start it, wait for it to finish, and get the logs.

Most of the time there's no issue.
However, sometimes, the CopyToContainer makes the docker daemon crash shutting down the containers running, like my database and giving me this error error during connect: Put "http://%2Fvar%2Frun%2Fdocker.sock/v1.47/containers/b1a3efe79b70816055ecbce4001a53a07772c3b7568472509b902830a094792e/archive?noOverwriteDirNonDir=true&path=%2F": EOF

Of course I can restart them but it's not great because it slow down everything and invalidate every container running at this moment.

The problem occurs sometimes, but not always without any difference visible. The problem occurs even with no concurrency in the program, so no race condition possible.

I'm on NixOS with Docker version 27.5.1, build v27.5.1.

Is it bug from the docker daemon, or the API, or something else ?

Reproduce

The logic is the following

	defer func() {
		if err != nil {
			StopAndRemove(ctx, cli, ctn)
		}
	}()
	archive, err := createTarArchive(files)
	// FIX: error here
	err = cli.CopyToContainer(ctx, ctn, "/", archive, container.CopyToContainerOptions{})
	startTime := time.Now()
	err = cli.ContainerStart(ctx, ctn, container.StartOptions{})
	statusCh, errCh := cli.ContainerWait(ctx, ctn, container.WaitConditionNotRunning)
	logs, err := cli.ContainerLogs(ctx, ctn, container.LogsOptions{
		ShowStdout: true,
		ShowStderr: false,
		Since:      startTime.Format(time.RFC3339),
	})
	defer logs.Close()
	var logBytes bytes.Buffer
	_, err = io.Copy(&logBytes, logs)

I removed error management, comments and logs from the snippet to keep it short and easily understandable.

Run this code a lot, and at some point, you'll get error during connect: Put "http://%2Fvar%2Frun%2Fdocker.sock/v1.47/containers/b1a3efe79b70816055ecbce4001a53a07772c3b7568472509b902830a094792e/archive?noOverwriteDirNonDir=true&path=%2F": EOF with every container crashing

Expected behavior

It should not crash

docker version

Client:
 Version:           28.1.1
 API version:       1.49
 Go version:        go1.24.2
 Git commit:        v28.1.1
 Built:             Thu Jan  1 00:00:00 1970
 OS/Arch:           linux/amd64
 Context:           default

Server:
 Engine:
  Version:          28.1.1
  API version:      1.49 (minimum version 1.24)
  Go version:       go1.24.2
  Git commit:       v28.1.1
  Built:            Tue Jan  1 00:00:00 1980
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v2.0.4
  GitCommit:        refs/tags/v2.0.4
 runc:
  Version:          1.2.6
  GitCommit:        
 docker-init:
  Version:          0.19.0
  GitCommit:

docker info

Client:
 Version:    28.1.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.22.0
    Path:     /nix/store/mmr7gyz1m6rilqiiwhrdgfczad24jd0v-docker-plugins/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  2.35.1
    Path:     /nix/store/mmr7gyz1m6rilqiiwhrdgfczad24jd0v-docker-plugins/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 33
  Running: 1
  Paused: 0
  Stopped: 32
 Images: 13
 Server Version: 28.1.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: journald
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: refs/tags/v2.0.4
 runc version: 
 init version: 
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.12.24
 Operating System: NixOS 25.05 (Warbler)
 OSType: linux
 Architecture: x86_64
 CPUs: 20
 Total Memory: 15.31GiB
 Name: inspiron
 ID: 6933a2ea-24cf-4f9e-8e34-857dada18c71
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: noahfraiture
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false

Additional Info

You can find my code here https://github.com/noahfraiture/nexzap/

@noahfraiture noahfraiture added kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. status/0-triage labels Apr 27, 2025
@thaJeztah thaJeztah added kind/duplicate and removed status/0-triage kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. labels Apr 28, 2025
@thaJeztah
Copy link
Member

I see the daemon was built with go1.24, which has a bug that can cause segfaults (official docker packages are still built with go1.23); a fix for that has been merged, but not yet release (it will be in the upcoming go1.24.3 release) related;

Client:
 Version:           28.1.1
 API version:       1.49
 Go version:        go1.24.2

This looks to be a duplicate of;

I'll close this as duplicate of those.

@github-project-automation github-project-automation bot moved this from New to Accepted in Issue Triage Apr 28, 2025
@noahfraiture
Copy link
Author

Great thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants
0