Skip to content

Docker image for latest/0.17 fails to run any pyatv scripts #2829

@brycied00d

Description

@brycied00d

Describe the bug

The published Docker images for sha-916648f/0.17/0.17.0/latest, as well as master/sha-ef43443, fail to run any of the pyatv Python scripts. Even just --help (ex: atvscript --help) fails. Images tagged sha-3ad8277 and older do not have this issue. This affects atvlog, atvproxy, atvremote, and atvscript. Additionally, srptools in the Docker image fails with a different error.

Error log

All affected scripts fail with the same traceback:
Failing:

$ docker run -it ghcr.io/postlund/pyatv:sha-916648f atvscript --help
Unable to find image 'ghcr.io/postlund/pyatv:sha-916648f' locally
sha-916648f: Pulling from postlund/pyatv
Digest: sha256:f72301932a5455ae142fbe6e125fabc140409b39c4179bfbc883886a49d7393a
Status: Downloaded newer image for ghcr.io/postlund/pyatv:sha-916648f
Traceback (most recent call last):
  File "/usr/local/bin/atvscript", line 7, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/local/lib/python3.14/site-packages/pyatv/scripts/atvscript.py", line 424, in main
    loop = asyncio.get_event_loop()
  File "/usr/local/lib/python3.14/asyncio/events.py", line 715, in get_event_loop
    raise RuntimeError('There is no current event loop in thread %r.'
                       % threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'MainThread'.
$ docker run -it ghcr.io/postlund/pyatv:latest srptools --help
Traceback (most recent call last):
  File "/usr/local/bin/srptools", line 3, in <module>
    from srptools.cli import main
  File "/usr/local/lib/python3.14/site-packages/srptools/cli.py", line 4, in <module>
    import click
ModuleNotFoundError: No module named 'click'

Last working tag:

$ docker run -it ghcr.io/postlund/pyatv:sha-3ad8277 atvscript --help
usage: atvscript [-h] [--storage {file,none}] [--storage-filename STORAGE_FILENAME] [-i ID] [--protocol PROTOCOL] [-s SCAN_HOSTS] [--output OUTPUT] [--debug] [--dmap-credentials DMAP_CREDENTIALS] [--mrp-credentials MRP_CREDENTIALS]
                 [--airplay-credentials AIRPLAY_CREDENTIALS] [--companion-credentials COMPANION_CREDENTIALS] [--raop-credentials RAOP_CREDENTIALS]
                 command

positional arguments:
  command               command to run

options:
  -h, --help            show this help message and exit
  -i, --id ID           device identifier (default: None)
  --protocol PROTOCOL   protocol to use (values: dmap, mrp) (default: None)
  -s, --scan-hosts SCAN_HOSTS
                        scan specific hosts (default: None)
  --output OUTPUT       output format (values: json) (default: dumps)
  --debug               save debug log to atvscript.log (default: False)

settings:
  --storage {file,none}
                        storage backend for settings (default: file)
  --storage-filename STORAGE_FILENAME
                        file used by file storage (default: default)

credentials:
  --dmap-credentials DMAP_CREDENTIALS
                        credentials for DMAP (default: None)
  --mrp-credentials MRP_CREDENTIALS
                        credentials for MRP (default: None)
  --airplay-credentials AIRPLAY_CREDENTIALS
                        credentials for AirPlay (default: None)
  --companion-credentials COMPANION_CREDENTIALS
                        credentials for Companion (default: None)
  --raop-credentials RAOP_CREDENTIALS
                        credentials for RAOP (default: None)

How to reproduce the bug?

Run the script within the published Docker container, for example docker run -it ghcr.io/postlund/pyatv:latest atvscript --help

What is expected behavior?

I expect the script to run instead of crashing and throwing a traceback.

Operating System

Docker 29.2.1 on Linux 6.17.13-1-pve

Python

3.14

pyatv

0.17

Device

Apple TV

Additional context

I first noticed this when I ran an an updated downstream Docker container (sebbo2002/pyatv-mqtt-bridge). Tracking the issue down, I came across this issue (sebbo2002/pyatv-mqtt-bridge#499) which pointed me to upstream (here).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions