【问题标题】:Error FileNotFoundError while using Airflow docker compose使用 Airflow docker compose 时出现错误 FileNotFoundError
【发布时间】:2022-06-22 08:37:59
【问题描述】:

我试图使用 docker-compose 来启动 Airflow,我已经在我有 `docker-compose.yaml 的目录中使用了它。 我没有更改 docker-compose.yaml,只是使用了 Apache Airflow 的标准版本。顺便说一句,我之前安装过Docker,并且使用过。 这是控制台中的输出:

(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

【问题讨论】:

    标签: docker docker-compose airflow


    【解决方案1】:

    似乎缺少气流用户定义。

    尝试运行以下(一次),然后运行 ​​docker-compose

    echo -e "AIRFLOW_UID=$(id -u)" > .env
    

    另请参阅:https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html(初始化环境)

    【讨论】:

      【解决方案2】:

      在我的 Redhat 7.9 VM 上尝试“docker-compose up”时,我遇到了完全相同的错误。 我们的 Unix 管理员正在帮助我撤消最近的一个服务器补丁,我认为该补丁可能会导致问题。他要求运行'docker version'。我做到了。它喷出了结果。最后一行读到: ==>“无法连接到 unix:///var/run/docker.sock 的 Docker 守护进程。docker 守护进程是否正在运行?” 嗬!然后,他使用“systemctl start docker”以 root 身份启动 docker 守护进程。 我再次运行“docker-compose up”。
      Docker 已启动并运行。

      【讨论】:

        猜你喜欢
        • 2021-08-27
        • 1970-01-01
        • 2016-10-23
        • 1970-01-01
        • 1970-01-01
        • 2021-03-22
        • 1970-01-01
        • 2021-12-28
        • 2021-12-17
        相关资源
        最近更新 更多