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

prefect 2.10.7 docker image unable to use DockerContainer block #9474

Closed
4 tasks done
kuiber opened this issue May 7, 2023 · 4 comments
Closed
4 tasks done

prefect 2.10.7 docker image unable to use DockerContainer block #9474

kuiber opened this issue May 7, 2023 · 4 comments
Labels
bug Something isn't working status:stale This may not be relevant anymore status:upstream An upstream issue caused by a bug in one of our dependencies

Comments

@kuiber
Copy link

kuiber commented May 7, 2023

First check

  • I added a descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the Prefect documentation for this issue.
  • I checked that this issue is related to Prefect and not one of its dependencies.

Bug summary

prefect 2.10.7 docker image unable to use DockerContainer block.

Reproduction

docker run -it -v /var/run/docker.sock:/var/run/docker.sock prefecthq/prefect:2.10.7-python3.11 python -c "import docker; print(docker.from_env())"

Error

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.11/site-packages/docker/client.py", line 96, in from_env
    return cls(
           ^^^^
  File "/usr/local/lib/python3.11/site-packages/docker/client.py", line 45, in __init__
    self.api = APIClient(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/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'

Versions

Version:             2.10.7
API version:         0.8.4
Python version:      3.11.3
Git commit:          5869f3fe
Built:               Thu, May 4, 2023 2:24 PM
OS/Arch:             linux/x86_64
Profile:             default
Server type:         ephemeral
Server:
  Database:          sqlite
  SQLite version:    3.34.1

Additional context

Running the same command with the 2.10.6 docker image returns a working docker client.

docker run -it -v /var/run/docker.sock:/var/run/docker.sock prefecthq/prefect:2.10.6-python3.11 python -c "import docker; print(docker.from_env())"
<docker.client.DockerClient object at 0x40021d6410>

I believe the issue is related to this bug in the docker-py project.

I've confirmed that the version of requests is upgraded in 2.10.7 from requests==2.28.2 to requests==2.30.0. Installing the older version of requests (which also downgrades urllib3 from 2.0.2 to 1.26.15) in the 2.10.7 image allows docker-py to work again.

pip uninstall requests
pip install requests==2.28.2

python -c "import docker; print(docker.from_env())"
<docker.client.DockerClient object at 0x4002273d10>

prefect version
Version:             2.10.7
API version:         0.8.4
Python version:      3.11.3
Git commit:          5869f3fe
Built:               Thu, May 4, 2023 2:24 PM
OS/Arch:             linux/x86_64
Profile:             default
Server type:         ephemeral
Server:
  Database:          sqlite
  SQLite version:    3.34.1
@kuiber kuiber added bug Something isn't working status:triage labels May 7, 2023
@zanieb
Copy link
Contributor

zanieb commented May 8, 2023

See docker/docker-py#3113 — this is fixed in the latest docker-py version. Our next release will have the latest docker-py version in our container image. In the meantime, you can install it on container start with the environment variable EXTRA_PIP_PACKAGES="docker>=6.1.0"

@zanieb zanieb added status:upstream An upstream issue caused by a bug in one of our dependencies and removed status:triage labels May 8, 2023
@swestrum-rii
Copy link

I don't think this was fixed, at least in the container taggedprefecthq/prefect2.10.8-python3.9 - will this be fixed in the next release?

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

This issue is stale because it has been open 30 days with no activity. To keep this issue open remove stale label or comment.

@github-actions github-actions bot added the status:stale This may not be relevant anymore label Jun 7, 2023
@github-actions
Copy link
Contributor

This issue was closed because it has been stale for 14 days with no activity. If this issue is important or you have more to add feel free to re-open it.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status:stale This may not be relevant anymore status:upstream An upstream issue caused by a bug in one of our dependencies
Projects
None yet
Development

No branches or pull requests

3 participants