Developer forum

Forum » Development » Product Index fails

Product Index fails

Jesper Splidsboel
Reply

If I try to build index i get an error, anyone know where to start ?

Another question, why is index marked as ok in overview ?

From logfile:

2022-08-11 13:33:49.308: Reading next batch, starting from ProductautoID: 0. ThreadID: 183
2022-08-11 13:33:51.074: Reading next batch, starting from ProductautoID: 34909. ThreadID: 183
2022-08-11 13:33:52.949: Reading next batch, starting from ProductautoID: 35586. ThreadID: 183
2022-08-11 13:33:54.683: Reading next batch, starting from ProductautoID: 36196. ThreadID: 183
2022-08-11 13:33:56.402: Reading next batch, starting from ProductautoID: 37029. ThreadID: 183
2022-08-11 13:33:57.949: Reading next batch, starting from ProductautoID: 37841. ThreadID: 183
2022-08-11 13:33:59.699: Reading next batch, starting from ProductautoID: 38647. ThreadID: 183
2022-08-11 13:34:01.386: Reading next batch, starting from ProductautoID: 39406. ThreadID: 183
2022-08-11 13:34:03.199: Reading next batch, starting from ProductautoID: 40921. ThreadID: 183
2022-08-11 13:34:04.152: Reading next batch, starting from ProductautoID: 41855. ThreadID: 183
2022-08-11 13:34:04.152: Error processing products. System.NullReferenceException: Object reference not set to an instance of an object.    at Dynamicweb.Ecommerce.Indexing.ProductIndexBuilder.<>c__DisplayClass321_0.<GetProductGroupRelations>b__0(ProductGroupRelation x)    at System.Linq.Enumerable.WhereListIterator`1.MoveNext()    at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)    at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)    at System.Lazy`1.CreateValue()    at System.Lazy`1.LazyInitValue()    at Dynamicweb.Ecommerce.Indexing.ProductIndexBuilder.ProcessProducts(SqlConnection connection, IIndexWriter writer, Tracker tracker)
2022-08-11 13:34:04.152: Error processing products
2022-08-11 13:34:04.152: Completed processing products. ThreadID: 183
2022-08-11 13:34:04.152: Closing index writer, just trying... ThreadID: 183
2022-08-11 13:34:04.277: Closed index writer successfully. ThreadID: 183
2022-08-11 13:34:04.277: Ended build process. ThreadID: 183
2022-08-11 13:34:04.277: Completed (4204 / 4204). ThreadID: 183

 

index_error.png

Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Jesper,

I have seen this before when I had orphan ManufacturerIds in my EcomProducts Table.

Not sure if this is the case with you but it is worth checking.

Adrian

 

 
Morten Snedker Dynamicweb Employee
Morten Snedker
Reply
This post has been marked as an answer

Hi Jesper,

I see that you get a NullReferenceException exception on GetProductGroupRelations. Check with 

SELECT * FROM EcomGroupProductRelation WHERE GroupProductRelationProductId NOT IN (SELECT ProductId FROM EcomProdcts) 
SELECT * FROM EcomGroupProductRelation WHERE GroupProductRelationGroupId NOT IN (SELECT GroupId FROM EcomGroups) 

to see if you should happen to have any orphaned data in the EcomGroupProductRelation table. In a quite unlikely event: check that you do not have a row with NULL as ID in either of the tables EcomProducts / EcomGroups.

If the solution is hosted by us, you may use Monitoring > Health > Ecommerce data to help spot tables with bad data.

If you still cannot find the little bastard, pass a mail to care@dynamicweb.dk with an URL to your solution, and with a reference link to this thread, and we'll take a look at it.

BR
Snedker

Votes for this answer: 1
 
Jesper Splidsboel
Reply

The problem was EcomGroupProductRelations with no existing group/product. Now the problem is just to find why these data is missing or why relations was not deleted. Do you know a bug where you delete a product, but the EcomGroupProductRelation is not deleted (from DW backend) ?

 
Morten Snedker Dynamicweb Employee
Morten Snedker
Reply

Hi Jesper,

This usually happens when you have import jobs that also remove products. If you do not include these relational tables then orphaned data occurs. Deleting products from UI will have our API handle it.

If you can reproduce the problem from backend, I'd be happy to hear about it.

/Snedker

 

You must be logged in to post in the forum