Red5d / docker-autocompose

Generate a docker-compose yaml definition from a running container
1.76k stars 197 forks source link

Cant retrive compose file #60

Closed Mega-Bits closed 7 months ago

Mega-Bits commented 1 year ago

Hello,

for some reason this command docker run --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/red5d/docker-autocompose <CONTAINER NAME> doesnt work for me and returns this error.

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/docker-6.0.1-py3.11.egg/docker/api/client.py", line 214, in _retrieve_server_version
    return self.version(api_version=False)["ApiVersion"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker-6.0.1-py3.11.egg/docker/api/daemon.py", line 181, in version
    return self._result(self._get(url), json=True)
                        ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker-6.0.1-py3.11.egg/docker/utils/decorators.py", line 46, in inner
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker-6.0.1-py3.11.egg/docker/api/client.py", line 237, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/requests-2.30.0-py3.11.egg/requests/sessions.py", line 600, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/requests-2.30.0-py3.11.egg/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/requests-2.30.0-py3.11.egg/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/requests-2.30.0-py3.11.egg/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/urllib3-2.0.2-py3.11.egg/urllib3/connectionpool.py", line 790, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/urllib3-2.0.2-py3.11.egg/urllib3/connectionpool.py", line 496, in _make_request
    conn.request(
TypeError: HTTPConnection.request() got an unexpected keyword argument 'chunked'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/app/./autocompose.py", line 295, in <module>
    main()
  File "/usr/src/app/./autocompose.py", line 104, in main
    cfile, c_networks, c_volumes = generate(cname, createvolumes=args.createvolumes)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/./autocompose.py", line 143, in generate
    c = docker.from_env()
        ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker-6.0.1-py3.11.egg/docker/client.py", line 96, in from_env
    return cls(
           ^^^^
  File "/usr/local/lib/python3.11/site-packages/docker-6.0.1-py3.11.egg/docker/client.py", line 45, in __init__
    self.api = APIClient(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker-6.0.1-py3.11.egg/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker-6.0.1-py3.11.egg/docker/api/client.py", line 221, in _retrieve_server_version
    raise DockerException(
docker.errors.DockerException: Error while fetching server API version: HTTPConnection.request() got an unexpected keyword argument 'chunked'

Thats my docker version output:

Client: Docker Engine - Community
 Version:           23.0.5
 API version:       1.42
 Go version:        go1.19.8
 Git commit:        bc4487a
 Built:             Wed Apr 26 16:21:07 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          23.0.5
  API version:      1.42 (minimum version 1.12)
  Go version:       go1.19.8
  Git commit:       94d3ad6
  Built:            Wed Apr 26 16:21:07 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.20
  GitCommit:        2806fc1057397dbaeefbea0e4e17bddfbd388f38
 runc:
  Version:          1.1.5
  GitCommit:        v1.1.5-0-gf19387a
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

I am using ubuntu 22.04. Any ideas? Filled my storage full earlier (0% space left on drive) that bricked my docker logs. Dont know if this is relevant. Hope some of you can help me.

cryptedx commented 1 year ago

I tried is right now and have the same problem and same specs like you only my storage is not full.

kroese commented 1 year ago

This problem is introduced in the last build by a python package this project uses, called urllib3.

It is documented here: https://github.com/docker/docker-py/issues/3113

That broken package already has been fixed, so all that needs to happen is for this project to create a new image with the updated package.

As a temporary workaround you can use the previous image:

docker pull ghcr.io/red5d/docker-autocompose@sha256:63f9d66f2de77fe225e50316a76d3198113ae8a348db08060790a31639680876

Red5d commented 7 months ago

Latest version seems to be working now.