I was trying to use docker-compose to up the Airflow, I have used it in a directory where I have `docker-compose.yaml.
I have not changed docker-compose.yaml and just used the standard one from Apache Airflow. Just to say, I have installed Docker before and used it.
Here is the output in the console:
(base) ruslanpilipyuk@MacBook-Pro-Ruslan airflow-local % docker-compose -f docker-compose.yaml up -d
WARNING: The AIRFLOW_UID variable is not set. Defaulting to a blank string.
Traceback (most recent call last):
File "urllib3/connectionpool.py", line 670, in urlopen
File "urllib3/connectionpool.py", line 392, in _make_request
File "http/client.py", line 1255, in request
File "http/client.py", line 1301, in _send_request
File "http/client.py", line 1250, in endheaders
File "http/client.py", line 1010, in _send_output
File "http/client.py", line 950, in send
File "docker/transport/unixconn.py", line 43, in connect
FileNotFoundError: [Errno 2] No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "requests/adapters.py", line 439, in send
File "urllib3/connectionpool.py", line 726, in urlopen
File "urllib3/util/retry.py", line 410, in increment
File "urllib3/packages/six.py", line 734, in reraise
File "urllib3/connectionpool.py", line 670, in urlopen
File "urllib3/connectionpool.py", line 392, in _make_request
File "http/client.py", line 1255, in request
File "http/client.py", line 1301, in _send_request
File "http/client.py", line 1250, in endheaders
File "http/client.py", line 1010, in _send_output
File "http/client.py", line 950, in send
File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "docker/api/client.py", line 214, in _retrieve_server_version
File "docker/api/daemon.py", line 181, in version
File "docker/utils/decorators.py", line 46, in inner
File "docker/api/client.py", line 237, in _get
File "requests/sessions.py", line 543, in get
File "requests/sessions.py", line 530, in request
File "requests/sessions.py", line 643, in send
File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "docker-compose", line 3, in <module>
File "compose/cli/main.py", line 81, in main
File "compose/cli/main.py", line 200, in perform_command
File "compose/cli/command.py", line 60, in project_from_options
File "compose/cli/command.py", line 152, in get_project
File "compose/cli/docker_client.py", line 41, in get_client
File "compose/cli/docker_client.py", line 170, in docker_client
File "docker/api/client.py", line 197, in __init__
File "docker/api/client.py", line 221, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
[2128] Failed to execute script docker-compose
3
Answers
It seems like airflow user definition missing.
Try to run the following (one time) and then run the docker-compose
see also : https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html (Initializing Environment)
I got same exact error when attempting ‘docker-compose up’ on my Redhat 7.9 VM.
Our Unix admin was helping me undo a recent server patch which I thought might be causing issues. He asked to run ‘docker version’. I did. It spewed results. Last line read:
==> "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"
Doh! He then started docker daemon as root with ‘systemctl start docker’.
I ran ‘docker-compose up’ again.
Docker’s up and running.
If you have Docker Desktop installed on your local machine, just start/open it. Then try to run the docker command and it will execute successfully.