Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » PriceProvider throws Stack Overflow Exception, v9.7.3

PriceProvider throws Stack Overflow Exception, v9.7.3

Niklas Malmqvist
Niklas Malmqvist
Reply

Hello!

We have upgraded a solution from version 9.6.22 to 9.7.3 and encountered a problem with PriceProvider. The problem occurs when an extranet user that has any item in their cart logs in. This causes the application to crash due to a Stack Overflow exception in the method FindPrice.

We use a custom price provider but all custom logic in the overridden FindPrice method has been removed and the only line in the method is this:

return base.FindPrice(product, quantity, variantId, currency, unitId, user);

I added logging upon every call to the method and can see that it was called about 1400 times during 3 seconds.

 

This was done to upgrade the solution:

- Changed version on all projects in the solution to .NET Framework 4.7.2

- Replaced all Dynamicweb binaries with the ones supplied on the 9.7.3 zip file.

 

Has anyone else expecienced something similar? Do you have any advice on how we can resolve this?

Let me know if you need more information.

 

Kind regards

Niklas


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Niklas,

Unfortunately a bug has been introduced recently in the base class for price providers. I have registered this as bug 72795.

If you make sure to either return a PriceRaw instance (or null, if no price can be provided) then the error should go away. Do not call the base class as that will cause infinite recursion.

/Morten

 

 
Niklas Malmqvist
Niklas Malmqvist
Reply

Hi Morten,

Thank you for the quick reply.

I see that version 9.7.4 was released yesterday. Do you know if the same bug present in that version as well?

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

The bug is still present in 9.7.4. The fix will be included in the next release.

Did you try the workaround I mentioned?

/Morten

 
Niklas Malmqvist
Niklas Malmqvist
Reply

Ok thanks for the info! When is the next release scheduled?

No not yet but I will try it today. However we will probably wait until the bug is fixed, unless it's a long time away.

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hotfixes are released on a need-to basis, so there are no fixed release dates, but the next hotfix will probably be available within the next 2-4 weeks.
You should get a message in this thread when it has been released.

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

Hi Niklas,

The bug has now been fixed and will be released as part of the next hotfix.

If you are using nuget packages in your setup then you can already now upgrade to version 1.7.33 of the Dynamicweb.Ecommerce package:

https://www.nuget.org/packages/Dynamicweb.Ecommerce/1.7.33

Best regards,
Morten

Votes for this answer: 1
 
Niklas Malmqvist
Niklas Malmqvist
Reply

Hi Morten!

That is great news, thank you!

We're using the zipped file bundle in our setup at the moment but if a new bundle is released within a couple of week that's fine.

It would actually be easier for us to just get everything from NuGet - would that work for production code, or is the zip bundles considered more "stable"?
I'm asking because there are more frequent updates on the NuGet feed. For example, the latest version of Dynamicweb on NuGet is 9.7.22, while the zip bundle has version 9.7.4. Also, how long are the packages retained on NuGet?

Kind regards,
Niklas

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

The version number of the zipped release follows the version number of Dynamicweb.Admin. Installation of Dynamicweb.Admin 9.7.4 nuget pacakge is equivalent to the zipped version 9.7.4

Packages are just as stable as using the zipped release. However, you should be careful about just updating all packages to latest version, because if a package has changed major version number (e.g. from 1.1.0 to 2.0.0) then it generally means that it can contain breaking changes. I would recommend that you upgrade the version of Dynamicweb.Admin when new releases are available (which will also upgrade all dependencies) and then upgrade other packages if you need to get a certain bugfix before the next release of Dynamicweb.Admin.

In the past we had some issues with nuget packages that wasn't retained as they should be, but thats not the case anymore.
You may find some pre-release versions sometimes (e.g. Dynamicweb.Something 1.0.0-Beta) which should be considered "experimental" and those packages will be deleted at some point.

You can read more about installation via packages here:
https://doc.dynamicweb.com/get-started/introduction/installation/installing-dynamicweb#4764

Best regards,
Morten

 
Niklas Malmqvist
Niklas Malmqvist
Reply

Thank you very much Morten for the excellent explanation!

Kind regards,
Niklas

 
Ronnie Poulsen
Ronnie Poulsen
Reply

Hi Morten,

Has this been fixed in the 9.7.4 zip file currently present in the downloads section? I am experiencing this exact same problem, even though I have downloaded the zip file today.

/Ronnie

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Ronnie,

As mentioned above, the fix is not included in version 9.7.4

 

 
Ronnie Poulsen
Ronnie Poulsen
Reply

Hi Morten,

The message was a little ambiguous so I wasn't sure. Do you know when it will be available for download?

/Ronnie

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Ronnie,

"Hotfixes are released on a need-to basis, so there are no fixed release dates."

If there are no critical bugs then it could take weeks.

Since there is a workaround to this issue, I will suggest that you use that...

"If you make sure to either return a PriceRaw instance (or null, if no price can be provided) then the error should go away. Do not call the base class as that will cause infinite recursion."

Otherwise, you can patch your solution by updating the nuget package...

"If you are using nuget packages in your setup then you can already now upgrade to version 1.7.33 of the Dynamicweb.Ecommerce package."

Best regards,
Morten

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Niklas and Ronnie

The problem #72795 regarding Price Provider has been resolved in hotfix 9.7.5

You are able to find this version in the download section

https://doc.dynamicweb.com/downloads/releases

Kind Regards
Dynamicweb Support
Kristian Kirkholt

 
Ronnie Poulsen
Ronnie Poulsen
Reply

Hi Kristian,

Thank you for the heads up :)

/Ronnie

 
Niklas Malmqvist
Niklas Malmqvist
Reply

Hi Kristian,

Thank you for the notice! Will install as soon as I have the chance.

Kind regards,
Niklas

 

You must be logged in to post in the forum