getting this error every 5 seconds in Production - any help on resolving this error is greatly appreciated.
System.InvalidOperationException: This SqlTransaction has completed; it is no longer usable. at Umbraco.Extensions.NPocoDatabaseExtensions.GetCurrentTransactionIsolationLevel(IDatabase database) at System.Runtime.ExceptionServices.InternalCalls.<RhpSfiNext>g____PInvoke|1_0(StackFrameIterator* __pThis_native, UInt32* __uExCollideClauseIdx_native, Boolean* __fUnwoundReversePInvoke_native, Boolean* __fIsExceptionIntercepted_native) at Umbraco.Cms.Infrastructure.Scoping.Scope.get_Database() at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.DistributedJobRepository.GetAll() at Umbraco.Cms.Infrastructure.Services.Implement.DistributedJobService.TryTakeRunnableAsync() at Umbraco.Cms.Infrastructure.BackgroundJobs.DistributedBackgroundJobHostedService.RunRunnableJob(CancellationToken stoppingToken) at Umbraco.Cms.Infrastructure.BackgroundJobs.DistributedBackgroundJobHostedService.ExecuteAsync(CancellationToken stoppingToken)
Hi Justin, thank you for reaching out. No, this is not a load balanced setup - this error in Logs has started appearing only after we upgraded from Version 13 to Version 17 recently. thanks
That error comes from a background job runner that’s new in v17, so it wouldn’t have existed on 13. Looks like the upgrade didn’t fully apply to the database and it’s failing on the first poll after startup, then repeating every 5 seconds.
Can you check the Umbraco logs to see if you have any other errors, especially from when you migrated (if you still have them).
Also, can you run this SQL to see if you have the distributed jobs table:
SELECT name FROM sys.tables WHERE name LIKE 'umbraco%Job%'
You may also be able to change the logging for the Umbraco.Cms.Infrastructure.BackgroundJobs and Umbraco.Cms.Infrastructure.Scoping namespaces to Debug to see if you get any further information in the logs.
Thank you for your detailed response. Yes, there’s a ‘umbracoDistributedJob’ table - the logviewer has only this particular error appearing every 5 seconds - no other error reported.
thanks, Justin. I just applied the ‘Debug’ setting for the namespaces. One of the errors i’m seeing in logs now is
System.InvalidOperationException:
This SqlTransaction has completed; it is no longer usable.
at Microsoft.Data.SqlClient.SqlTransaction.ZombieCheck()
at StackExchange.Profiling.Data.ProfiledDbTransaction.get_IsolationLevel() in C:\projects\dotnet\src\MiniProfiler.Shared\Data\ProfiledDbTransaction.cs:line 36
at Umbraco.Cms.Infrastructure.Scoping.Scope.get_Database()
at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.DistributedJobRepository.GetAll()
at Umbraco.Cms.Infrastructure.Services.Implement.DistributedJobService.TryTakeRunnableAsync()
at Umbraco.Cms.Infrastructure.BackgroundJobs.DistributedBackgroundJobHostedService.RunRunnableJob(CancellationToken stoppingToken)
at Umbraco.Cms.Infrastructure.BackgroundJobs.DistributedBackgroundJobHostedService.ExecuteAsync(CancellationToken stoppingToken)
Serilog’s MinimumLevel.Default acts as a global floor for event creation. An override can only raise the restriction (e.g., from Information up to Warning or Error to quiet things down). It cannot promote a namespace’s logging level lower than the default floor. Because your default is set to Information, Serilog drops Debug events before they are ever generated, meaning your Umbraco background job and scoping Debug overrides will be completely ignored.
@srikanth-orbit was that new log entry actually tagged as debug ?
The upgrade from 17.5.3 to 17.6.2 has resolved the Isolation scope error and the other errors related to Distributed Background jobs - CMS errors have reduced drastically. thanks