Errors when setting up Accelerator

I’m trying to setup Accelerator by following the steps here.

All is fine up until step 4: Configure Litium Search. When I try to rebuild all indices, they get added to the queue but then nothing happens. As a consequence, no products show up on the site.

This is similar to this issue (issue #1), and I have tried suggestions from there:

  • Rebuild index offline. Gives me a “No such host is known” exception: System.Net.Http.HttpRequestException: Ingen sådan värd är känd. (host.docker.internal:9210) —> System.Net.Sockets.SocketException (11001): Ingen sådan värd är känd.
  • Changed DNS from 192.168.65.5 to 192.168.65.7. No good.
  • Ran these commands in Kibana. No good.

My litium.log is filled with errors like these:
2023-04-24 10:13:24.2857 [App:01] [e3d5b1b3e5c0036fb41e125b64bdf4f5] [ERROR] [.NET ThreadPool Worker] Litium.Search.Indexing.IndexQueueService - Error in building index document for Litium.Accelerator.Search.ProductDocument with b4f63478-a5c7-409c-b84e-ef5501166f32 and “Index”, {“id”:“ProductDocument:b4f63478-a5c7-409c-b84e-ef5501166f32”, “primaryTerm”:16, “sequenceNumber”:619004, “version”:17967}: “Stored type System.Collections.Generic.ICollection1[[System.String, System.Private.CoreLib]], System.Private.CoreLib and requested type System.Collections.Generic.IList1[[System.String, System.Private.CoreLib]], System.Private.CoreLib does not match.” System.InvalidCastException: Stored type System.Collections.Generic.ICollection1[[System.String, System.Private.CoreLib]], System.Private.CoreLib and requested type System.Collections.Generic.IList1[[System.String, System.Private.CoreLib]], System.Private.CoreLib does not match.
at Litium.Application.Common.SettingServiceImpl.<>c__DisplayClass5_01.<Get>b__0(LitiumDbContext db) at Litium.Application.Data.DbContextExtension.ExecuteInDbContext[T](IServiceProvider serviceProvider, Func2 loaderFunc)
at Litium.Application.Common.SettingServiceImpl.Get[T](String key, Guid personSystemId)
at Litium.Common.SettingServiceExtensions.Get[T](SettingService settingService, String key)
at Litium.Accelerator.Search.Filtering.FilterService.GetProductFilteringFields() in C:\projects\litium-training\Src\Litium.Accelerator\Search\Filtering\FilterService.cs:line 31
at Litium.Accelerator.Search.Indexing.Products.ProductIndexDocumentBuilder.PopulateTags(ProductDocument model, CultureInfo cultureInfo, IEnumerable1 fieldContainers) in C:\projects\litium-training\Src\Litium.Accelerator.Elasticsearch\Indexing\Products\ProductIndexDocumentBuilder.cs:line 528 at Litium.Accelerator.Search.Indexing.Products.ProductIndexDocumentBuilder.PopulateProductDocument(ProductDocument model, CultureInfo cultureInfo, IList1 variants, Context context, Boolean forBaseProduct) in C:\projects\litium-training\Src\Litium.Accelerator.Elasticsearch\Indexing\Products\ProductIndexDocumentBuilder.cs:line 414
at Litium.Accelerator.Search.Indexing.Products.ProductIndexDocumentBuilder.BuildIndexDocuments(IndexQueueItem item)+MoveNext() in C:\projects\litium-training\Src\Litium.Accelerator.Elasticsearch\Indexing\Products\ProductIndexDocumentBuilder.cs:line 166
at System.Linq.Enumerable.SelectEnumerableIterator2.ToList() at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Litium.Search.Indexing.MultilingualIndexDocumentBuilderBase1.Index(IndexQueueItem item) at Litium.Application.Search.Indexing.IndexQueueServiceImpl.ProcessItem(IHit1 doc, Action`1 bulkDescriptor)
at Litium.Application.Search.Indexing.IndexQueueServiceImpl.<>c__DisplayClass15_0.<b__0>d.MoveNext()
— End of stack trace from previous location —
at Litium.Application.Search.Indexing.IndexQueueServiceImpl.<>c__DisplayClass15_0.<b__0>d.MoveNext()

My elasticsearch.log contains quite a few of these:
2023-04-24 07:54:19.2726 [App:01] [4e28fd7f7eac1aa9effa62a7a31a7c6e] [TRACE] Nest.IElasticClient - Status: 404 {“error”:{“root_cause”:[{“type”:“index_not_found_exception”,“reason”:“no such index [litiumeducation.aq.productdocument.en-us]”,“resource.type”:“index_or_alias”,“resource.id”:“litiumeducation.aq.productdocument.en-us”,“index_uuid”:“na”,“index”:“litiumeducation.aq.productdocument.en-us”}],“type”:“index_not_found_exception”,“reason”:“no such index [litiumeducation.aq.productdocument.en-us]”,“resource.type”:“index_or_alias”,“resource.id”:“litiumeducation.aq.productdocument.en-us”,“index_uuid”:“na”,“index”:“litiumeducation.aq.productdocument.en-us”},“status”:404}
2023-04-24 07:54:20.1193 [App:01] [c712b2dca94024c1550ff7424e832ce1] [TRACE] Nest.IElasticClient - POST http://localhost:9200/litiumeducation.aq.purchasehistorydocument.invariant/_delete_by_query {“query”:{“range”:{“orderDate”:{“lt”:“2022-10-24T05:54:20.108814Z”}}}}

Would be grateful for any tips or advice.

Litium version: 8.9.1

Hi,

Probably the same issue that is reported as a bug Login. There is a workaround described by the reporter at the end of the bug definition. Can you try and see if it solves your problem?

It did not solve everything.

  • I longer get exceptions on startup. (Some used to be thrown in FilterService.cs on startup.)
  • When I try to rebuild indices they get added to the queue, just like before, but now the queue eventualy drops to 0. The documents counter remains at 0 however. I still can’t see any products on the site.
  • Rebuilding indices offline still produce the same exceptions as before, but now documents are actually added to (113 in total, as it should be I believe). I can’t see any products on the site however.

Thanks for the suggestion though. Got anything else?

The issue was with the connection to the Synonym server.

In appsettings.json, changing from:

"Synonym": {
        "Server": "host.docker.internal:9210",
        "ApiKey": null
      }

to:

"Synonym": {
        "Server": "http://localhost:9210",
        "ApiKey": null
      }

did the trick.

1 Like

If you only using this the system does not know if you want to use http or https.

"Server": "http://localhost:9210"

This will not work when Elasticsearch should connect to the synonym server to fetch the synonyms. The address will resolve correctly on the host system (Windows) but not inside the container.

"Server": "http://host.docker.internal:9210"

If I running Litium inside container this will work, otherwise it does not. When I test with ping host.docker.internal I don’t get the answer that the system was unable to find any IP for the host name.

"Server": "http://kubernetes.docker.internal:9210"

or

"Server": "http://synonymserver.localtest.me:9210"

With ping kubernetes.docker.internal/ping synonymserver.localtest.me resolve to the IP 127.0.0.1 (the same as localhost) when running on Windows as well responding with the correct IP when running inside container makes this the ultimate resolution.

The localtest.me is only working here because we use the custom dns-resolver inside the Shared dependencies (litium.com).

Remember that when using https over the localtest.me domain you can’t have multiple subdomains so the character . is not allowed to be used above the localtest.me. That means that mydomain.localtest.me is valid but mydomain.customer.localtest.me is not, the reason is that the generated certificate only contains the subject for the first one, the second one will create certificate issues.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.