10.11.0 Migration failed: empty string not a valid DateTime #7580

Closed
opened 2026-02-07 05:12:17 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @seyfu-t on GitHub (Oct 26, 2025).

Description of the bug

When trying to upgrade from 10.10.7 to 10.11.0 I encountered this fatal migration error:

[FTL] [9] InternalCodeMigration: Error: String '' was not recognized as a valid DateTime.

Reproduction steps

Attempt upgrading from 10.10.7 to 10.11.0

What is the current bug behavior?

Migration fails

What is the expected correct behavior?

Migration succeeds: empty Strings could be pre converted to NULL or just be treated as NULL

Jellyfin Server version

10.10.0+

Specify commit id

No response

Specify unstable release number

No response

Specify version number

No response

Specify the build version

10.11.0

Environment

- OS: Debian 13
- Linux Kernel: 6.12.48+deb13-amd64
- Virtualization: Docker

Jellyfin logs

[14:50:06] [FTL] [9] InternalCodeMigration: Error: String '' was not recognized as a valid DateTime.
[14:50:06] [ERR] [9] InternalCodeMigration: Migration 20250420200000_MigrateLibraryDb failed
System.FormatException: String '' was not recognized as a valid DateTime.
   at System.DateTimeParse.Parse(ReadOnlySpan`1 s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
   at System.DateTime.Parse(String s, IFormatProvider provider)
   at Microsoft.Data.Sqlite.SqliteValueReader.GetDateTime(Int32 ordinal)
   at Microsoft.Data.Sqlite.SqliteDataReader.GetDateTime(Int32 ordinal)
   at Jellyfin.Server.Migrations.Routines.MigrateLibraryDb.GetUserData(User[] users, SqliteDataReader dto, HashSet`1 userIdBlacklist, ILogger logger)
   at Jellyfin.Server.Migrations.Routines.MigrateLibraryDb.Perform()
   at Jellyfin.Server.Migrations.Stages.CodeMigration.Perform(IServiceProvider serviceProvider, IStartupLogger logger, CancellationToken cancellationToken)
   at Jellyfin.Server.Migrations.JellyfinMigrationService.InternalCodeMigration.PerformAsync(IStartupLogger logger)
   at Jellyfin.Server.Migrations.JellyfinMigrationService.MigrateStepAsync(JellyfinMigrationStageTypes stage, IServiceProvider serviceProvider)

FFmpeg logs


Client / Browser logs

No response

Relevant screenshots or videos

No response

Additional information

I was able to successfully complete the migration by running this before the migration on library.db:

UPDATE UserDatas SET LastPlayedDate=NULL WHERE LastPlayedDate='';

Or via the CLI:

sqlite3 jellyfin/config/data/library.db "UPDATE UserDatas SET LastPlayedDate=NULL WHERE LastPlayedDate='';"
Originally created by @seyfu-t on GitHub (Oct 26, 2025). ### Description of the bug When trying to upgrade from 10.10.7 to 10.11.0 I encountered this fatal migration error: ```log [FTL] [9] InternalCodeMigration: Error: String '' was not recognized as a valid DateTime. ``` ### Reproduction steps Attempt upgrading from 10.10.7 to 10.11.0 ### What is the current _bug_ behavior? Migration fails ### What is the expected _correct_ behavior? Migration succeeds: empty Strings could be pre converted to NULL or just be treated as NULL ### Jellyfin Server version 10.10.0+ ### Specify commit id _No response_ ### Specify unstable release number _No response_ ### Specify version number _No response_ ### Specify the build version 10.11.0 ### Environment ```markdown - OS: Debian 13 - Linux Kernel: 6.12.48+deb13-amd64 - Virtualization: Docker ``` ### Jellyfin logs ```shell [14:50:06] [FTL] [9] InternalCodeMigration: Error: String '' was not recognized as a valid DateTime. [14:50:06] [ERR] [9] InternalCodeMigration: Migration 20250420200000_MigrateLibraryDb failed System.FormatException: String '' was not recognized as a valid DateTime. at System.DateTimeParse.Parse(ReadOnlySpan`1 s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at System.DateTime.Parse(String s, IFormatProvider provider) at Microsoft.Data.Sqlite.SqliteValueReader.GetDateTime(Int32 ordinal) at Microsoft.Data.Sqlite.SqliteDataReader.GetDateTime(Int32 ordinal) at Jellyfin.Server.Migrations.Routines.MigrateLibraryDb.GetUserData(User[] users, SqliteDataReader dto, HashSet`1 userIdBlacklist, ILogger logger) at Jellyfin.Server.Migrations.Routines.MigrateLibraryDb.Perform() at Jellyfin.Server.Migrations.Stages.CodeMigration.Perform(IServiceProvider serviceProvider, IStartupLogger logger, CancellationToken cancellationToken) at Jellyfin.Server.Migrations.JellyfinMigrationService.InternalCodeMigration.PerformAsync(IStartupLogger logger) at Jellyfin.Server.Migrations.JellyfinMigrationService.MigrateStepAsync(JellyfinMigrationStageTypes stage, IServiceProvider serviceProvider) ``` ### FFmpeg logs ```shell ``` ### Client / Browser logs _No response_ ### Relevant screenshots or videos _No response_ ### Additional information I was able to successfully complete the migration by running this before the migration on library.db: ```sql UPDATE UserDatas SET LastPlayedDate=NULL WHERE LastPlayedDate=''; ``` Or via the CLI: ```bash sqlite3 jellyfin/config/data/library.db "UPDATE UserDatas SET LastPlayedDate=NULL WHERE LastPlayedDate='';" ```
OVERLORD added the bug label 2026-02-07 05:12:17 +03:00
Author
Owner

@theguymadmax commented on GitHub (Dec 2, 2025):

This should be fixed by: #15220

@theguymadmax commented on GitHub (Dec 2, 2025): This should be fixed by: #15220
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#7580