-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Which Umbraco version are you using?
13.8.1
Bug summary
Recently, we discovered that when multiple editors are creating and publishing content in the backoffice at the same time, a "One or more errors occurred. (Recursive locks not allowed)" is thrown from the /umbraco/backoffice/umbracoapi/content/PostSave API.
Initially we thought that it could be an issue with our instance, but when we tried to setup a blank instance, we got the same issue as well.
Specifics
Hosting: in an Azure VM running on IIS (Standard B12ms)
Database (we tested on 2 databases):
- Azure SQL (Elastic Standard)
- MS SQL Server On prem and local
We also noticed that this does not happen in our 13.2.2 instance for another project. Based on this #17246, it seems to indicate that after an update in 13.5, the issue started to happen.
Steps to reproduce
- Get multiple persons to open up the backoffice and create a content but don't save or save and publish yet.
- Then, everybody should click on save and publish at the same time.
- A stacktrace will appear as per below in the publishing dialog with the following error
One or more errors occurred. (Recursive locks not allowed)
System.AggregateException, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
at Umbraco.Cms.Infrastructure.Scoping.Scope.TryFinally(Action[] actions)
at Umbraco.Cms.Infrastructure.Scoping.Scope.Dispose()
at Umbraco.Cms.Core.Services.ContentService.SaveAndPublish(IContent content, String culture, Int32 userId)
at Umbraco.Cms.Web.BackOffice.Controllers.ContentController.PublishInternal(ContentItemSave contentItem, String defaultCulture, String cultureForInvariantErrors, Boolean& wasCancelled, String[]& successfulCultures)
at Umbraco.Cms.Web.BackOffice.Controllers.ContentController.PostSaveInternal[TVariant](ContentItemSave contentItem, Func`3 saveMethod, Func`2 mapToDisplay)
at Umbraco.Cms.Web.BackOffice.Controllers.ContentController.PostSave(ContentItemSave contentItem)
at lambda_method2129(Closure, Object)
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
In our earlier testing, we used some JavaScript to also help to simulate the error. If the team would like to follow along, please feel free to follow along.
- Create 2 document types called "Site" and "Web Page".
- With the backoffice open, create a Site as the root node and publish it.
- Note down the ID of the site node. In the example below, it is
1058. - Paste the following code into the console and update the
parentIdin the payload to the ID of the site node.
var endpoint = '/umbraco/backoffice/umbracoapi/content/PostSave';
var $http = angular.element('body').injector().get('$http');
var umbRequestHelper = angular.element('body').injector().get('umbRequestHelper');
var send = async () => {
for (var i = 0; i < 10; i++) {
const formData = new FormData();
const payload = {
"id": 0,
"contentTypeAlias": "webPage",
"parentId": 1058,
"action": "publishNew",
"variants": [
{
"name": `Item ${i + 1}`,
"properties": [],
"culture": null,
"segment": null,
"publish": true,
"save": true
}
],
"expireDate": null,
"releaseDate": null,
"templateAlias": null
}
formData.append('contentItem', JSON.stringify(payload));
umbRequestHelper.postMultiPartRequest(endpoint, { key: 'contentItem', value: payload })
}
}
send()Expected result / actual result
The error should not occur and the content should be allowed to be published.
This item has been added to our backlog AB#53067

