[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] <title>Error: 'docker-compose up -d' Fails with KeyError: 'ContainerConfig #11742

Closed
mushuthecat opened this issue Apr 18, 2024 · 5 comments

Comments

@mushuthecat
Copy link
mushuthecat commented Apr 18, 2024

Description

Hello
Since some time, I am no longer able to use the command "docker-compose up -d" after performing a docker-compose pull, for example.

For your information, my configuration has been working perfectly for almost two years, and I haven't made any particular modifications other than my weekly system updates.

Here's the error message I'm encountering:

ERROR: for zwavejs2mqtt  'ContainerConfig'
Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 33, in <module>
    sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')())
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 203, in perform_command
    handler(command, command_options)
  File "/usr/lib/python3/dist-packages/compose/metrics/decorator.py", line 18, in wrapper
    result = fn(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1186, in up
    to_attach = up(False)
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1166, in up
    return self.project.up(
  File "/usr/lib/python3/dist-packages/compose/project.py", line 697, in up
    results, errors = parallel.parallel_execute(
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 108, in parallel_execute
    raise error_to_reraise
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 206, in producer
    result = func(obj)
  File "/usr/lib/python3/dist-packages/compose/project.py", line 679, in do
    return service.execute_convergence_plan(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 579, in execute_convergence_plan
    return self._execute_convergence_recreate(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 499, in _execute_convergence_recreate
    containers, errors = parallel_execute(
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 108, in parallel_execute
    raise error_to_reraise
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 206, in producer
    result = func(obj)
  File "/usr/lib/python3/dist-packages/compose/service.py", line 494, in recreate
    return self.recreate_container(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 612, in recreate_container
    new_container = self.create_container(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 330, in create_container
    container_options = self._get_container_create_options(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 921, in _get_container_create_options
    container_options, override_options = self._build_container_volume_options(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 960, in _build_container_volume_options
    binds, affinity = merge_volume_bindings(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 1548, in merge_volume_bindings
    old_volumes, old_mounts = get_container_data_volumes(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 1579, in get_container_data_volumes
    container.image_config['ContainerConfig'].get('Volumes') or {}
KeyError: 'ContainerConfig'

Do you have any ideas or knowledge about this issue?

Thank you

Have a great day

Steps To Reproduce

docker-compose pull
docker-compose up -d

Compose Version

docker-compose version 1.29.2, build unknown
docker-py version: 5.0.3
CPython version: 3.10.12
OpenSSL version: OpenSSL 3.0.2 15 Mar 2022

Docker Environment

Linux DOCKER-RYZEN 6.5.0-27-generic #28~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 15 10:51:06 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
---

Client: Docker Engine - Community
 Version:    26.0.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.13.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.26.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 45
  Running: 40
  Paused: 0
  Stopped: 5
 Images: 45
 Server Version: 26.0.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: e377cd56a71523140ca6ae87e30244719194a521
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.5.0-27-generic
 Operating System: Ubuntu 22.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 12.58GiB
 Name: DOCKER-RYZEN
 ID: bb80ffad-2333-4c92-acdc-a566c4f4849f
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

---

Client: Docker Engine - Community
 Version:           26.0.1
 API version:       1.45
 Go version:        go1.21.9
 Git commit:        d260a54
 Built:             Thu Apr 11 10:53:21 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          26.0.1
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.9
  Git commit:       60b9add
  Built:            Thu Apr 11 10:53:21 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.31
  GitCommit:        e377cd56a71523140ca6ae87e30244719194a521
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Anything else?

No response

@pacome35220
Copy link

I have just encountered the same problem on Debian 11, following a docker update from 24 to 26.

$ sudo apt list --upgradable | grep docker

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

docker-buildx-plugin/bullseye 0.13.1-1~debian.11~bullseye amd64 [pouvant être mis à jour depuis : 0.11.2-1~debian.11~bullseye]
docker-ce-cli/bullseye 5:26.0.1-1~debian.11~bullseye amd64 [pouvant être mis à jour depuis : 5:24.0.7-1~debian.11~bullseye]
docker-ce-rootless-extras/bullseye 5:26.0.1-1~debian.11~bullseye amd64 [pouvant être mis à jour depuis : 5:24.0.7-1~debian.11~bullseye]
docker-ce/bullseye 5:26.0.1-1~debian.11~bullseye amd64 [pouvant être mis à jour depuis : 5:24.0.7-1~debian.11~bullseye]
docker-compose-plugin/bullseye 2.26.1-1~debian.11~bullseye amd64 [pouvant être mis à jour depuis : 2.21.0-1~debian.11~bullseye]

I haven't read the entire changelog, but it's time to upgrade to docker compose v2 to fix this.

On my side, to fix the problem, I replaced the commands docker-compose by docker compose without the hyphen - to go to v2, and deleted the 1st line version: '3' from docker-compose.yml

@ndeloof
Copy link
Contributor
ndeloof commented Apr 19, 2024

You're using docker-compose version 1.29.2, which is End of Life for 1 year now.
You should consider using Docker Compose v2 as explained by @pacome35220

I'm closing this issue as "won't fix"

@drzraf
Copy link
drzraf commented May 29, 2024

So docker is aimed support to allows decade-old apps to keep them running in a container, but can't maintain a stability with its own Python library from a couple of years ago?

Why was compatibility broken with the Python library in the first place, do you have a reference issue about this?

@ndeloof
Copy link
Contributor
ndeloof commented May 29, 2024

Docker compose v1 (python) has been deprecated 2 years ago and announced end of life 1 year ago (see https://github.com/docker/compose/tree/v1)

Why was compatibility broken with the Python library in the first place, do you have a reference issue about this?

I can't tell what's broken with your installation, haven't investigated as we don't support this codebase anymore.

@glours
Copy link
Contributor
glours commented May 29, 2024

@drzraf, as mentioned by @ndeloof the python version is EOL but the code base is still available here if you want to check what isn't working by yourself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants