[LocalBackend-7 (_actor_loop)] mopidy_local.library Lookup error for local:directory?

Since installing mopidy in Ubuntu 24.04.2, the database seems to lock up after a few searches, getting stuck in a loop

● mopidy.service - Mopidy music server
     Loaded: loaded (/usr/lib/systemd/system/mopidy.service; enabled; preset: enabled)
     Active: active (running) since Sat 2025-06-28 12:20:23 CEST; 2 days ago
   Main PID: 756833 (mopidy)
      Tasks: 20 (limit: 9277)
     Memory: 74.1M (peak: 146.7M swap: 8.6M swap peak: 8.6M)
        CPU: 33.764s
     CGroup: /system.slice/mopidy.service
             └─756833 /usr/bin/python3 /usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf

juin 30 19:36:08 ubservlow mopidy[756833]: ERROR    [LocalBackend-7 (_actor_loop)] mopidy_local.library Lookup error for local:directory?genre=Punk - Post Punk: Invalid lookup URI
juin 30 19:36:11 ubservlow mopidy[756833]: ERROR    [LocalBackend-7 (_actor_loop)] mopidy_local.library Lookup error for local:directory?type=genre: Invalid lookup URI
juin 30 19:36:37 ubservlow mopidy[756833]: ERROR    [LocalBackend-7 (_actor_loop)] mopidy_local.library Lookup error for local:directory?genre=Punk: Invalid lookup URI
juin 30 19:36:48 ubservlow mopidy[756833]: ERROR    [LocalBackend-7 (_actor_loop)] mopidy_local.library Lookup error for local:directory?genre=Punk&type=track&album=local:album:md5:c>
juin 30 19:37:11 ubservlow mopidy[756833]: ERROR    [LocalBackend-7 (_actor_loop)] mopidy_local.library Lookup error for local:directory?genre=Punk: Invalid lookup URI
juin 30 19:37:15 ubservlow mopidy[756833]: ERROR    [LocalBackend-7 (_actor_loop)] mopidy_local.library Lookup error for local:directory?genre=Punk&type=track&album=local:album:md5:f>
juin 30 19:37:19 ubservlow mopidy[756833]: ERROR    [LocalBackend-7 (_actor_loop)] mopidy_local.library Lookup error for local:directory?genre=Punk: Invalid lookup URI
juin 30 19:37:29 ubservlow mopidy[756833]: ERROR    [LocalBackend-7 (_actor_loop)] mopidy_local.library Lookup error for local:directory?genre=Punk&type=track&album=local:album:md5:c>
juin 30 19:40:52 ubservlow mopidy[756833]: ERROR    [LocalBackend-7 (_actor_loop)] mopidy_local.library Lookup error for local:directory?genre=Punk: Invalid lookup URI
juin 30 19:40:58 ubservlow mopidy[756833]: ERROR    [LocalBackend-7 (_actor_loop)] mopidy_local.library Lookup error for local:directory?genre=Punk&type=track&album=local:album:md5:0

I only have local files and this issue is not limited to Punk and it is not systematic. I never saw this issue with Ubuntu 20 so I was wondering if there might be a connection. To break the loop, I restart mopidy, but it takes a good 5 mins to get the terminal back.
Any thoughts are most welcome.

Can you try clearing out your database and doing a fresh scan?

I can’t find anything on how to “clear out” the database. To be honest, I don’t know where the database is held. Could you tell me please?

Please find the documention for Mopidy-Local on github: GitHub - mopidy/mopidy-local: Mopidy extension for playing music from your local music archive

Keep in mind that when running as a service you’ll need to use sudo mopidyctl rather than mopidy.

sudo mopidyctl local clear

is a good one to know.
It has speeded up my searches and for the moment I am no longer getting the above error. Thank you