Serious IIS Application Pool recycling bug/design flaw

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Just open a ticket with them ?
6 years ago
oliIntraz wrote:
Hi all, I am also having the same problem, as soon as I copy the Shop All template from nop-templates.com to the plugins folder and reload the list of plugins in nopCommerce admin I get a 502.5 error. The error message in stdout log is:
------------------------------------------------------------------------------
Application startup exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at <PrivateImplementationDetails>{B12874A5-5A3C-4B74-A65B-504AE7B906C1}.F4819236-3A5D-4A20-9531-ECB331A264E3.(Int32 , Int32 , Int32 )
   at <PrivateImplementationDetails>{B12874A5-5A3C-4B74-A65B-504AE7B906C1}.F4819236-3A5D-4A20-9531-ECB331A264E3.b()
   at SevenSpikes.Nop.Plugins.Core.Infrastructure.DependencyRegistrar..ctor()


Hi guys,

The AccessViolationException issue turned out to be caused by an option ii the obfuscation tool that we are using.
The issue used to occur only in some Azure sites and ONLY AFTER you implement the fix explained in the initial post in this thread (disabling overlapped recycle).
We have already removed this obfuscation option (we still obfuscate our assemblies as we have always done) and now everything works normally on these Azure websites.
So for those of you that ever have this error above (AccessViolationException) please simply download the latest version of your product from our website and update the plugins' dll files.

p.s: Many thanks to mgustafsson for assisting us for reproducing it on their Azure website.

Thanks,
Boyko
6 years ago
shinagawaintelligence wrote:
Just open a ticket with them ?


Hi shinagawaintelligence,

No need to open a ticket. Simply download and update your product as explained above.

Thanks,
Boyko
6 years ago
Now our production site in Azure went down again.

Application startup exception: System.Exception: Plugin 'Seven Spikes Core'. Could not load file or assembly 'SevenSpikes.Nop.Plugins.Core.dll' or one of its dependencies. The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)
Could not load file or assembly 'SevenSpikes.Nop.Plugins.Core.dll' or one of its dependencies.

Overlapped recycle is disabled, this is what applicationhost.config looks like (SITE_NAME is replaced):

<system.applicationHost>
    <applicationPools>
      <add name="SITE_NAME" managedRuntimeVersion="v4.0">
        <processModel identityType="ApplicationPoolIdentity" />
        <recycling disallowOverlappingRotation="true" />
      </add>
      <add name="~1SITE_NAME" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated">
        <processModel identityType="ApplicationPoolIdentity" />
        <recycling disallowOverlappingRotation="true" />
      </add>
    </applicationPools>

Anyone any ideas?

Also why is this not patch fixed in v4.0? I can't think of any better reason to release a patch fix.
6 years ago
Did you download and install the most recent nop templates binary? It was patched. Check the last 3 posts
6 years ago
shinagawaintelligence wrote:
Did you download and install the most recent nop templates binary? It was patched. Check the last 3 posts


Yes, I did.
6 years ago
mgustafsson wrote:
Now our production site in Azure went down again.

Application startup exception: System.Exception: Plugin 'Seven Spikes Core'. Could not load file or assembly 'SevenSpikes.Nop.Plugins.Core.dll' or one of its dependencies. The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)
Could not load file or assembly 'SevenSpikes.Nop.Plugins.Core.dll' or one of its dependencies.

Overlapped recycle is disabled, this is what applicationhost.config looks like (SITE_NAME is replaced):

<system.applicationHost>
    <applicationPools>
      <add name="SITE_NAME" managedRuntimeVersion="v4.0">
        <processModel identityType="ApplicationPoolIdentity" />
        <recycling disallowOverlappingRotation="true" />
      </add>
      <add name="~1SITE_NAME" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated">
        <processModel identityType="ApplicationPoolIdentity" />
        <recycling disallowOverlappingRotation="true" />
      </add>
    </applicationPools>

Anyone any ideas?

Also why is this not patch fixed in v4.0? I can't think of any better reason to release a patch fix.


Hi mgustafsson,

This seems to be the initial issue described here. The fix we did in our plugins is for the AccessViolationException, which you no longer get, right?
This file locking issue "The process cannot access the file because it is being used by another process." needs to be resolved in nopCommerce in general and the suggested fix with the Disallow Overlapping is the only way to resolve it for now (at least most people having this issue had it resolved like this).
There was a fix provided by nopCommerce team but after we applied it in 4.00 it still didn't fix the problem (see this post) so for us the only working solution is Disallow Overlapping.

Thanks,
Boyko
6 years ago
for all the people who have installed from azure,
what is the best practice to fix this?

can someone PLEASE put some urgency on this?


Do I really have to start my own repository and tell all these clients to move to my repository?

I want to spend my time coding other stuff.


COME ON.

So far, my team has been an advocate and evangelist for nopcommerce but the way this issue is being handled, its making it hard for me to be enthusiastic.

WHY NOT TAKE THE FIX AND PUSH IT TO THE AZURE BRANCH????????
6 years ago
shinagawaintelligence wrote:
for all the people who have installed from azure,
what is the best practice to fix this?

can someone PLEASE put some urgency on this?


Do I really have to start my own repository and tell all these clients to move to my repository?

I want to spend my time coding other stuff.


COME ON.

So far, my team has been an advocate and evangelist for nopcommerce but the way this issue is being handled, its making it hard for me to be enthusiastic.

WHY NOT TAKE THE FIX AND PUSH IT TO THE AZURE BRANCH????????


Download Nop 4.0 source
Replace PluginManager.cs code with this - https://pastebin.com/RABL78sb
Build in release mode
Copy Nop.Core.dll to all affected websites
Delete the Plugins/bin folder (where the shadow copy dlls used to preside)

Won't take you more than 30 minutes. Nop Team don't give a shit, there's no patch coming.

I've been using this fix in production for a very long time without issue.
6 years ago
Thank you!
It's time to go to work finally.
Beer on me when we cross paths
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.