Application Access error due to nop-template

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
ver: 4.0

Hi,

We are using Nop-template along with its many plugins. We have found errors and due to that application crashes. I found following in the log file:
----
Application startup exception: System.Exception: Plugin 'Seven Spikes Core'. Access to the path 'C:\HostedApps\site_v4\Plugins\bin\SevenSpikes.Nop.Plugins.Core.dll' is denied.
Access to the path 'C:\HostedApps\site_v4\Plugins\bin\SevenSpikes.Nop.Plugins.Core.dll' is denied.
---> System.Exception: Plugin 'Seven Spikes Core'. Access to the path 'C:\HostedApps\site_v4\Plugins\bin\SevenSpikes.Nop.Plugins.Core.dll' is denied. ---> System.UnauthorizedAccessException: Access to the path 'C:\HostedApps\site_v4\Plugins\bin\SevenSpikes.Nop.Plugins.Core.dll' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalDelete(String path, Boolean checkHost)
   at System.IO.File.Delete(String path)
   at Nop.Core.Plugins.PluginManager.ShadowCopyFile(FileInfo plug, DirectoryInfo shadowCopyPlugFolder)
   at Nop.Core.Plugins.PluginManager.PerformFileDeploy(FileInfo plug, ApplicationPartManager applicationPartManager, NopConfig config)
   at Nop.Core.Plugins.PluginManager.Initialize(ApplicationPartManager applicationPartManager, NopConfig config)
   --- End of inner exception stack trace ---
   at Nop.Core.Plugins.PluginManager.Initialize(ApplicationPartManager applicationPartManager, NopConfig config)
   --- End of inner exception stack trace ---
   at Nop.Core.Plugins.PluginManager.Initialize(ApplicationPartManager applicationPartManager, NopConfig config)
   at Nop.Core.Infrastructure.NopEngine.Initialize(IServiceCollection services)
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, IConfigurationRoot configuration)
   at Nop.Web.Startup.ConfigureServices(IServiceCollection services)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
crit: Microsoft.AspNetCore.Hosting.Internal.WebHost[6]
      Application startup exception


----

We have got resolution from their support saying that its a problem with nopcommerce itself.

Reply:
----------
This is a known issue with nopCommerce 4.00. NopCommerce makes shadow copies of the plugins' .dll files that it uses. Those .dll files should get deleted on application pool recycle but sometimes are getting locked by the system throwing errors like this.
The only workaround this issue is to disable the overlapped recycle of the application pool your nopCommerce app is using. This can be done by checking the Disable Overlapped Recycle setting in the application pool settings.
------

My Question is may be from the nop Commerce team as well that is it true? is it nopcommerce issue? because no other plugin gives this error in log file.

Thanks for your time.
5 years ago
Yes,

This error seems to Shadow copy issue with default v4.

To fix look at timmit answare at below link.

It's application pool recycle issue.

https://www.nopcommerce.com/boards/t/49851/serious-iis-application-pool-recycling-bugdesign-flaw.aspx?p=3#199596

Hope you will understand..!!
5 years ago
Hi

I am having the exact same issue.
Its not when i use Visual Studio, but runing production on a Windows 2016 server.
Its not fixed by changing the app pool settings.

Somehow it seems that Nop is locking plugin dlls.
My problems occurs when reloading plugin list or uninstalling plugins.
5 years ago
Hello,

The reply you've posted in your post was actually made by me.
I am not sure if I've written that at the time of our conversation but this issue does not appear only with our products. You see the Seven Spikes Core plugin name in the error just because the plugin is the first one to load and to throw the error. If you remove our products from your store you will still get the error but it will be for a different plugin.

It is not the plugin's fault but rather how nopCommerce loads the plugin .dll files that's causing the issue.

Hope that clarifies things a bit!

Regards,
Anton
4 years ago
I am getting the same issue even in v4.1, application fails to auto restart, it works if I restart IIS, Is there any solution?

Application startup exception: System.Exception: Plugin 'Seven Spikes Core'. Access to the path '--\Plugins\bin\SevenSpikes.Nop.Plugins.Core.dll' is denied.
Access to the path '--\Plugins\bin\SevenSpikes.Nop.Plugins.Core.dll' is denied.
---> System.Exception: Plugin 'Seven Spikes Core'. Access to the path '--\Plugins\bin\SevenSpikes.Nop.Plugins.Core.dll' is denied. ---> System.UnauthorizedAccessException: Access to the path 'xxx\Plugins\bin\SevenSpikes.Nop.Plugins.Core.dll' is denied.
   at System.IO.FileSystem.DeleteFile(String fullPath)
   at System.IO.File.Delete(String path)
   at Nop.Core.Infrastructure.NopFileProvider.DeleteFile(String filePath)
   at Nop.Core.Plugins.PluginManager.ShadowCopyFile(String pluginFilePath, String shadowCopyPlugFolder)
   at Nop.Core.Plugins.PluginManager.PerformFileDeploy(String plug, ApplicationPartManager applicationPartManager, NopConfig config, String shadowCopyPath)
   at Nop.Core.Plugins.PluginManager.Initialize(ApplicationPartManager applicationPartManager, NopConfig config)
   --- End of inner exception stack trace ---
   at Nop.Core.Plugins.PluginManager.Initialize(ApplicationPartManager applicationPartManager, NopConfig config)
   --- End of inner exception stack trace ---
   at Nop.Core.Plugins.PluginManager.Initialize(ApplicationPartManager applicationPartManager, NopConfig config)
   at Nop.Core.Infrastructure.NopEngine.Initialize(IServiceCollection services)
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, IConfiguration configuration)
   at Nop.Web.Startup.ConfigureServices(IServiceCollection services)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.