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

Github Action execution is blocked due to a possible bug on the docker python library. #261

Closed
luzfcb opened this issue May 4, 2023 · 5 comments · Fixed by #262 or #263
Closed

Comments

@luzfcb
Copy link
Contributor

luzfcb commented May 4, 2023

Just to help anyone who uses this action and has a problem. There is a bug in docker python library that is not compatible with the latest versions of requests/urllib3.

The solution currently seems to be to force block the versions of requests and urllib3: "requests<2.29" "urllib3<2"

docker/docker-py#3113

Using image: ghcr.io/<user>/<repository>:<branch>
Size limit: 600MB
disl --version:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/docker/api/client.py", line [21](https://github.com/<user>/<repository>/actions/runs/4886637866/jobs/8722233048#step:11:22)4, in _retrieve_server_version
    return self.version(api_version=False)["ApiVersion"]
  File "/usr/local/lib/python3.9/site-packages/docker/api/daemon.py", line 181, in version
    return self._result(self._get(url), json=True)
  File "/usr/local/lib/python3.9/site-packages/docker/utils/decorators.py", line 46, in inner
    return f(self, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/docker/api/client.py", line 237, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 600, in get
    return self.request("GET", url, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 790, in urlopen
    response = self._make_request(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 496, in _make_request
    conn.request(
TypeError: request() got an unexpected keyword argument 'chunked'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/disl", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/docker_image_size_limit/__init__.py", line 19, in main
    client = docker.from_env()
  File "/usr/local/lib/python3.9/site-packages/docker/client.py", line 96, in from_env
    return cls(
  File "/usr/local/lib/python3.9/site-packages/docker/client.py", line 45, in __init__
    self.api = APIClient(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
  File "/usr/local/lib/python3.9/site-packages/docker/api/client.py", line [22](https://github.com/<user>/<repository>/actions/runs/4886637866/jobs/8722233048#step:11:23)1, in _retrieve_server_version
    raise DockerException(
docker.errors.DockerException: Error while fetching server API version: request() got an unexpected keyword argument 'chunked'
=================================

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/docker/api/client.py", line 214, in _retrieve_server_version
    return self.version(api_version=False)["ApiVersion"]
  File "/usr/local/lib/python3.9/site-packages/docker/api/daemon.py", line 181, in version
    return self._result(self._get(url), json=True)
  File "/usr/local/lib/python3.9/site-packages/docker/utils/decorators.py", line 46, in inner
    return f(self, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/docker/api/client.py", line [23](https://github.com/<user>/<repository>/actions/runs/4886637866/jobs/8722233048#step:11:24)7, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 600, in get
    return self.request("GET", url, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 790, in urlopen
    response = self._make_request(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 496, in _make_request
    conn.request(
TypeError: request() got an unexpected keyword argument 'chunked'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/disl", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/docker_image_size_limit/__init__.py", line 19, in main
    client = docker.from_env()
  File "/usr/local/lib/python3.9/site-packages/docker/client.py", line 96, in from_env
    return cls(
  File "/usr/local/lib/python3.9/site-packages/docker/client.py", line [45](https://github.com/<user>/<repository>/actions/runs/4886637866/jobs/8722233048#step:11:46), in __init__
    self.api = APIClient(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
  File "/usr/local/lib/python3.9/site-packages/docker/api/client.py", line 221, in _retrieve_server_version
    raise DockerException(
docker.errors.DockerException: Error while fetching server API version: request() got an unexpected keyword argument 'chunked'
================================

Failing with output:

Process failed with the status code: 1
@sobolevn
Copy link
Member

sobolevn commented May 4, 2023

Thanks for the report! Can we try bumping docker?

@luzfcb
Copy link
Contributor Author

luzfcb commented May 4, 2023

There has been an approved but unmerged fix on docker-py since yesterday docker/docker-py#3116 .

Currently, I guess for now it would be simpler and faster to release a 1.0.1 version that includes "requests<2.29" and "urllib3<2" and then remove that when docker finally fixes the problem, which might take a while.

@luzfcb
Copy link
Contributor Author

luzfcb commented May 4, 2023

On second thought, locking the requests and urllib3 versions directly in the Dockerfile might solve the Github Action error

@sobolevn
Copy link
Member

sobolevn commented May 4, 2023

PR is welcome

luzfcb added a commit to labcodes/docker-image-size-limit that referenced this issue May 5, 2023
Lock "requests" and urllib3 version to fix incompatibility with docker-py 6.0.1

Fixes wemake-services#261
luzfcb added a commit to labcodes/docker-image-size-limit that referenced this issue May 5, 2023
Lock "requests" and "urllib3" versions to fix incompatibility with docker-py 6.0.1

Fixes wemake-services#261
@luzfcb
Copy link
Contributor Author

luzfcb commented May 5, 2023

@sobolevn the PR: #262

sobolevn pushed a commit that referenced this issue May 5, 2023
Lock "requests" and "urllib3" versions to fix incompatibility with docker-py 6.0.1

Fixes #261
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants