System.OutOfMemoryException when adding a product picture

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 anos atrás
I am working on transitioning a friend's site to Nop 3.8 and everything has been working properly until today. We have it hosted remotely and I can't replicate the issue locally. When I try to upload a picture to add to a product, I get the "Upload failed" message in red. Viewing the system log, I see "Exception of type 'System.OutOfMemoryException' was thrown."

I've tried Recycling the App Pool, Clearing the Cache, Restarting the Application, Restarting the server, and fiddling with the IIS settings.

The full stack trace is:
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) at ImageResizer.Configuration.PluginConfig.FindPluginType(String searchName) at ImageResizer.Configuration.PluginConfig.add_plugin_by_name(String name, NameValueCollection args) at ImageResizer.Configuration.PluginConfig.loadPluginsInternal() at ImageResizer.Configuration.PluginConfig.LoadPlugins() at ImageResizer.Configuration.Config.get_Current() at Nop.Services.Media.PictureService.ValidatePicture(Byte[] pictureBinary, String mimeType) at Nop.Services.Media.PictureService.InsertPicture(Byte[] pictureBinary, String mimeType, String seoFilename, String altAttribute, String titleAttribute, Boolean isNew, Boolean validateBinary) at Nop.Admin.Controllers.PictureController.AsyncUpload() at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
7 anos atrás
1) How large is the image?
2) What kind of hosting is used? (shared / VPS? max memory allocated?)
3) Any other plugins installed on remote that is not installed on local?
7 anos atrás
Hi Lam,

Thanks for responding. Here are the answers to your questions:

1. The image is 14kb (we have uploaded over 800 before this)
2. It's a shared AWS EC2 Instance - t2.medium (4GB Ram)
3. No

I checked the resources on the server and the memory is at 59%. SQL and IIS are taking up most of the memory.

Thanks
7 anos atrás
Is there any write access issue?
7 anos atrás
No, there shouldn't be. I just checked and IIS_IUSRS has full control over the publish directory
7 anos atrás
So when you say you "transitioned the site to 3.80", what did you do? Did you do any custom coding that may result in memory leak? :)
7 anos atrás
The current site is in PHP. I migrated the data and styles. The only customization I did was create my own theme.
7 anos atrás
RE:" t2.medium (4GB Ram)"
4GB is not a lot of RAM.  Are you hosting both IIS and the SQL Server in the same?
7 anos atrás
Yes, it hosts both. From a cost perspective it made more sense than to have a separate RDS instance.

I'm going to roll back my code to a few days ago and have my CI migrate it. If it still fails, I guess I'm going to have to look at getting a larger instance.
7 anos atrás
After rolling back, seeing images upload correctly, and rolling forward, I narrowed it down to my latest revision where I included the Redirect plugin (https://www.nopcommerce.com/p/1044/301-page-redirect.aspx) for an SEO team to redirect the current site URLs. I'm not sure why that would cause it but at least it's working now. Thanks guys!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.