Developer forum

Forum » Development » Index - Data is null when building

Index - Data is null when building

Mikkel Toustrup Olsen
Reply

Hey all,

I've encountered this rather odd issue.

We are multiple devs working on the same project

I've found that we, from time to time, have issues building our local index. We're all working on the same development database which has product data, but when we are trying to build either 

Index A / Index B it fails with the error message - Data is null (see attached dataIsNull.png).

Furthermore, I've noticed in my query, that my excluded/included files are broken - instead of an actual name of the field it gives me [object Object] instead - which could be the reason why the Data is null error when building is casted. (See attached dataIsNullQuery.png).

Have anyone else encountered this issue? - Is there a setting on the application that I'm not aware of when sharing my index files with other developers? :-)

Thanks

BR Mikkel 

dataIsNull.PNG dataIsNullQuery.PNG

Replies

 
Nicolai Pedersen
Reply

I have not seen it before.

What does your browser developer toolbar reveals? Any 404s, 500s or anything? could be something not coming out of DW correctly.

NP

 
Mikkel Toustrup Olsen
Reply

Hey Nicolai,

Actually i see this in my console when trying to enter my Repository.. Not able to enter my repo now

I didn't notice anything in the network tab which couldn't load etc.

See attached.

 

consoleErrorIndex.PNG
 
Mikkel Toustrup Olsen
Reply

Hi again Nicolai,

I got the console error sorted - by trying to completely remove all index files and folders located in the Index folder along with the files and folders in the Repositories folder.

I am now able to create a new index, add a default ProductIndexSchemaExtender (full) and two instances (Index A and Index B). However, when I try to build the Index, it still says Data is null.

The following error code is thrown in the Log's section in the Diagnotics folder: 

 Starting processing products.
2017-10-25 18:49:50.451: Product index builder experienced a fatal error.. System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values.    at System.Data.SqlClient.SqlBuffer.get_Int32()    at Dynamicweb.Ecommerce.Indexing.ProductIndexBuilder.ProcessProducts()    at Dynamicweb.Ecommerce.Indexing.ProductIndexBuilder.Build(IIndexWriter writer, Tracker tracker)
2017-10-25 18:49:50.451: Product index builder experienced a fatal error.
2017-10-25 18:49:50.451: Failed (3913 / 3941).
2017-10-25 18:49:50.451: Closing index writer.
2017-10-25 18:49:50.451: Closed index writer.

Are there more locations where index files are being saved, or something that I might miss. The above mentioned steps where to start from a fresh, with a new clean index, clean repo etc.

The repo name is the same though, but the files itself was deleted before I started obviously..

BR Mikkel

 

 

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Try to check if you have any null values in the column ProductVariantProdCounter in EcomProducts table.

Votes for this answer: 1
 
Mikkel Toustrup Olsen
Reply

Hey Nicolai,

They are all NULL.

FYI, we don't have any variants on the solution.

DB schema says the column can be null though.

EDIT: I tried to update the column ProductVariantProdCounter to 0 on all products as we dont have variants, and now the index is being built correctly.

Though up untill a couple of days ago it worked, so im kinda confused why the index suddendly doesn't build because of this

Data is being imported, and I guess my workaround will be just to set this field to 0, as we before mentioned dont have variants :) 

Good learning though! 

Thanks Nicolai :)

BR Mikkel

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Can you try update them to 0 and see if your indexing still fails? It is the only int32 related issue I can see.

How did the data go into this database? By import?

Otherwise we need a full copy to do a debug.

Votes for this answer: 1
 
Mikkel Toustrup Olsen
Reply

So, to sum up:

Setting ProductVariantProdCounter = 0 fixed the issue.

 
Nicolai Pedersen
Reply

Great. I made a change to the code to handle dbnull.

BR Nicolai

 
Anders Ditlevsen
Anders Ditlevsen
Reply
This post has been marked as an answer

Hello

I am experiencing the same issue, which the same "fix" also works for. However even after upgrading to 9.3.8 i still have the same issue.

The fix you said you had made on the 26th october, has it not made it into a version yet??

BR
Anders

Votes for this answer: 1
 
Mikkel Toustrup Olsen
Reply

Hi Anders,

Sorry, but I marked your question as an answer..

However, if you're working with variants, my guess is that you have to set them in order for the DW backend to show variants correclty. That's obviously according to my experience - have had a lot of that stuff recently.

Let me know if you need any input on this.

BR Mikkel

 
Anders Ditlevsen
Anders Ditlevsen
Reply

Hi Mikkel

I am not working with any variants just simple products and product groups. However as a result of an import from an external system, the field is left null. 

This would normally be a problem if not for Nicolai's fix that he mentioned he made the 26th oct. So i was wondering if that fix did not make it out into a dynamicweb version since the same issue can be found in the latest version 9.3.8.

BR
Anders 

 
Mikkel Toustrup Olsen
Reply

Hi Anders,

Probably not yet, Nicolai will most likely enlighten us when ever it has been fixed.

However, if you're able to set the field(s) in the import I think that would be the way to go for now.

BR Mikkel

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi all

This is TFS#41125 that is scheduled for 9.4 since we thought it was a one time issue only.

I'ved merged the change to 9.3 for the next hotfix.

BR Nicolai

Votes for this answer: 2
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I have just upgraded one of our solutions from 9.4 to the latest 9.13.9 and I got the same error.

I don't have Null ProductNames nor Null ProductVariantProdCounter.
Any other potential field to look into?

Thank you,
Adrian

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

In my case, I am suspecting something from order details.

I have set the index to skip order history and now it runs.

Adrian

 

You must be logged in to post in the forum