docker commit REST API error: {"message":"invalid JSON: got EOF while reading request body"} #45543
Labels
kind/bug
Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.
kind/regression
status/confirmed
version/23.0
Description
Issue:
After Latest version of docker (23.0.6, build ef23cbc) fails to commit a container when using HTTP REST API.
CentOS 7 and fully patched
Docker version 20.10.24, build 297e128
Using sample documentation provided by Docker to commit a container via HTTP REST API:
https://docs.docker.com/engine/api/sdk/examples/#commit-a-container
curl --unix-socket /var/run/docker.sock -X POST "http://localhost/commit?container=2211ef44b&repo=helloworld:1"
{"Id":"sha256:66d20a926be6267867b0060ddefb2dc50cc4fc6bf3fce53354867239095b80e6"}
Upgrade to latest docker-ce engine: Docker version 23.0.6, build ef23cbc
Repeat test:
curl --unix-socket /var/run/docker.sock -X POST "http://localhost/commit?container=2211ef44b&repo=helloworld:2"
{"message":"invalid JSON: got EOF while reading request body"}
Downgrade docker-ce: yum downgrade 3:docker-ce-20.10.24-3.el7.x86_64
Interestingly version still shows previous:
[root@docker-centos ~]# docker -v
Docker version 23.0.6, build ef23cbc
Repeat test again:
curl --unix-socket /var/run/docker.sock -X POST "http://localhost/commit?container=2211ef44b&repo=helloworld:2"
{"Id":"sha256:d945f4cff496ba4c5851a153050e196c470cc8524ae7c52e0370ae0d0557bde3"}
This is also happening in my production environment using RHEL8 and Rocky Linux 8.
Not sure what has changed. If I need to make changes on my end, could someone point me to the proper documentation?
Thanks,
valenbb
Reproduce
Expected behavior
curl --unix-socket /var/run/docker.sock -X POST "http://localhost/commit?container=2211ef44b&repo=helloworld:2" should produce an output as below:
{"Id":"sha256:d945f4cff496ba4c5851a153050e196c470cc8524ae7c52e0370ae0d0557bde3"}
docker version
Client: Docker Engine - Community Version: 23.0.6 API version: 1.41 (downgraded from 1.42) Go version: go1.19.9 Git commit: ef23cbc Built: Fri May 5 21:21:29 2023 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 20.10.24 API version: 1.41 (minimum version 1.12) Go version: go1.19.7 Git commit: 5d6db84 Built: Tue Apr 4 18:21:02 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.21 GitCommit: 3dce8eb055cbb6872793272b4f20ed16117344f8 runc: Version: 1.1.7 GitCommit: v1.1.7-0-g860f061 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: