#2123·watchtower

container dies with python error

Author: viegelinschCreated Nov 11, 2025Updated Nov 13, 2025
LabelsType: BugPriority: MediumStatus: Available

Describe the bug

Switched from containrrr/watchtower

Container crashes and restarts.

Steps to reproduce

  1. Changed docker-compose.yaml
  2. Also added
 environment:
      - DOCKER_API_VERSION=1.52
  1. Started container
  2. crash

Expected behavior

Running without crash

Screenshots

No screenshot but error message - see below.

Environment

  • Platform: Ubuntu 24.04.3 LTS
  • Architecture: x86_64
  • Docker Version: 29.0.0

Your logs

Exception in thread Thread-2 (watch_events):
Traceback (most recent call last):
  File "/usr/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3/dist-packages/compose/cli/log_printer.py", line 202, in watch_events
    for event in event_stream:
  File "/usr/lib/python3/dist-packages/compose/project.py", line 626, in yield_loop
    yield build_container_event(event)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/project.py", line 594, in build_container_event
    container = Container.from_id(self.client, event['id'])
                                               ~~~~~^^^^^^
KeyError: 'id'
watchtower exited with code 1

Additional context

Thank you for your effort!