After update on Debian trixie mopidy-local has an error

Hi

After updating my server to Debian trixie, mopidy-local has an error. Mopidy is still working. Am I too early for an update?

This command: sudo journalctl -u mopidy

has related to the problem the same output like: sudo mopidyctl config

Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf config" as user mopidy
ERROR    [MainThread] mopidy.ext Setup of extension from entry point local failed, ignoring extension.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/mopidy/ext.py", line 250, in load_extensions
    command=extension.get_command(),
            ~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/mopidy_local/__init__.py", line 45, in get_command
    from .commands import LocalCommand
  File "/usr/lib/python3/dist-packages/mopidy_local/commands.py", line 8, in <module>
    from mopidy_local import mtimes, storage, translator
  File "/usr/lib/python3/dist-packages/mopidy_local/storage.py", line 2, in <module>
    import imghdr
ModuleNotFoundError: No module named 'imghdr'
WARNING  [MainThread] mopidy.config Ignoring config section 'local' because no matching extension was found
[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy
max_tracklist_length = 10000
restore_state = false

[logging]
verbosity = 0
format = %(levelname)-8s [%(threadName)s] %(name)s %(message)s
color = false
config_file = 

[audio]
mixer = software
mixer_volume = 50
output = autoaudiosink
buffer_time = 

[proxy]
scheme = 
hostname = 
port = 
username = 
password = 

[file]
enabled = true
media_dirs = 
  /media/server1/FreedomBox/shares/group_share/Musik (Mopidy)
excluded_file_extensions = 
  .directory
  .html
  .jpeg
  .jpg
  .log
  .nfo
  .pdf
  .png
  .txt
  .zip
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[http]
enabled = true
hostname = ::
port = 6680
zeroconf = Mopidy HTTP server on $hostname
allowed_origins = 
csrf_protection = true
default_app = mopidy

[m3u]
enabled = true
base_dir = 
default_encoding = latin-1
default_extension = .m3u8
playlists_dir = 

[softwaremixer]
enabled = true

[stream]
enabled = true
protocols = 
  http
  https
  mms
  rtmp
  rtmps
  rtsp
metadata_blacklist = 
timeout = 5000

[mpd]
enabled = true
hostname = ::
port = 6600
password = 
max_connections = 20
connection_timeout = 60
zeroconf = Mopidy MPD server on $hostname
command_blacklist = 
  listall
  listallinfo
default_playlist_scheme = m3u
  • Installed dependencies: sudo mopidyctl deps
Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf deps" as user mopidy
ERROR    [MainThread] mopidy.ext Setup of extension from entry point local failed, ignoring extension.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/mopidy/ext.py", line 250, in load_extensions
    command=extension.get_command(),
            ~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/mopidy_local/__init__.py", line 45, in get_command
    from .commands import LocalCommand
  File "/usr/lib/python3/dist-packages/mopidy_local/commands.py", line 8, in <module>
    from mopidy_local import mtimes, storage, translator
  File "/usr/lib/python3/dist-packages/mopidy_local/storage.py", line 2, in <module>
    import imghdr
ModuleNotFoundError: No module named 'imghdr'
WARNING  [MainThread] mopidy.config Ignoring config section 'local' because no matching extension was found
Executable: /usr/bin/mopidy
Platform: Linux-6.1.0-37-armmp-lpae-armv7l-with-glibc2.41
Python: CPython 3.13.3 from /usr/lib/python3.13
Mopidy: 3.4.2 from /usr/lib/python3/dist-packages
Mopidy-Local: 3.2.1 from /usr/lib/python3/dist-packages
Mopidy-MPD: 3.3.0 from /usr/lib/python3/dist-packages
GStreamer: 1.26.2.0 from /usr/lib/python3/dist-packages/gi
  Detailed information: 
    Python wrapper: python-gi 3.50.0
    Relevant elements:
      Found:
        uridecodebin
        souphttpsrc
        appsrc
        alsasink
        osssink
        oss4sink
        pulsesink
        id3demux
        id3v2mux
        lamemp3enc
        mpegaudioparse
        mpg123audiodec
        vorbisdec
        vorbisenc
        vorbisparse
        oggdemux
        oggmux
        oggparse
        flacdec
        flacparse
        shout2send
      Not found:
        flump3dec
        mad`
  • Information about your computer’s hardware and software
    Hardware: Olimex Lime2
    Software: Debian armhf bookworm → trixie

If I am to early, no problem. I did the test with a dd copy of my root file system. So there is nothing lost…

Greetings from Switzerland

Short answer, yes. Mopidy-Local doesn’t support Python 13.3 due to PEP 594 – Removing dead batteries from the standard library | peps.python.org

I think the workaround might be sudo apt install python3-standard-imghdr, can you try that? We need to fix Mopidy-Local. Weird nobody else (arch users?) flagged this sooner.

Thank you! I did install sudo apt install python3-standard-imghdr and after restarting the server the configuration didn’t show an error anymore. Then I did run sudo mopidyctl local clear and after this sudo mopidyctl local scan . And that’s what showed up in the terminal:

sudo mopidyctl local scan
Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf local scan" as user mopidy
INFO     [MainThread] mopidy.__main__ Starting Mopidy 3.4.2
INFO     [MainThread] mopidy.config Loading config from builtin defaults
INFO     [MainThread] mopidy.config Loading config from file:///usr/share/mopidy/conf.d/mopidy.conf
INFO     [MainThread] mopidy.config Loading config from file:///usr/share/mopidy/conf.d/mopidy-local.conf
INFO     [MainThread] mopidy.config Loading config from file:///etc/mopidy/mopidy.conf
INFO     [MainThread] mopidy.config Loading config from command line options
INFO     [MainThread] mopidy.__main__ Enabled extensions: http, local, mpd, stream, m3u, softwaremixer, file
INFO     [MainThread] mopidy.__main__ Disabled extensions: none
INFO     [MainThread] mopidy_local.commands Finding files in file:///media/server1/FreedomBox/shares/group_share/Musik%20%28Mopidy%29 ...
INFO     [MainThread] mopidy_local.commands Found 3239 files in file:///media/server1/FreedomBox/shares/group_share/Musik%20%28Mopidy%29
INFO     [MainThread] mopidy_local.commands Checking 200 tracks from library
INFO     [MainThread] mopidy_local.commands Removing 0 missing tracks
INFO     [MainThread] mopidy_local.commands Found 2801 tracks which need to be updated
INFO     [MainThread] mopidy_local.commands Scanning...
ERROR    [MainThread] mopidy.__main__ 'StructureWrapper' object has no attribute 'get_name'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/mopidy/__main__.py", line 143, in main
    return args.command.run(args, proxied_config)
           ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/mopidy_local/commands.py", line 95, in run
    self._scan_metadata(
    ~~~~~~~~~~~~~~~~~~~^
        media_dir=media_dir,
        ^^^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
        limit=args.limit,
        ^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/lib/python3/dist-packages/mopidy_local/commands.py", line 218, in _scan_metadata
    result = scanner.scan(file_uri)
  File "/usr/lib/python3/dist-packages/mopidy/audio/scan.py", line 70, in scan
    tags, mime, have_audio, duration = _process(pipeline, timeout)
                                       ~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/mopidy/audio/scan.py", line 235, in _process
    mime = caps.get_structure(0).get_name()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'StructureWrapper' object has no attribute 'get_name'
Traceback (most recent call last):
  File "/usr/bin/mopidy", line 33, in <module>
    sys.exit(load_entry_point('Mopidy==3.4.2', 'console_scripts', 'mopidy')())
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/mopidy/__main__.py", line 143, in main
    return args.command.run(args, proxied_config)
           ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/mopidy_local/commands.py", line 95, in run
    self._scan_metadata(
    ~~~~~~~~~~~~~~~~~~~^
        media_dir=media_dir,
        ^^^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
        limit=args.limit,
        ^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/lib/python3/dist-packages/mopidy_local/commands.py", line 218, in _scan_metadata
    result = scanner.scan(file_uri)
  File "/usr/lib/python3/dist-packages/mopidy/audio/scan.py", line 70, in scan
    tags, mime, have_audio, duration = _process(pipeline, timeout)
                                       ~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/mopidy/audio/scan.py", line 235, in _process
    mime = caps.get_structure(0).get_name()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'StructureWrapper' object has no attribute 'get_name'

What is causing this?
FYI: I did a fresh install with a new image and the same thing happened there, same error on mopidy-local