Skip to content

Shoko server crashes constantly if UI is open on delete job #1384

Description

@GaryShem

Before submitting your issue, please verify the following.

  • You're using the latest Stable or Daily version of Shoko Server.
  • You're using the latest and correct (Stable:Stable, Daily:Daily) Web UI for the version of Shoko you're using.
  • You've searched this repository (top of the page) for the issue you are reporting.

Shoko Version

5.3.3

Shoko Version - Daily Commit

No response

Install Type

Linux - Docker Compose

Description

Currently importing a large collection, and under AniDB UDP ban (might be important, because this was not happening before the ban).

Expected: collection continues scanning regardless of whether the Shoko page is open or not.
Observed: if UI is closed, tasks get scheduled and executed normally; if UI is open, the entire server crashes repeatedly with the same stacktrace.

This might be a combination of factors:

  1. Adding and then removing one of the libraries
  2. Getting AniDB UDP ban
  3. Having the UI open for the events to be generated

This seems to only happen on delete jobs, as I have not experienced any problems with Shoko until it tried to remove the library.

Steps to Reproduce

In my case it was like this:

  1. Add 2 libraries (for me it was normal anime and H)
  2. Delete one of the libraries (wanted to get normal anime sorted first)
    possibly 3) get AniDB UDP ban
  3. Keep the UI open while the delete job is being processed

Log File

12:11:18| ActionService --- Removing invalid full path for VideoLocal_Place; Kimi Omou Koi/[SakuraCircle] Kimi Omou Koi - 02 (DVD 720x480 h264 AAC) [F81EB6DF].mkv (Video=6972,Place=7480,ImportFolder=4)
12:11:18| VideoLocal_PlaceService --- Removing VideoLocal_Place record for: 7480
12:11:18| VideoLocal_PlaceService --- File /media/Anime/Guyver The Bioboosted Armor/Guyver.The.Bioboosted.Armor.-.08.-.1080p.BluRay.x264.DHD.mkv failed to read MediaInfo
12:11:18| VideoLocal_PlaceService --- File /media/Anime/Guyver The Bioboosted Armor/Guyver.The.Bioboosted.Armor.-.05.-.1080p.BluRay.x264.DHD.mkv failed to read MediaInfo
12:11:18| QuartzExtensions --- Scheduling AniDB.DeleteFileFromMyListJob_Hash:"3F2C6277BA54F748DAB294DEA6A84A68"_FileSize:117299703 to run.
12:11:18| Main --- Job Completed: Checking Network Availability |
12:11:18| Main --- Waiting: 0 | Blocked: 14712 | Executing: 4/18 | Total: 14716
12:11:19| Main --- Job Completed: Checking and Refreshing Trakt Token |
12:11:19| Main --- Waiting: 0 | Blocked: 14712 | Executing: 3/18 | Total: 14715
12:11:20| Main --- Job Completed: Reading MediaInfo for File | File Path: Guyver The Bioboosted Armor/Guyver.The.Bioboosted.Armor.-.05.-.1080p.BluRay.x264.DHD.mkv
12:11:20| Main --- Waiting: 1 | Blocked: 14711 | Executing: 2/18 | Total: 14714
12:11:21| Main --- Job Completed: Reading MediaInfo for File | File Path: Guyver The Bioboosted Armor/Guyver.The.Bioboosted.Armor.-.08.-.1080p.BluRay.x264.DHD.mkv
12:11:21| Main --- Waiting: 2 | Blocked: 14710 | Executing: 1/18 | Total: 14713
12:11:22| Main --- Job Added: Deleting file from MyList | Hash: 3F2C6277BA54F748DAB294DEA6A84A68
12:11:22| Main --- Waiting: 2 | Blocked: 14709 | Executing: 1/18 | Total: 14712
12:11:22| UnhandledExceptionManager --- Date and Time: 7/13/2026 12:11:22 PM
Machine Name: fwiffo-new-pc
IP Address: 127.0.1.1
Current User: fwiffo-new-pc\shoko

Application Domain: Shoko.CLI
Assembly Codebase: /usr/src/app/build/Shoko.CLI.dll
Assembly Full Name: Shoko.CLI, Version=5.3.3.0, Culture=neutral, PublicKeyToken=null
Assembly Version: 5.3.3.0
Assembly Build Date: 3/27/2026 6:02:59 AM

Exception Source: Shoko.Server
Exception Type: System.NullReferenceException
Exception Message:
Exception Target Site: .ctor

---- Stack Trace ----
Shoko.Server.API.SignalR.Models.FileEventSignalRModel..ctor(eventArgs As FileEventArgs)
FileEventSignalRModel.cs: line 0016, col 09, IL 0058
Shoko.Server.API.SignalR.Aggregate.d__7.MoveNext()
ShokoEventEmitter.cs: line 0049, col 09, IL 0017
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Shoko.CLI.dll: N 00057
System.Threading.Tasks.<>c.b__128_1(state As Object)
Shoko.CLI.dll: N 00020
System.Threading.QueueUserWorkItemCallback.Execute()
Shoko.CLI.dll: N 00060
System.Threading.ThreadPoolWorkQueue.Dispatch()
Shoko.CLI.dll: N 00424
System.Threading.WorkerThread.WorkerThreadStart()
Shoko.CLI.dll: N 00362

12:11:22| QuartzExtensions --- Scheduling Actions.RefreshAnimeStatsJob_AnimeID:14395 to run.
12:11:22| FolderController --- An exception occurred while trying to get the child items of the directory: Access to the path '/root' is denied.: System.UnauthorizedAccessException: Access to the path '/root' is denied.
---> System.IO.IOException: Permission denied
--- End of inner exception stack trace ---
at System.IO.Enumeration.FileSystemEnumerator1.Init() at System.IO.Enumeration.FileSystemEnumerable1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
at System.IO.Enumeration.FileSystemEnumerableFactory.FileInfos(String directory, String expression, EnumerationOptions options, Boolean isNormalized)
at System.IO.DirectoryInfo.InternalEnumerateInfos(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
at System.IO.DirectoryInfo.GetFiles(String searchPattern, EnumerationOptions enumerationOptions)
at Shoko.Server.API.v3.Controllers.FolderController.b__4_0(DirectoryInfo dir) in /usr/src/app/source/Shoko.Server/API/v3/Controllers/FolderController.cs:line 131
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at Shoko.Server.API.SignalR.Models.FileEventSignalRModel..ctor(FileEventArgs eventArgs) in /usr/src/app/source/Shoko.Server/API/SignalR/Models/FileEventSignalRModel.cs:line 16
at Shoko.Server.API.SignalR.Aggregate.ShokoEventEmitter.OnFileDeleted(Object sender, FileEventArgs e) in /usr/src/app/source/Shoko.Server/API/SignalR/Aggregate/ShokoEventEmitter.cs:line 49
at System.Threading.Tasks.Task.<>c.b__128_1(Object state)
at System.Threading.QueueUserWorkItemCallback.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

Full log:
shoko.log

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions