media library no thumbs can't upload

Topics: General, Troubleshooting
Mar 24, 2014 at 8:15 PM
Edited Mar 24, 2014 at 8:42 PM
I was updating to a new build of the 1.x branch and have totally messed up my media library.
I now have no thumbnails and am unable to upload files (all .png images). All of my images still exist and are accessible via image editor. When trying upload via media storage I get the following error


Oops. Something went wrong ... sorry

An unhandled exception has occurred and the request was terminated. Please refresh the page. If the error persists, go back

Access to the path \Media\Default\CREE\cree 3-24-14 11 am 2.png' is denied.

System.UnauthorizedAccessException: Access to the path \Media\Default\CREE\cree 3-24-14 11 am 2.png' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at 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) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.File.InternalWriteAllBytes(String path, Byte[] bytes, Boolean checkHost) at System.IO.File.WriteAllBytes(String path, Byte[] bytes) at Orchard.FileSystems.Media.FileSystemStorageProvider.CreateFile(String path) at Orchard.FileSystems.Media.FileSystemStorageProvider.SaveStream(String path, Stream inputStream) at Orchard.Media.Services.MediaService.UploadMediaFile(String folderPath, String fileName, Stream inputStream, Boolean extractZip) at Orchard.Media.Services.MediaService.UploadMediaFile(String folderPath, HttpPostedFileBase postedFile, Boolean extractZip) at Orchard.Media.Controllers.AdminController.Add() at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.<InvokeActionMethodFilterAsynchronouslyRecursive>b__41() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.<InvokeActionMethodFilterAsynchronouslyRecursive>b__41() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.<InvokeActionMethodFilterAsynchronouslyRecursive>b__41()

edit:
Looking at the log file there is an entry suck as this for each image

/Admin/Orchard.MediaLibrary/MediaItems?folderPath=&skip=0&count=20&order=created&mediaType=&_=1395687912997
System.UnauthorizedAccessException: Access to the path \Media\Default_Profiles\1338a03e\89fadf9a' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
at System.IO.Directory.CreateDirectory(String path)
at Orchard.FileSystems.Media.FileSystemStorageProvider.CreateFile(String path)
at Orchard.MediaProcessing.Media.StorageProviderExtensions.OpenOrCreate(IStorageProvider storageProvider, String path)
at Orchard.MediaProcessing.Services.ImageProfileManager.GetImageProfileUrl(String path, String profileName, FilterRecord customFilter, ContentItem contentItem)
at Orchard.MediaProcessing.Shapes.MediaShapes.MediaUrl(Object Shape, Object Display, TextWriter Output, String Profile, String Path, ContentItem ContentItem, FilterRecord CustomFilter)

and for the attempt to add media

path '\Media\Default\CREE\cree 3-24-14 11 am 2.png' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at 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)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.File.InternalWriteAllBytes(String path, Byte[] bytes, Boolean checkHost)
at System.IO.File.WriteAllBytes(String path, Byte[] bytes)
at Orchard.FileSystems.Media.FileSystemStorageProvider.CreateFile(String path)
at Orchard.FileSystems.Media.FileSystemStorageProvider.SaveStream(String path, Stream inputStream)
at Orchard.Media.Services.MediaService.UploadMediaFile(String folderPath, String fileName, Stream inputStream, Boolean extractZip)
at Orchard.Media.Services.MediaService.UploadMediaFile(String folderPath, HttpPostedFileBase postedFile, Boolean extractZip)
at Orchard.Media.Controllers.AdminController.Add()
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 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(I

Sorry for the lengthy post

Is there anyway to rebuild the thumbnails or otherwise fix this? If I delete all the images and start from scratch would that help at this point there are only 30-40 images so its not out the question.

Any help or pointers will be greatly appreciated.

Thanks in advance
Mar 25, 2014 at 12:08 AM
Edited Mar 25, 2014 at 12:08 AM
This is a file system permissions problem. You need to change permissions to the media folder on your hosting settings.
Mar 25, 2014 at 12:24 AM
Thanks! that solved the second problem although I don't know how the permissions got changed.

Do you know if there is any way to have the thumbnails recreated or indexed or .... I'm not clear on how all the pieces fit together.

Thanks again.
Mar 25, 2014 at 1:11 AM
The images are content items, probably you lost something when doing the upgrade. Maybe there are breaking changes, so when version 1.8 is released there will be an upgrade utility.The branch 1.X isnt stable, you could try the 1.7.x branch, because from what understand the 1.7.x only has bugfixes since version 1.7.2.
hope it helps.
Coordinator
Mar 25, 2014 at 11:59 PM
The 1.x is very stable. When you install it don't forget to enable the Upgrade module and go though the upgrade steps for 1.8
Mar 26, 2014 at 1:42 AM
sebastienros wrote:
The 1.x is very stable. When you install it don't forget to enable the Upgrade module and go though the upgrade steps for 1.8
Hi Sebastien, do you mean stable for production?
Coordinator
Mar 26, 2014 at 1:56 AM
Yes, I would recommend using it.
Mar 26, 2014 at 2:05 AM
Thank´s Sebastien,
I´m building a website for a customer, and i´m going to follow you advice.