Skip to content

COMPOSE_PROJECT_NAME causing "no configuration file provided: not found" in logs command #9316

Closed
@krissetto

Description

@krissetto

Description

The docker compose logs command (and maybe others) is ignoring the COMPOSE_PROJECT_NAME env variable and throwing no configuration file provided: not found instead of proceeding with the command since it has the project name.

Placing any valid docker-compose.yaml file in the working directory where the command is launched makes the command work as normal, even if the compose file has none of the services used as arguments to the logs command.

Using the -p parameter instead of the env var fixes the issue.

Steps to reproduce the issue:

  1. Create the following docker-compose.yaml file in an empty directory of your choice:
services:
  hello-world:
    image: hello-world
  1. Run the following command from the same directory: docker compose -p test run hello-world
  2. Change to a directory where you're sure not to find other docker-compose.yaml files (neither in the dir nor in any parent dir. eg. /tmp)
  3. Run COMPOSE_PROJECT_NAME=test docker compose logs hello-world and you will get an error
  4. Run docker compose -p test logs hello-world and the command will work

Describe the results you received:
Confusion

Describe the results you expected:
The command to work :)

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker compose version:

Docker Compose version v2.3.3

Output of docker info:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.8.1)
  compose: Docker Compose (Docker Inc., v2.3.3)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 21
  Running: 14
  Paused: 0
  Stopped: 7
 Images: 19
 Server Version: 20.10.13
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2a1d4dbdb2a1030dc5b01e96fb110a9d9f150ecc
 runc version: v1.0.3-0-gf46b6ba
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.10.104-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 6
 Total Memory: 11.67GiB
 Name: docker-desktop
 ID: GUOT:H27W:G5VK:ZFWL:WIQQ:XWF4:DQZY:HJ5A:OIME:IYDI:E7GX:JVHY
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false

Additional environment details:
Running on Macbook pro with M1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions