Missing images / Need to regenerate

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 yıl önce
Hi,

How do I go about forcing nopCommerce to regenerate the thumbnail images?

I'm running into an issue where if a user tries adding items to the shopping cart, it crashes the site with the following error:

[UnauthorizedAccessException: Access to the path '\\WDP\DFS\30\7\3\8\3097082837\user\sites\6529815.site\www\content\images\thumbs\0000147_round-cage-lock-78mm_80.jpeg' is denied.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +12597271
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +738
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +68
   System.IO.File.InternalWriteAllBytes(String path, Byte[] bytes, Boolean checkHost) +82
   System.IO.File.WriteAllBytes(String path, Byte[] bytes) +39
   Nop.Services.Media.PictureService.SaveThumb(String thumbFilePath, String thumbFileName, String mimeType, Byte[] binary) in E:\nopCommerce\sources\src\Libraries\Nop.Services\Media\PictureService.cs:330
   Nop.Services.Media.PictureService.GetPictureUrl(Picture picture, Int32 targetSize, Boolean showDefaultPicture, String storeLocation, PictureType defaultPictureType) in E:\nopCommerce\sources\src\Libraries\Nop.Services\Media\PictureService.cs:563
   Nop.Web.Factories.<>c__DisplayClass44_0.<PrepareCartItemPictureModel>b__0() in E:\nopCommerce\sources\src\Presentation\Nop.Web\Factories\ShoppingCartModelFactory.cs:761
   Nop.Core.Caching.CacheExtensions.Get(ICacheManager cacheManager, String key, Int32 cacheTime, Func`1 acquire) in E:\nopCommerce\sources\src\Libraries\Nop.Core\Caching\Extensions.cs:42
   Nop.Web.Factories.ShoppingCartModelFactory.PrepareCartItemPictureModel(ShoppingCartItem sci, Int32 pictureSize, Boolean showDefaultPicture, String productName) in E:\nopCommerce\sources\src\Presentation\Nop.Web\Factories\ShoppingCartModelFactory.cs:754
   Nop.Web.Factories.ShoppingCartModelFactory.PrepareShoppingCartItemModel(IList`1 cart, ShoppingCartItem sci) in E:\nopCommerce\sources\src\Presentation\Nop.Web\Factories\ShoppingCartModelFactory.cs:503
   Nop.Web.Factories.ShoppingCartModelFactory.PrepareShoppingCartModel(ShoppingCartModel model, IList`1 cart, Boolean isEditable, Boolean validateCheckoutAttributes, Boolean prepareEstimateShippingIfEnabled, Boolean setEstimateShippingDefaultAddress, Boolean prepareAndDisplayOrderReviewData) in E:\nopCommerce\sources\src\Presentation\Nop.Web\Factories\ShoppingCartModelFactory.cs:849
   Nop.Web.Controllers.ShoppingCartController.Cart() in E:\nopCommerce\sources\src\Presentation\Nop.Web\Controllers\ShoppingCartController.cs:1257
   lambda_method(Closure , ControllerBase , Object[] ) +65
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +157
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
   System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +22
   System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +34
   System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +50
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +228
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +228
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +228
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +228
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +228
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +228
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +228
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +228
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +228
   System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34
   System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +26
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +38
   System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +22
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +28
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9848873
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +50
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +163

It seems this is due to the image not being present at all in the thumbs folder. If I add the offending image back into the folder, it will resolve the issue.

The only problem being, I don't know what images might be missing, and since nopCommerce generates these with different sizing and naming, I wouldn't be able to go into this folder and just create them manually (correct me if I'm wrong on this).

So how do I go about making nopCommerce regenerate the images?

I currently have installed nopCommerce 3.9 on our hosting provider.
4 yıl önce
If image is not available in thumbs folder then system should create that instantly. Make sure full control of that folder is given to IIS_IUSRS.
4 yıl önce
Give correct folder permission (with write access) for the folder www\content\images\thumbs


This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.