GoogleCloudPlatform / composer-local-dev

Apache License 2.0
75 stars 39 forks source link

Docker not available or failed to start after new version of requests #55

Open nbonnotte opened 5 months ago

nbonnotte commented 5 months ago

Today composer-dev failed to start with a message

Docker not available or failed to start. Please ensure docker service is installed and running.

It seems to come from the recent release of requests 2.32. It is a bug in the docker python library that is already traced, see https://github.com/docker/docker-py/issues/3256

Pinning requests to a previous version solves the issue

GabrielBoninUnity commented 5 months ago

same issue! pinning requests to version 2.31 in the dependency in setup.py is fixing the issue

dependencies = [ "click>=7.0", "google-auth==2.27.", "google-cloud-orchestration-airflow>=1.2.0", "google-cloud-artifact-registry>=1.2.0", "rich_click==1.4.0", "docker==6.", "requests==2.31" ]

nbonnotte commented 5 months ago

Alternatively, we can bump the version of docker following the release of 7.1.0. I have opened a PR #57

giuseppe-russo commented 3 months ago

same issue, is it possible to merge that PR ? Thanks

csoare7 commented 3 months ago

EDIT

Pinning docker to 7.1.0 works 🎉

If you are getting the error:

Docker not available or failed to start. Please ensure docker service is installed and running.
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory')

On macOS with Docker Desktop, check Enable default docker socket in Settings -> Advanced section - that should fix it.

ivan-toriya commented 2 months ago

Pinning docker to 7.1.0 doesn't work for me. Same error.

                    DEBUG    docker.utils.config:Trying paths: ['/home/ivan/.docker/config.json', '/home/ivan/.dockercfg']                                      config.py:21
                    DEBUG    docker.utils.config:Found file at path: /home/ivan/.docker/config.json                                                             config.py:25
                    DEBUG    docker.auth:Found 'credsStore' section                                                                                              auth.py:177
                    DEBUG    root:Docker not found.                                                                                                       environment.py:470

**Traceback ommited**

╭─ Error ───────────────────────────────────────────────────────────────────────────╮
│ Docker not available or failed to start. Please ensure docker service is          │
│ installed and running. Error: Error while fetching server API version:            │
│ ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))        │
│                                                                                   │
│ To print debug messages please add --debug flag.                                  │
╰───────────────────────────────────────────────────────────────────────────────────╯

EDIT: Now it's working. I was using the Docker Desktop version which runs in VM. The problem was in the socket, so I just installed the Docker Engine from apt.