umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.49k stars 2.69k forks source link

Index populating failed for populator "Umbraco.Cms.Infrastructure.Examine.ContentIndexPopulator" #14910

Closed chriskarkowsky closed 1 year ago

chriskarkowsky commented 1 year ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

12.0.1

Bug summary

Error in the log viewer is presenting as: Index populating failed for populator "Umbraco.Cms.Infrastructure.Examine.ContentIndexPopulator"

Once this issue is logged, we are then unable to Save any items in the backoffice.

Specifics

No response

Steps to reproduce

We deploy or Umbraco app to Azure Web app.

On boot, I save a Design file, which is successful.

Then immediately in the, log it produces this:

Screenshot 2023-10-03 at 4 17 31 PM

I then try to save the file again, and get:

Screenshot 2023-10-03 at 4 20 38 PM

So I am unable to save anything now.

The Details of the errors: System.InvalidOperationException: The Scope 3653e316-1f1f-488f-98e2-dd246cbd1a1b being disposed is not the Ambient Scope 92fa41bc-7b3b-465d-92d7-8058e168425b. This typically indicates that a child Scope was not disposed, or flowed to a child thread that was not awaited, or concurrent threads are accessing the same Scope (Ambient context) which is not supported. If using Task.Run (or similar) as a fire and forget tasks or to run threads in parallel you must suppress execution context flow with ExecutionContext.SuppressFlow() and ExecutionContext.RestoreFlow(). at Umbraco.Cms.Infrastructure.Scoping.Scope.Dispose() at Umbraco.Cms.Core.Services.ContentTypeServiceBase2.Get(Guid id) at Umbraco.Cms.Core.PropertyEditors.NestedPropertyIndexValueFactoryBase2.Handle(TSerialized deserializedPropertyValue, IProperty property, String culture, String segment, Boolean published, IEnumerable1 availableCultures) at Umbraco.Cms.Core.PropertyEditors.JsonPropertyIndexValueFactoryBase1.GetIndexValues(IProperty property, String culture, String segment, Boolean published, IEnumerable1 availableCultures) at Umbraco.Cms.Core.PropertyEditors.NestedPropertyIndexValueFactoryBase2.GetNestedResults(String keyPrefix, String culture, String segment, Boolean published, IDictionary2 propertyTypeDictionary, TItem nestedContentRowValue, IEnumerable1 availableCultures)+MoveNext() at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection) at Umbraco.Cms.Core.PropertyEditors.NestedPropertyIndexValueFactoryBase2.Handle(TSerialized deserializedPropertyValue, IProperty property, String culture, String segment, Boolean published, IEnumerable1 availableCultures) at Umbraco.Cms.Core.PropertyEditors.JsonPropertyIndexValueFactoryBase1.GetIndexValues(IProperty property, String culture, String segment, Boolean published, IEnumerable1 availableCultures) at Umbraco.Cms.Infrastructure.Examine.BaseValueSetBuilder1.AddPropertyValue(IProperty property, String culture, String segment, IDictionary2 values, IEnumerable1 availableCultures) at Umbraco.Cms.Infrastructure.Examine.ContentValueSetBuilder.GetValueSetsEnumerable(IContent[] content, Dictionary2 creatorIds, Dictionary2 writerIds)+MoveNext() at System.Collections.Generic.LargeArrayBuilder1.AddRange(IEnumerable1 items) at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable1 source) at Umbraco.Cms.Infrastructure.Examine.ContentIndexPopulator.IndexAllContent(Int32 contentParentId, Int32 pageIndex, Int32 pageSize, IReadOnlyList1 indexes) at Umbraco.Cms.Infrastructure.Examine.ContentIndexPopulator.PopulateIndexes(IReadOnlyList1 indexes) at Umbraco.Cms.Infrastructure.Examine.IndexPopulator.Populate(IIndex[] indexes) at Umbraco.Cms.Infrastructure.Examine.ExamineIndexRebuilder.RebuildIndexes(Boolean onlyEmptyIndexes, TimeSpan delay, CancellationToken cancellationToken)

System.InvalidOperationException: The Scope 92fa41bc-7b3b-465d-92d7-8058e168425b being disposed is not the Ambient Scope ed835d65-c53d-42ec-a2b8-6da2c2caa822. This typically indicates that a child Scope was not disposed, or flowed to a child thread that was not awaited, or concurrent threads are accessing the same Scope (Ambient context) which is not supported. If using Task.Run (or similar) as a fire and forget tasks or to run threads in parallel you must suppress execution context flow with ExecutionContext.SuppressFlow() and ExecutionContext.RestoreFlow(). at Umbraco.Cms.Infrastructure.Scoping.Scope.Dispose() at Umbraco.Cms.Infrastructure.Examine.ExamineUmbracoIndexingHandler.DeferredReIndexForContent.<>c__DisplayClass6_0.<Execute>b__0(CancellationToken cancellationToken) at Umbraco.Cms.Infrastructure.HostedServices.QueuedHostedService.BackgroundProcessing(CancellationToken stoppingToken)

Expected result / actual result

Reindexing of the page should be successful and not lock the database to prevent further editing.

github-actions[bot] commented 1 year ago

Hi there @chriskarkowsky!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

elit0451 commented 1 year ago

Seems like a duplicate of #14195. I will close this one so we can keep the discussion in one place