Skip to content
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

docker-py exec api make docker daemon panic #981

Closed
xidianwlc opened this issue Mar 9, 2016 · 4 comments
Closed

docker-py exec api make docker daemon panic #981

xidianwlc opened this issue Mar 9, 2016 · 4 comments

Comments

@xidianwlc
Copy link

  • docker-py version 1.7.2
  • docker version 1.10.2
  • system use centos7
    cat /etc/system-release CentOS Linux release 7.1.1503 (Core)
  • my test script
import sys
from docker import Client
cli = Client(base_url='unix://var/run/docker.sock', version="1.22")
while True:
    cmd_str = raw_input(">>> ")
    if cmd_str == "exit":
        print ">>> bye"
        sys.exit(1)
    exec_instance = cli.exec_create("5ea878732fc9", cmd=cmd_str, stdout=True, stderr=True, stdin=True, user='root')
    exec_id = exec_instance["Id"]
    data = cli.exec_start(exec_id, tty=True, detach=True)
    print data

python exception
Traceback (most recent call last): File "test_exec.py", line 25, in <module> data = cli.exec_start(exec_id, tty=True, detach=True) File "/data/server/python/lib/python2.7/site-packages/docker_py-1.7.2-py2.7.egg/docker/utils/decorators.py", line 35, in wrapper return f(self, *args, **kwargs) File "/data/server/python/lib/python2.7/site-packages/docker_py-1.7.2-py2.7.egg/docker/api/exec_api.py", line 70, in exec_start self._url('/exec/{0}/start', exec_id), data=data, stream=stream File "/data/server/python/lib/python2.7/site-packages/docker_py-1.7.2-py2.7.egg/docker/client.py", line 170, in _post_json return self._post(url, data=json.dumps(data2), **kwargs) File "/data/server/python/lib/python2.7/site-packages/docker_py-1.7.2-py2.7.egg/docker/utils/decorators.py", line 47, in inner return f(self, *args, **kwargs) File "/data/server/python/lib/python2.7/site-packages/docker_py-1.7.2-py2.7.egg/docker/client.py", line 108, in _post return self.post(url, **self._set_request_timeout(kwargs)) File "/data/server/python/lib/python2.7/site-packages/requests/sessions.py", line 508, in post return self.request('POST', url, data=data, json=json, **kwargs) File "/data/server/python/lib/python2.7/site-packages/requests/sessions.py", line 465, in request resp = self.send(prep, **send_kwargs) File "/data/server/python/lib/python2.7/site-packages/requests/sessions.py", line 573, in send r = adapter.send(request, **kwargs) File "/data/server/python/lib/python2.7/site-packages/requests/adapters.py", line 415, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine("''",))
docker daemon logs:
time="2016-03-09T10:36:55.987375761+08:00" level=error msg="Error running exec in container: Cannot run exec command 8ec3200143bb2968cf54315509659915c98b5d5a6b55173533e6d172c7de2879 in cont panic: runtime error: invalid memory address or nil pointer dereference [signal 0xb code=0x1 addr=0x20 pc=0x6b32e3]

@TomasTomecek
Copy link
Contributor

...which means this is a bug in engine, not docker-py; server should definitely not segfault when client sends a request

@shin-
Copy link
Contributor

shin- commented Mar 9, 2016

Try updating the engine to 1.10.3?

moby/moby#20638

@shin-
Copy link
Contributor

shin- commented Mar 9, 2016

Ah, my bad, 1.10.3 isn't out yet. However there's a release candidate if you want to test it. https://github.com/docker/docker/releases/tag/v1.10.3-rc1

@TomasTomecek
Copy link
Contributor

@xidianwlc seems that you've hit this: moby/moby#20647

@shin- shin- closed this as completed Nov 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants