-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Library Fails to Scan due to System.InvalidOperationException error #11605
Comments
Hi, it seems like your issue report has the following item(s) that need to be addressed:
This is an automated message, currently under testing. Please file an issue here if you encounter any problems. |
I encountered exactly the same problem, |
Issue is that it isnt saving the XML when you change add or remove paths to your libraries. Now if you have a path that no longer exists it breaks the scan. I had to do this: you will have a folder for each library you have and find Options.xml W no longer existed and it wouldnt let me add or delete from the client so I had to manually edit the XML, I deleted the path that no longer existed. I deletetd this: Final view of the segment is now: Z:\Vex Videos\Anime V:\Vex\AnimeOnce all the broken paths were removed everything worked as normal Edit: I'm starting to think my error is different, but it's worth a shot if you have any external drives that are unplugged. |
I'm also having this issue on a fresh install with a music library of about 1200 albums. |
Unfortunately this wasn't the issue on my end, though I thought for a second it might be the Metadata plugins listed on that file that I had removed, but I readded the plugins to no avail. |
Wait, I just spun up a new instance of Jellyfin, and am having the same issue. This is with the jellyfin/jellyfin image. Is it possible Jellyfin is trying to modify my media directories (and if so, why)? Cause I have all my media folder mounts as read-only (a precaution so nothing like the lyric files getting overwritten bug ever happens). |
same error here. The music library scan always trigger this error: warning -print_format json -show_streams -show_format
[03:10:47] [INF] [40] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Starting /usr/lib/jellyfin-ffmpeg/ffprobe with args -analyzeduration 200M -probesize 1G -i file:"/media/Music/许嵩/单曲/许嵩 - 绝代风华.flac" -threads 0 -v warning -print_format json -show_streams -show_format
[03:11:08] [ERR] [40] Emby.Server.Implementations.ScheduledTasks.TaskManager: Error executing Scheduled Task
System.InvalidOperationException: Must add values for the following parameters: @Type2, @Value2, @CleanValue2
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.ExecuteNonQuery()
at Emby.Server.Implementations.Data.SqliteItemRepository.InsertItemValues(Guid id, List`1 values, SqliteConnection db)
at Emby.Server.Implementations.Data.SqliteItemRepository.UpdateItemValues(Guid itemId, List`1 values, SqliteConnection db)
at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItemsInTransaction(SqliteConnection db, IEnumerable`1 tuples)
at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItems(IReadOnlyList`1 items, CancellationToken cancellationToken)
at Emby.Server.Implementations.Library.LibraryManager.UpdateItemsAsync(IReadOnlyList`1 items, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken)
at MediaBrowser.Providers.Manager.MetadataService`2.SaveItemAsync(MetadataResult`1 result, ItemUpdateType reason, CancellationToken cancellationToken)
at MediaBrowser.Providers.Manager.MetadataService`2.RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken)
at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, CancellationToken cancellationToken)
at MediaBrowser.Controller.Entities.Audio.MusicAlbum.RefreshAllMetadata(MetadataRefreshOptions refreshOptions, IProgress`1 progress, CancellationToken cancellationToken)
at MediaBrowser.Controller.Entities.Folder.RefreshAllMetadataForContainer(IMetadataContainer container, MetadataRefreshOptions refreshOptions, IProgress`1 progress, CancellationToken cancellationToken)
at MediaBrowser.Controller.Entities.Folder.RefreshChildMetadata(BaseItem child, MetadataRefreshOptions refreshOptions, Boolean recursive, IProgress`1 progress, CancellationToken cancellationToken)
at MediaBrowser.Controller.Entities.Folder.<>c__DisplayClass69_0`1.<<RunTasks>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at MediaBrowser.Controller.Entities.Folder.RunTasks[T](Func`3 task, IList`1 children, IProgress`1 progress, CancellationToken cancellationToken)
at MediaBrowser.Controller.Entities.Folder.RefreshChildMetadata(BaseItem child, MetadataRefreshOptions refreshOptions, Boolean recursive, IProgress`1 progress, CancellationToken cancellationToken)
at MediaBrowser.Controller.Entities.Folder.<>c__DisplayClass69_0`1.<<RunTasks>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at MediaBrowser.Controller.Entities.Folder.RunTasks[T](Func`3 task, IList`1 children, IProgress`1 progress, CancellationToken cancellationToken)
at MediaBrowser.Controller.Entities.Folder.RefreshChildMetadata(BaseItem child, MetadataRefreshOptions refreshOptions, Boolean recursive, IProgress`1 progress, CancellationToken cancellationToken)
at MediaBrowser.Controller.Entities.Folder.<>c__DisplayClass69_0`1.<<RunTasks>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at MediaBrowser.Controller.Entities.Folder.RunTasks[T](Func`3 task, IList`1 children, IProgress`1 progress, CancellationToken cancellationToken)
at MediaBrowser.Controller.Entities.Folder.ValidateChildrenInternal2(IProgress`1 progress, Boolean recursive, Boolean refreshChildMetadata, Boolean allowRemoveRoot, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, CancellationToken cancellationToken)
at MediaBrowser.Controller.Entities.Folder.ValidateChildrenInternal(IProgress`1 progress, Boolean recursive, Boolean refreshChildMetadata, Boolean allowRemoveRoot, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, CancellationToken cancellationToken)
at MediaBrowser.Controller.Entities.AggregateFolder.ValidateChildrenInternal(IProgress`1 progress, Boolean recursive, Boolean refreshChildMetadata, Boolean allowRemoveRoot, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService, CancellationToken cancellationToken)
at Emby.Server.Implementations.Library.LibraryManager.PerformLibraryValidation(IProgress`1 progress, CancellationToken cancellationToken)
at Emby.Server.Implementations.Library.LibraryManager.ValidateMediaLibraryInternal(IProgress`1 progress, CancellationToken cancellationToken)
at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options)
[03:11:08] [INF] [40] Emby.Server.Implementations.ScheduledTasks.TaskManager: 扫描媒体库 Failed after 0 minute(s) and 26 seconds
[03:11:16] [INF] [20] Emby.Server.Implementations.ScheduledTasks.TaskManager: Webhook Item Added Notifier Completed after 0 minute(s) and 0 seconds And i have checked the file: |
I wonder if there's a bug in the version of jellyfin-ffmpeg bundled with this docker image, given the |
Is your music library mounted read-only as well? |
nop, have test for write file: (py3) wlt@watermelon:/data1/webdav$ docker exec -it jellyfin /bin/bash
I have no name!@watermelon:/$ jellyfin/^C
I have no name!@watermelon:/$ ls
bin boot cache config dev etc home jellyfin lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
I have no name!@watermelon:/$ touch /media/Music/许嵩/单曲/a.txt
I have no name!@watermelon:/$ rm /media/Music/许嵩/单曲/a.txt it seems the music code has some bugs, as i check the source code but no c# environment, don't know how to develop: 5171 private void InsertItemValues(Guid id, List<(int MagicNumber, string Value)> values, SqliteConnection db)
5172 {
5173 const int Limit = 100;
5174 var startIndex = 0;
5175
5176 const string StartInsertText = "insert into ItemValues (ItemId, Type, Value, CleanValue) values ";
5177 var insertText = new StringBuilder(StartInsertText);
5178 while (startIndex < values.Count)
5179 {
5180 var endIndex = Math.Min(values.Count, startIndex + Limit);
5181
5182 for (var i = startIndex; i < endIndex; i++)
5183 {
5184 insertText.AppendFormat(
5185 CultureInfo.InvariantCulture,
5186 "(@ItemId, @Type{0}, @Value{0}, @CleanValue{0}),",
5187 i);
5188 }
5189
5190 // Remove trailing comma
5191 insertText.Length--;
5192
5193 using (var statement = PrepareStatement(db, insertText.ToString()))
5194 {
5195 statement.TryBind("@ItemId", id);
5196
5197 for (var i = startIndex; i < endIndex; i++)
5198 {
5199 var index = i.ToString(CultureInfo.InvariantCulture);
5200
5201 var currentValueInfo = values[i];
5202
5203 var itemValue = currentValueInfo.Value;
5204
5205 // Don't save if invalid
5206 if (string.IsNullOrWhiteSpace(itemValue))
5207 {
5208 continue;
5209 }
5210
5211 statement.TryBind("@Type" + index, currentValueInfo.MagicNumber);
5212 statement.TryBind("@Value" + index, itemValue);
5213 statement.TryBind("@CleanValue" + index, GetCleanValue(itemValue));
5214 }
5215
5216 statement.ExecuteNonQuery();
5217 }
5218
5219 startIndex += Limit;
5220 insertText.Length = StartInsertText.Length;
5221 }
5222 } The error above indicates that the sql query statement may miss value for |
My jellyfin log doesn't contain this error. Only wait for some seconds and output error after the line: [03:10:47] [INF] [40] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Starting /usr/lib/jellyfin-ffmpeg/ffprobe with args -analyzeduration 200M -probesize 1G -i file:"/media/Music/许嵩/单曲/许嵩 - 绝代风华.flac" -threads 0 -v warning -print_format json -show_streams -show_format The above I have no name!@watermelon:/$ /usr/lib/jellyfin-ffmpeg/ffprobe -analyzeduration 200M -probesize 1G -i file:"/media/Music/许嵩/单曲/许嵩 - 绝代风华.flac" -threads 0 -v warning -print_format json -show_streams -show_format {
"streams": [
{
"index": 0,
"codec_name": "flac",
"codec_long_name": "FLAC (Free Lossless Audio Codec)",
"codec_type": "audio",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"sample_fmt": "s16",
"sample_rate": "44100",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 0,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0", "time_base": "1/44100",
"start_pts": 0, "start_time": "0.000000",
"duration_ts": 11249747,
"duration": "255.096304",
"bits_per_raw_sample": "16", "extradata_size": 34,
"disposition": {
...
"format": {
"filename": "file:/media/Music/许嵩/单曲/许嵩 - 绝代风华.flac",
"nb_streams": 2,
"nb_programs": 0,
"format_name": "flac",
"format_long_name": "raw FLAC",
"start_time": "0.000000",
"duration": "255.096304",
"size": "29017334",
"bit_rate": "910004",
"probe_score": 100,
"tags": {
"ALBUM": "天下3十周年主题曲",
"ARTIST": "许嵩",
"DATE": "2018",
"ENCODER": "Lavf57.71.100",
"GENRE": "pop",
"LYRICS": "[00:00.00]作词 : 许嵩\n[00:01.00]作曲 : 许嵩\n[00:03.77]编曲:郑楠\n[00:06.37]\n[00:21.15]林间伞下\n[00:24.51]你与我执手信步伞下\n[00:29.52]竹上隐客惊起了雀鸦\n[00:34.54]速决高下 挥剑一刹那\n[00:37.59]\n[00:41.40]入鞘还家\n[00:44.71]你莞尔沏来春涧草茶\n[00:49.74]子落楸枰 雨落鸳鸯瓦\n[00:54.86]经年相伴 心饴不化\n[00:58.29]\n[01:00.06]曾经年少鲜衣怒马\n[01:04.92]寒沙里征战与杀伐\n[01:10.03]玉帐外传来了胡笳\n[01:13.76]如你驻扎 取我牵挂\n[01:20.16]我心里那一座天下\n[01:25.23]你坐镇笑靥如桃花\n[01:30.21]世间当真有两全法\n[01:35.16]江山深处抚你风华\n[01:40.73]\n[02:02.13]入鞘还家\n[02:05.59]你莞尔沏来春涧草茶\n[02:10.62]子落楸枰 雨落鸳鸯瓦\n[02:15.68]经年相伴 心饴不化\n[02:19.22]\n[02:20.94]曾经年少鲜衣怒马\n[02:25.84]寒沙里征战与杀伐\n[02:30.82]玉帐外传来了胡笳\n[02:34.67]如你驻扎 取我牵挂\n[02:41.13]我心里那一座天下\n[02:46.03]你坐镇笑靥如桃花\n[02:51.04]世间当真有两全法\n[02:56.13]江山深处抚你风华\n[03:01.15]曾经年少鲜衣怒马\n[03:06.22]寒沙里征战与杀伐\n[03:11.31]玉帐外传来了胡笳\n[03:15.09]如你驻扎 取我牵挂\n[03:21.45]我心里那一座天下\n[03:26.39]你坐镇笑靥如桃花\n[03:31.47]世间当真有两全法\n[03:36.49]江山深处抚你风华\n[03:41.62]世间当真有两全法\n[03:46.68]江山深处抚你风华\n[03:51.53]\n[03:56.71]制作人:许嵩\n[03:58.07]吉他:高飞\n[03:59.34]古筝:程皓如\n[04:00.73]琵琶:刘小菁\n[04:02.08]笛子:冯
天石\n[04:03.49]和声:许嵩\n[04:04.91]录音师:许嵩/刘韧\n[04:06.35]混音师:许嵩\n[04:07.78]母带处理:许嵩\n[04:09.09]录音室:Vae Studio/TTL",
"TITLE": "绝代风华",
"track": "01"
}
}
} So it‘s highly probable that the SQL query statement is missing some value in |
Whitespace values weren't being filtered out in advance Remove the posibility of this happening again by always binding Should fix jellyfin#11605
Can confirm 10.9.2 fixed this issue. Thanks so much to everyone who looked into it and got it merged and released so quickly! |
Please describe your bug
After implementing the suggestion from #11589, I was able to get past a 'database is locked' issue I had, however, I am still unable to complete a library scan due to the issue listed below and in the logs:
System.InvalidOperationException: Must add values for the following parameters: @Type2, @Value2, @CleanValue2
Reproduction Steps
Upgrade a 10.9.0 linuxserver/jellyfin container to 10.9.1 by
docker compose pull && docker compose down && docker compose up -d
to recreate the containers. Upon doing so, waiting for the service to start up, and setting parallel scan to 1 (as opposed to 0), completing a library scan will be impossible due to this error captured in the logs every time. My docker-compose.yml has the environment variableJELLYFIN_playlists:allowDuplicates=false
, and the following mounts:Jellyfin Version
10.9.0
if other:
10.9.1
Environment
Jellyfin logs
FFmpeg logs
No response
Please attach any browser or client logs here
No response
Please attach any screenshots here
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: