Jellyfin Forum
ERR: MigrateMusicBrainzTimeout - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+---- Forum: Media Scanning & Identification (https://forum.jellyfin.org/f-media-scanning-identification)
+---- Thread: ERR: MigrateMusicBrainzTimeout (/t-err-migratemusicbrainztimeout)

Pages: 1 2


ERR: MigrateMusicBrainzTimeout - LordElber - 2024-05-31

Hi together,

after upgrading to Jellyfin 10.9.1/10.9.2/10.9.3 my Jellyfin isn't accessible via Internet anymore. Nginx gave my the famous 502 Bad Gateway Error. By checking out the logs of all relevant dockers on the server it seems like Jellyfin is the problem, because it does not start up anymore. Meaning, I cannot even access it via webUI directly over the IP.

The Jellyfin log file shows the following:

Code:
[09:41:23] [INF] [1] Main: Jellyfin version: 10.9.3
[09:41:23] [INF] [1] Main: Environment Variables: ["[JELLYFIN_CACHE_DIR, /config/cache]", "[JELLYFIN_LOG_DIR, /config/log]", "[JELLYFIN_DATA_DIR, /config/data]", "[JELLYFIN_WEB_DIR, /usr/share/jellyfin/web]", "[JELLYFIN_CONFIG_DIR, /config]"]
[09:41:23] [INF] [1] Main: Arguments: ["/usr/lib/jellyfin/bin/jellyfin.dll", "--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg"]
[09:41:23] [INF] [1] Main: Operating system: Ubuntu 22.04.4 LTS
[09:41:23] [INF] [1] Main: Architecture: X64
[09:41:23] [INF] [1] Main: 64-Bit Process: TrueUnhandled exception. System.InvalidOperationException: There is an error in XML document (0, 0).

---> System.Xml.XmlException: Root element is missing.
  at System.Xml.XmlTextReaderImpl.Throw(Exception e)
  at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
[09:41:23] [INF] [1] Main: User Interactive: True  at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
  at System.Xml.XmlReader.MoveToContent()

  at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderOldMusicBrainzConfiguration.Read3_PluginConfiguration()
  at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
  at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
  --- End of inner exception stack trace ---
  at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
[09:41:23] [INF] [1] Main: Processor count: 4  at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
  at Jellyfin.Server.Migrations.PreStartupRoutines.MigrateMusicBrainzTimeout.ReadOld(String path)

  at Jellyfin.Server.Migrations.PreStartupRoutines.MigrateMusicBrainzTimeout.Perform()
  at Jellyfin.Server.Migrations.MigrationRunner.PerformMigrations(IMigrationRoutine[] migrations, MigrationOptions migrationOptions, Action`1 saveConfiguration, ILogger logger)
  at Jellyfin.Server.Migrations.MigrationRunner.RunPreStartup(ServerApplicationPaths appPaths, ILoggerFactory loggerFactory)
  at Jellyfin.Server.Program.StartApp(StartupOptions options)
  at Jellyfin.Server.Program.<Main>(String[] args)
[09:41:23] [INF] [1] Main: Program data path: /config/data
[09:41:23] [INF] [1] Main: Log directory path: /config/log
[09:41:23] [INF] [1] Main: Config directory path: /config
[09:41:23] [INF] [1] Main: Cache path: /config/cache
[09:41:23] [INF] [1] Main: Web resources path: /usr/share/jellyfin/web
[09:41:23] [INF] [1] Main: Application directory: /usr/lib/jellyfin/bin/
[09:41:23] [INF] [1] Jellyfin.Server.Migrations.MigrationRunner: Applying migration 'MigrateMusicBrainzTimeout'
[09:41:23] [ERR] [1] Jellyfin.Server.Migrations.MigrationRunner: Could not apply migration 'MigrateMusicBrainzTimeout'
System.InvalidOperationException: There is an error in XML document (0, 0).
---> System.Xml.XmlException: Root element is missing.
  at System.Xml.XmlTextReaderImpl.Throw(Exception e)
  at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
  at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
  at System.Xml.XmlReader.MoveToContent()
  at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderOldMusicBrainzConfiguration.Read3_PluginConfiguration()
  at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
  at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
  --- End of inner exception stack trace ---
  at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
  at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
  at Jellyfin.Server.Migrations.PreStartupRoutines.MigrateMusicBrainzTimeout.ReadOld(String path)
  at Jellyfin.Server.Migrations.PreStartupRoutines.MigrateMusicBrainzTimeout.Perform()
  at Jellyfin.Server.Migrations.MigrationRunner.PerformMigrations(IMigrationRoutine[] migrations, MigrationOptions migrationOptions, Action`1 saveConfiguration, ILogger logger)
[09:41:23] [FTL] [1] Main: Unhandled Exception
System.InvalidOperationException: There is an error in XML document (0, 0).
---> System.Xml.XmlException: Root element is missing.
  at System.Xml.XmlTextReaderImpl.Throw(Exception e)
  at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
  at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
  at System.Xml.XmlReader.MoveToContent()
  at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderOldMusicBrainzConfiguration.Read3_PluginConfiguration()
  at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
  at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
  --- End of inner exception stack trace ---
  at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
  at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
  at Jellyfin.Server.Migrations.PreStartupRoutines.MigrateMusicBrainzTimeout.ReadOld(String path)
  at Jellyfin.Server.Migrations.PreStartupRoutines.MigrateMusicBrainzTimeout.Perform()
  at Jellyfin.Server.Migrations.MigrationRunner.PerformMigrations(IMigrationRoutine[] migrations, MigrationOptions migrationOptions, Action`1 saveConfiguration, ILogger logger)
  at Jellyfin.Server.Migrations.MigrationRunner.RunPreStartup(ServerApplicationPaths appPaths, ILoggerFactory loggerFactory)
  at Jellyfin.Server.Program.StartApp(StartupOptions options)
  at Jellyfin.Server.Program.<Main>(String[] args)

For me it looks liek there is a problem with Musicbrainz. Can somebody please help me and tell me how to fix it?


RE: ERR: MigrateMusicBrainzTimeout - TheDreadPirate - 2024-05-31

In the container, go to /config/config. Are any of the XMLs in that directory empty?


RE: ERR: MigrateMusicBrainzTimeout - LordElber - 2024-06-02

Hi TheDreadPirate,

first of all thank you for your answer/question and during my research I saw that you are an extremly helpful member of this forum.

Due to your question, XML files did exist and with this in mind, I had the Idea to just restore an one month old backup to solve the problem. Now I might made things worse. -.-

The backup seemed to actually work, because all shared paths were added, but now I get this error message and don't know why it comes up or how to fix it...

[23:08:51] [FTL] [1] Main: Error while starting server
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 11: 'malformed database schema (1)'.

The following process runs frequently round about every 10min again and again.

Code:
[23:03:38] [INF] [1] Main: Jellyfin version: 10.9.4
[23:03:38] [INF] [1] Main: Environment Variables: ["[JELLYFIN_CONFIG_DIR, /config]", "[JELLYFIN_DATA_DIR, /config/data]", "[JELLYFIN_CACHE_DIR, /config/cache]", "[JELLYFIN_LOG_DIR, /config/log]", "[JELLYFIN_WEB_DIR, /usr/share/jellyfin/web]"]
[23:03:38] [INF] [1] Main: Arguments: ["/usr/lib/jellyfin/bin/jellyfin.dll", "--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg"]
[23:03:38] [INF] [1] Main: Operating system: Ubuntu 22.04.4 LTS
[23:03:38] [INF] [1] Main: Architecture: X64
[23:03:38] [INF] [1] Main: 64-Bit Process: True
[23:03:38] [INF] [1] Main: User Interactive: True
[23:03:38] [INF] [1] Main: Processor count: 4
[23:03:38] [INF] [1] Main: Program data path: /config/data
[23:03:38] [INF] [1] Main: Log directory path: /config/log
[23:03:38] [INF] [1] Main: Config directory path: /config
[23:03:38] [INF] [1] Main: Cache path: /config/cache
[23:03:38] [INF] [1] Main: Web resources path: /usr/share/jellyfin/web
[23:03:38] [INF] [1] Main: Application directory: /usr/lib/jellyfin/bin/
[23:03:39] [INF] [1] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Setting cache path: /config/cache
[23:08:49] [INF] [1] Emby.Server.Implementations.ApplicationHost: Loading assemblies
[23:08:49] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Skipping disabled plugin 6.0.0.0 of Kodi Sync Queue
[23:08:49] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Skipping disabled plugin 8.0.0.0 of Kodi Sync Queue
[23:08:49] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Skipping disabled plugin 9.0.0.0 of Kodi Sync Queue
[23:08:49] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN subnets:
[23:08:49] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN exclusions: []
[23:08:49] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Used LAN subnets:
[23:08:49] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Filtered interface addresses:
[23:08:49] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Bind Addresses
[23:08:49] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Remote IP filter is Allowlist
[23:08:49] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Filtered subnets: []
[23:08:51] [FTL] [1] Main: Error while starting server
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 11: 'malformed database schema (1)'.
  at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
  at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements()+MoveNext()
  at Microsoft.Data.Sqlite.SqliteCommand.GetStatements()+MoveNext()
  at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
  at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
  at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
  at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
  at Emby.Server.Implementations.Data.SqliteExtensions.Execute(SqliteConnection sqliteConnection, String commandText)
  at Emby.Server.Implementations.Data.BaseSqliteRepository.GetConnection()
  at Emby.Server.Implementations.Data.BaseSqliteRepository.Initialize()
  at Emby.Server.Implementations.Data.SqliteItemRepository.Initialize()
  at Emby.Server.Implementations.ApplicationHost.InitializeServices()
  at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig)
[23:08:51] [INF] [1] Main: Running query planner optimizations in the database... This might take a while
[23:08:51] [INF] [1] Emby.Server.Implementations.ApplicationHost: Disposing CoreAppHost
[23:08:51] [INF] [1] Emby.Server.Implementations.ApplicationHost: Disposing PluginManager

Do you have expirience with this error or can tell me how to I probably could fix it. Might there be a problem with the database because I was running Jellyfin 10.8.13 when I created the backup? Or could it be that there is a problem with overwriting still existing database when restoring? Jellyfin docker was stopped while running the backup. ´

I really need help here. Building up all data from scratch won't be a real option. Confused-face

PS: This is the second time when updating Jellyfin, that I had big problems afterwards. In the future I should stick with: "Never change a running system!"


RE: ERR: MigrateMusicBrainzTimeout - TheDreadPirate - 2024-06-02

Did you restore just the DBs? Or the entire /config directory?


RE: ERR: MigrateMusicBrainzTimeout - LordElber - 2024-06-03

I restored the entire config directory. I use a tool for the BackUp on UnRaid.


RE: ERR: MigrateMusicBrainzTimeout - TheDreadPirate - 2024-06-03

I'm not sure how their backup tool works, but my first thought is that the DB is borked.


RE: ERR: MigrateMusicBrainzTimeout - LordElber - 2024-06-04

I think like that the same. Confused-face

I will try to delete Jellyfin completely and pull the version 10.8.13 of jellyfin that was running while doing the backup. Afterwards I will try to restore the backup once again.

In case config, metadata and imdb linking is wiped, can I somehow prevent this from happening again? I saw that in my tv series file folders, there are *.nfo files and cover created when linked, but I don't have these in my movie folders.


RE: ERR: MigrateMusicBrainzTimeout - TheDreadPirate - 2024-06-04

When I make my backups I simply rsync everything. But I schedule the backup in the middle of the night when Jellyfin is idle, so maybe that is a factor. Was your backup job running while the server was actively writing to the DB? IDK.

Sounds like you have NFO saver enabled in your shows library but not movies. This can help preserve metadata, but only really makes a difference if your media is frequently misidentified. Either due to being esoteric or not naming the folders appropriately, etc.

But you have to take the additional step of locking the NFOs since, by default, Jellyfin writes the NFOs unlocked.


RE: ERR: MigrateMusicBrainzTimeout - LordElber - 2024-06-08

Actually I saved 3 Backups and I am pretty sure it was completed everytime.

I will search for the option to enable NFO saver also in movies library. This seems to be saver. Most of the movies get detected automatically, but not all. This is also because I have german movie titles and imdb is english and not every movie seems to be detected correctly because of that. On top there movies with general expressions e.g. "Evil (2022)" where the word evil is part in many movies, also within this year. Then it will pick the most common one, but not necessarily the rigfht movie.

What do you mean with "locking"?


RE: ERR: MigrateMusicBrainzTimeout - TheDreadPirate - 2024-06-08

When Jellyfin writes the NFOs, open one up in a text editor. You will see a field for locking the file. I stopped using NFOs a while ago, I forget the exact field name. You'll see it. Flip that field to true so that Jellyfin won't attempt to make changes to it down the road.