Skip to content

docker-compose is unstable using Docker Desktop and WSL2 #7899

@FVolral

Description

@FVolral

Description of the issue

In some conditions, some command like docker-compose up or docker-compose ps leads to the following error :

Traceback (most recent call last):
  File "bin/docker-compose", line 3, in <module>
  File "compose/cli/main.py", line 67, in main
  File "compose/cli/main.py", line 123, in perform_command
  File "compose/cli/command.py", line 69, in project_from_options
  File "compose/cli/command.py", line 125, in get_project
  File "compose/cli/command.py", line 184, in get_project_name
  File "posixpath.py", line 383, in abspath
FileNotFoundError: [Errno 2] No such file or directory
[3512] Failed to execute script docker-compose

Docker Desktop restart but it doesn't solve the problem.

Context information (for bug reports)

docker-compose.yml

version: '3.8'

services:
    mongo:
        image: mongo
        networks:
            mongo_net:
        volumes:
            - "./mongodata:/data/db"
        ports:
            - 27017:27017
        restart: always
        environment:
            MONGO_INITDB_ROOT_USERNAME: root
            MONGO_INITDB_ROOT_PASSWORD: 1234567
        command: mongod --bind_ip 0.0.0.0
    app:
        build:
            context: ./app/
            dockerfile: app.dockerfile
        volumes:
            - "./app:/app"
        networks:
            - mongo_net
        entrypoint: python
        tty: true
        stdin_open: true
        depends_on:
            - mongo
networks:
    mongo_net:
volumes:
    mongodata:

app/app.dockerfile

FROM python:3

WORKDIR /app

COPY requirements.txt /requirements.txt
RUN python -m pip install --upgrade pip
RUN pip install --no-cache-dir -r /requirements.txt

WORKDIR /app

WSL2 / Win10 version

> ver
Microsoft Windows [version 10.0.19041.572]
>wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu                 Running         2
  docker-desktop         Running         2
  docker-desktop-data    Running         2

Output of docker-compose version

docker-compose version 1.27.4, build 40524192
docker-py version: 4.3.1
CPython version: 3.7.7
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019

Output of docker version

Client:
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.13.8
 Git commit:        afacb8b7f0
 Built:             Wed Oct 14 19:43:43 2020
 OS/Arch:           linux/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.0-beta1
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       9c15e82
  Built:            Tue Oct 13 18:17:18 2020
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          v1.4.1
  GitCommit:        c623d1b36f09f8ef6536a057bd658b3aa8632828
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Output of docker-compose config
(Make sure to add the relevant -f and other flags)

Traceback (most recent call last):
  File "bin/docker-compose", line 3, in <module>
  File "compose/cli/main.py", line 67, in main
  File "compose/cli/main.py", line 120, in perform_command
  File "compose/cli/main.py", line 324, in config
  File "compose/cli/command.py", line 99, in get_config_from_options
  File "compose/config/config.py", line 406, in load
  File "compose/config/config.py", line 520, in load_services
  File "compose/config/config.py", line 501, in build_services
  File "compose/config/config.py", line 501, in <listcomp>
  File "compose/config/config.py", line 480, in build_service
  File "compose/config/config.py", line 289, in with_abs_paths
  File "posixpath.py", line 383, in abspath
FileNotFoundError: [Errno 2] No such file or directory
[3611] Failed to execute script docker-compose

Steps to reproduce the issue

I tried many solutions to solve this and now I'm a bit lost. Docker has worked while few months like a charm on an another project. I don't understand what causes that instability. It happens after a docker-compose up. Yesterday, I had this error and tried to reinstall Docker 2.4.0.0 Stable but I had various problem with it (Installer unable to finish its installation, Docker Desktop unstable, Docker service trying to start forever, Stuck when restoring factory default) That was a mess so I removed the previous version of docker and installed the 2.4.2.0 Edge version of Docker Desktop which can be found here.

Docker become more stable after that and I was able to Clean / Purge data then Reset to factory defaults (looks stupid to do that since the installation was fresh but he).

I thought my ordeal was over but this problem come back now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions