ShokoServer icon indicating copy to clipboard operation
ShokoServer copied to clipboard

Queue sometimes getting stuck

Open t0815 opened this issue 4 months ago • 3 comments

Before submitting your issue, please verify the following.

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

Shoko Version

5.1.0

Shoko Version - Daily Commit

No response

Install Type

Windows

Description

Came across a strange issue. It seems, sometimes, the queue is getting stuck. Even if you clear, pause and unpause the queue, it won't process any further items.

Once Shoko is restarted, it's working again. I did not see any error in the log that could be related to this too. I may have a little clue, on what could be the cause, but not sure about this. I do use a VPN on my NAS and will switch connection from time to time. My suspicion is, that could have something to do with this.

I have no Screenshots or logs atm. I will update this as soon the issue occurs again.

Steps to Reproduce

  • Leave shoko running for a long time (?)
  • VPN connection, periodically switching connection
  • Check if queue is still processing items

Log File

Failed to send AniDB message: System.OperationCanceledException: The operation was canceled. at System.Threading.CancellationToken.ThrowOperationCanceledException() at System.Threading.CancellationToken.ThrowIfCancellationRequested() at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Net.Sockets.SocketReceiveFromResult>.GetResult(Int16 token) at Shoko.Server.Providers.AniDB.UDP.AniDBSocketHandler.SendUnsafe(Byte[] payload, Byte[] result) in D:\a\ShokoServer\ShokoServer\Shoko.Server\Providers\AniDB\UDP\AniDBSocketHandler.cs:line 67 at Shoko.Server.Providers.AniDB.UDP.AniDBSocketHandler.Send(Byte[] payload) in D:\a\ShokoServer\ShokoServer\Shoko.Server\Providers\AniDB\UDP\AniDBSocketHandler.cs:line 48 at Shoko.Server.Providers.AniDB.UDP.AniDBUDPConnectionHandler.<>c__DisplayClass54_1.<<SendInternal>b__3>d.MoveNext() in D:\a\ShokoServer\ShokoServer\Shoko.Server\Providers\AniDB\UDP\AniDBUDPConnectionHandler.cs:line 320 --- End of stack trace from previous location --- at Shoko.Server.Providers.AniDB.AniDBRateLimiter.EnsureRateAsync[T](Func`1 action, Boolean forceShortDelay) at Shoko.Server.Providers.AniDB.UDP.AniDBUDPConnectionHandler.<>c__DisplayClass54_1.<<SendInternal>b__2>d.MoveNext() in D:\a\ShokoServer\ShokoServer\Shoko.Server\Providers\AniDB\UDP\AniDBUDPConnectionHandler.cs:line 310 --- End of stack trace from previous location --- at Polly.Retry.AsyncRetryEngine.ImplementationAsync[TResult](Func`3 action, Context context, CancellationToken cancellationToken, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates`1 shouldRetryResultPredicates, Func`5 onRetryAsync, Int32 permittedRetryCount, IEnumerable`1 sleepDurationsEnumerable, Func`4 sleepDurationProvider, Boolean continueOnCapturedContext) at Polly.AsyncPolicy.ExecuteAsync[TResult](Func`3 action, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext) at Polly.AsyncPolicy.ExecuteAndCaptureAsync[TResult](Func`3 action, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext)

Screenshots

No response

t0815 avatar Aug 16 '25 00:08 t0815

added possible error from logs

t0815 avatar Aug 21 '25 19:08 t0815

I started getting the following erros and the queue started to get stuck on "Get Cross-References for File" Ok the issue I was having seems to have just been on anidb's end. I just needed to run a test again and everything started to work.

Failed to send AniDB message: System.OperationCanceledException: The operation was canceled. at System.Threading.CancellationToken.ThrowOperationCanceledException() at System.Threading.CancellationToken.ThrowIfCancellationRequested() at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Net.Sockets.SocketReceiveFromResult>.GetResult(Int16 token) at Shoko.Server.Providers.AniDB.UDP.AniDBSocketHandler.SendUnsafe(Byte[] payload, Byte[] result) in /usr/src/app/source/Shoko.Server/Providers/AniDB/UDP/AniDBSocketHandler.cs:line 67 at Shoko.Server.Providers.AniDB.UDP.AniDBSocketHandler.Send(Byte[] payload) in /usr/src/app/source/Shoko.Server/Providers/AniDB/UDP/AniDBSocketHandler.cs:line 48 at Shoko.Server.Providers.AniDB.UDP.AniDBUDPConnectionHandler.<>c__DisplayClass54_1.<<SendInternal>b__3>d.MoveNext() in /usr/src/app/source/Shoko.Server/Providers/AniDB/UDP/AniDBUDPConnectionHandler.cs:line 320 --- End of stack trace from previous location --- at Shoko.Server.Providers.AniDB.AniDBRateLimiter.EnsureRateAsync[T](Func`1 action, Boolean forceShortDelay) in /usr/src/app/source/Shoko.Server/Providers/AniDB/AniDBRateLimiter.cs:line 166 at Shoko.Server.Providers.AniDB.UDP.AniDBUDPConnectionHandler.<>c__DisplayClass54_1.<<SendInternal>b__2>d.MoveNext() in /usr/src/app/source/Shoko.Server/Providers/AniDB/UDP/AniDBUDPConnectionHandler.cs:line 310 --- End of stack trace from previous location --- at Polly.Retry.AsyncRetryEngine.ImplementationAsync[TResult](Func`3 action, Context context, CancellationToken cancellationToken, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates`1 shouldRetryResultPredicates, Func`5 onRetryAsync, Int32 permittedRetryCount, IEnumerable`1 sleepDurationsEnumerable, Func`4 sleepDurationProvider, Boolean continueOnCapturedContext) at Polly.AsyncPolicy.ExecuteAsync[TResult](Func`3 action, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext) at Polly.AsyncPolicy.ExecuteAndCaptureAsync[TResult](Func`3 action, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext)

and

Unable to login to AniDB: System.Threading.Tasks.TaskCanceledException: A task was canceled. at System.Threading.Tasks.Task.GetExceptions(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at Shoko.Server.Providers.AniDB.UDP.Connection.RequestLogin.Send() in /usr/src/app/source/Shoko.Server/Providers/AniDB/UDP/Connection/RequestLogin.cs:line 53 at Shoko.Server.Providers.AniDB.UDP.AniDBUDPConnectionHandler.LoginWithFallbacks(String username, String password) in /usr/src/app/source/Shoko.Server/Providers/AniDB/UDP/AniDBUDPConnectionHandler.cs:line 526 at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at Shoko.Server.Providers.AniDB.UDP.AniDBUDPConnectionHandler.LoginWithFallbacks(String username, String password) at Shoko.Server.Providers.AniDB.UDP.AniDBUDPConnectionHandler.Login(String username, String password) in /usr/src/app/source/Shoko.Server/Providers/AniDB/UDP/AniDBUDPConnectionHandler.cs:line 489 at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at Shoko.Server.Providers.AniDB.UDP.AniDBUDPConnectionHandler.Login(String username, String password) at Shoko.Server.Providers.AniDB.UDP.AniDBUDPConnectionHandler.Login() in /usr/src/app/source/Shoko.Server/Providers/AniDB/UDP/AniDBUDPConnectionHandler.cs:line 464 at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at Shoko.Server.Providers.AniDB.UDP.AniDBUDPConnectionHandler.Login() at Shoko.Server.Providers.AniDB.UDP.Generic.UDPRequest`1.Send() in /usr/src/app/source/Shoko.Server/Providers/AniDB/UDP/Generic/UDPRequest.cs:line 37 at Shoko.Server.Scheduling.Jobs.AniDB.AddFileToMyListJob.Process() in /usr/src/app/source/Shoko.Server/Scheduling/Jobs/AniDB/AddFileToMyListJob.cs:line 90 at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at Shoko.Server.Scheduling.Jobs.AniDB.AddFileToMyListJob.Process() at Shoko.Server.Scheduling.Jobs.BaseJob.Execute(IJobExecutionContext context) in /usr/src/app/source/Shoko.Server/Scheduling/Jobs/BaseJob.cs:line 33 at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at Shoko.Server.Scheduling.Jobs.BaseJob.Execute(IJobExecutionContext context) at Quartz.Simpl.MicrosoftDependencyInjectionJobFactory.ScopedJob.Execute(IJobExecutionContext context) at Quartz.Core.JobRunShell.Run(CancellationToken cancellationToken) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at Quartz.Core.JobRunShell.Run(CancellationToken cancellationToken) at Quartz.Core.QuartzSchedulerThread.<>c__DisplayClass26_0.<Run>b__0() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() --- End of stack trace from previous location ---

ThatLurker avatar Aug 31 '25 15:08 ThatLurker

We tried fixing these issues, we'll know once the next stable version is released 😔

harshithmohan avatar Sep 01 '25 13:09 harshithmohan