Developer forum

Forum » Development » NullReferenceException of the module eCom_Catalog

NullReferenceException of the module eCom_Catalog

Tomas Gomez
Reply

Hello,

We have an error of type eCom_Catalog NullReferenceException. 

The error fires frequently, and also at nighttime when nobody is working on the solution, so it may come from an automated task. We donĀ“t know why it happens, nor how to reproduce the error, it is not a response of any user action.

Here is the log info about the error:

2020-08-02 12:31:13.569: An error occurred while attaching module 'eCom_Catalog' (Dynamicweb.Frontend.Content). System.NullReferenceException: Object reference not set to an instance of an object.
at Dynamicweb.Ecommerce.Frontend.Renderer.RenderProduct(Product product, Boolean extendedProperties, Template template, Int32 loopCounter, Boolean renderRelated, String productUrl, Int32 quantity, Int32 wishListId, Boolean renderPublicList, Boolean isRecursiveCall, Lazy`1 categoryFieldSorting, Int32 orderLineOfProductCount, RenderingContext renderingContext, String unitId)
at Dynamicweb.Ecommerce.Frontend.Renderer.RenderProduct(Product product, Boolean extendedProperties, String unitId)
at Dynamicweb.Ecommerce.Frontend.Frontend.RenderProduct(Product product, String unitId)
at Dynamicweb.Ecommerce.Frontend.Frontend.EcomRender()
at Dynamicweb.Ecommerce.Frontend.Frontend.GetContent()
at Dynamicweb.Frontend.Content.GetModuleOutput(Paragraph paragraph, PageView pageview)

Does anybody have a clue about why this happens and how to solve it?

Regards,
Tomas

 

image.png

Replies

 
Andrew Rushworth
Reply

Did you ever find a solution to this?

We get it on some produccts and not others.

An error occurred while attaching module 'eCom_Catalog' (Dynamicweb.Frontend.Content). The url: ?ID=9754&productid=110585. System.NullReferenceException: Object reference not set to an instance of an object.    at Dynamicweb.Ecommerce.Frontend.Renderer.RenderProduct(Product product, Boolean extendedProperties, Template template, Int32 loopCounter, Boolean renderRelated, String productUrl, Int32 quantity, Int32 wishListId, Boolean renderPublicList, Boolean isRecursiveCall, Lazy`1 categoryFieldSorting, Int32 orderLineOfProductCount, RenderingContext renderingContext, String unitId)    at Dynamicweb.Ecommerce.Frontend.Renderer.RenderProduct(Product product, Boolean extendedProperties, String unitId)    at Dynamicweb.Ecommerce.Frontend.Frontend.EcomRender()    at Dynamicweb.Ecommerce.Frontend.Frontend.GetContent()    at Dynamicweb.Frontend.Content.GetModuleOutput(Paragraph paragraph, PageView pageview)

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Andrew

What version is this - and where do product data come from? Are they integrated?

Do you have validation errors in Monitoring-> Health? (https://doc.dynamicweb.com/documentation-9/monitoring#10218)

 
Andrew Rushworth
Reply

Hi Nicolai,

We are using version 19.15.3 with Rapido.

Products are integrated from LS using the LiveIntegration.
There are a some validation errors (see attached) - could this be ther reason it works on some products and not others?

 

 

Health_EcommerceData.jpg
 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Andrew.

Yes - validation errors is basically 'bad' data that the rendering will try to resolve to something useful. And that can cause null reference exceptions. I.e. it could be that we are trying to render a product group that is not there etc.

We can fix the rendering to take more null references into consideration - then we need a copy of your solution so we can se what the bad data is and make a workaround for it.

If you click on each of the validation errors, you can see the SQL run to find the errors and what they are.

 
Andrew Rushworth
Reply

Thanks Nicolai.
 see a lot have to do with the product groups - probably caused by restore from production and then updating with UAT data.

Will let you know how it goes.

 

You must be logged in to post in the forum