Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuilding of External Index, following upgrade #14560

Closed
pritesh-tailor opened this issue Jul 14, 2023 · 4 comments
Closed

Rebuilding of External Index, following upgrade #14560

pritesh-tailor opened this issue Jul 14, 2023 · 4 comments
Labels
state/needs-investigation This requires input from HQ or community to proceed type/bug

Comments

@pritesh-tailor
Copy link
Contributor

pritesh-tailor commented Jul 14, 2023

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

10.6.1

Bug summary

Since we upgraded to the recent security patch release, going from 10.4.2, the external index doesn't seem to be indexing particular pages and we've been getting the following error, 'System.InvalidOperationException: Cannot assign value "20/01/2023 09:00:00" of type "System.String" to property "openingTime" expecting type "System.DateTime".' Full stack trace in the specifics.

Specifics

The indexes aren't being correctly built, either on start up or when you use the 'Rebuild index' functionality within 'Settings', 'Examine Management', 'External Index'. The issue can be bypassed when you 'Publish with descendants' on the parent content. The full stack trace of the error is...

System.InvalidOperationException: Cannot assign value "20/01/2023 09:00:00" of type "System.String" to property "openingTime" expecting type "System.DateTime". at Umbraco.Cms.Core.Models.Property.ThrowTypeException(Object value, Type expected, String alias) at Umbraco.Cms.Core.Models.Property.TryConvertAssignedValue(Object value, Boolean throwOnError, Object& converted) at Umbraco.Cms.Core.Models.Property.SetValue(Object value, String culture, String segment) 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.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy1.CreateValue() at Umbraco.Cms.Infrastructure.Examine.ExamineUmbracoIndexingHandler.DeferedReIndexForContent.<>c__DisplayClass6_0.<Execute>b__0(CancellationToken cancellationToken) at Umbraco.Cms.Infrastructure.HostedServices.QueuedHostedService.BackgroundProcessing(CancellationToken stoppingToken)

Steps to reproduce

  1. Create a 'Page' document type.
  2. Create a 'Day' document type' that will be used in a block list editor. The document type should be setup as an 'element type' and the 'Allow vary by culture' should not be set.
  3. Add two date time properties of 'Opening Times' and 'Closing Times' to the 'Day' document type. The format of the date time properties should be configured as 'HH:mm'
  4. Create an 'Opening Times' Block list, composed of the 'Day' document type.
  5. On the 'Page' document type, give it the property 'Opening Times' and assign it the newly created 'Opening Hours' block list
  6. In the content section, set up the 'page' content and then add multiple 'day' elements to the block list. The times can be configured with '09:00' and '17:00'.
  7. Publish the content.
  8. Go to 'Settings', 'Examine Management', 'External Indexes', 'Rebuild Index' and check the logs for the error highlighted above.
  9. Clear the \umbraco\Data\TEMP\ExamineIndexes' and then re-start the application. Go to 'Settings', 'Examine Management', 'External Indexes' and attempt to search for the piece of content that was setup, using the content name'

Expected result / actual result

Expected: Index runs without issue and you can search for the content by name within 'Settings', 'Examine Management', 'External Index' inside of Umbraco.
Actual: After a while, we sometimes get the message 'The process is taking longer than expected, check the Umbraco log to see if there have been any errors during this operation.' We can't find the content when you search for the content by name within 'Settings', 'Examine Management', 'External Index' inside of Umbraco.

@github-actions
Copy link

Hi there @pritesh-tailor!

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'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

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 🤖 🙂

@Zeegaan Zeegaan added the state/needs-more-info We don't have enough information to give a good reply label Jul 17, 2023
@Zeegaan
Copy link
Member

Zeegaan commented Jul 17, 2023

Heyo! 👋
Unfortunately, I cannot reproduce this, below is an attached GIF of my setup.
Is there something wrong with my setup? 🤔
RebuildingExternal

This is on 10.6.1
image

@Zeegaan Zeegaan added state/needs-investigation This requires input from HQ or community to proceed and removed state/needs-more-info We don't have enough information to give a good reply labels Jul 17, 2023
@pritesh-tailor
Copy link
Contributor Author

Hi @Zeegaan ,

The language has been set to English (United Kingdom) in our Umbraco project. However, we have deployed the security patch, the odd thing is, it appears to be fine on the live and staging environments. It's just locally and on our test environment where the issue seems to still be there.

Thanks,
Pritesh

@pritesh-tailor
Copy link
Contributor Author

pritesh-tailor commented Jul 19, 2023

I suspect it had something to do with a corrupted database, as a clean database seems to be fine. I'll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state/needs-investigation This requires input from HQ or community to proceed type/bug
Projects
None yet
Development

No branches or pull requests

2 participants