Orchard Cannot access to media file - access is denied - orchardcms

I'm trying to insert picture in Orchard amdin page, but I get an error
An unhandled exception has occurred and the request was terminated. Please refresh the page. If the error persists, go back
The folder could not be created at path: . System.UnauthorizedAccessException: Access to the path 'D:\Projects\MySite.Web\Media\Default' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj) at Contrib.MediaFolder.Services.RemoteStorageProvider.ListFolders(String path)
System.ArgumentException: The folder could not be created at path: . System.UnauthorizedAccessException: Access to the path 'D:\Projects\MySite.Site.Web\Media\Default' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj) at Contrib.MediaFolder.Services.RemoteStorageProvider.ListFolders(String path) at Contrib.MediaFolder.Services.RemoteStorageProvider.ListFolders(String path) at Orchard.Media.Services.MediaService.GetMediaFolders(String relativePath) at Orchard.MediaPicker.Controllers.AdminController.Index(String name, String mediaPath) 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.ControllerActionInvoker.<>c__DisplayClass15.b__12() at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
I have set all permissions for all users (IUSR, SYSTEm, Administartor, Users) to Media folder, but still getting error. Please, help me to resolve this problem. Thanks in advance!

I had the same problem, copying the contents of the media folder to a new folder, deleting the media folder and renaming the new folder to Media and set permissions for IIS_IUSRS, seemingly solved the problem.

Related

Azure Storage Emulator returns 500 internal server error

I have an application that uses Azure Storage, when I have reinstalled the Azure Storage Emulator and Explorer and then run the app, I get this error.
The app was working before I reinstalled.
[WebException: The remote server returned an error: (500) Internal Server Error.]
Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase`1 cmd, Exception ex) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\Common\Shared\Protocol\HttpResponseParsers.Common.cs:54
Microsoft.WindowsAzure.Storage.Blob.<>c__DisplayClass57.<PutBlobImpl>b__56(RESTCommand`1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Blob\CloudBlockBlob.cs:3132
Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse(IAsyncResult getResponseResult) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:300
[StorageException: The remote server returned an error: (500) Internal Server Error.]
Microsoft.WindowsAzure.Storage.Core.Util.StorageAsyncResult`1.End() in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Util\StorageAsyncResult.cs:77
Microsoft.WindowsAzure.Storage.Core.Util.<>c__DisplayClass7.<CreateCallbackVoid>b__5(IAsyncResult ar) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Util\AsyncExtensions.cs:121
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
Microsoft.AspNetCore.DataProtection.AzureStorage.<StoreElementAsync>d__14.MoveNext() +1308
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.AspNetCore.DataProtection.AzureStorage.AzureBlobXmlRepository.StoreElement(XElement element, String friendlyName) +161
Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager.Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.IInternalXmlKeyManager.CreateNewKey(Guid keyId, DateTimeOffset creationDate, DateTimeOffset activationDate, DateTimeOffset expirationDate) +1493
Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager.CreateNewKey(DateTimeOffset activationDate, DateTimeOffset expirationDate) +150
Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider.CreateCacheableKeyRingCore(DateTimeOffset now, IKey keyJustAdded) +645
Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider.Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.ICacheableKeyRingProvider.GetCacheableKeyRing(DateTimeOffset now) +12
Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider.GetCurrentKeyRingCore(DateTime utcNow) +517
Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Protect(Byte[] plaintext) +90
[WebException: The remote server returned an error: (500) Internal
Server Error.]
One of the workaround you may follow to resolve the above issue:
Try to rename the application name with some other name and restart the azure storage emulator(>run AzureStorageEmulator.exe start) and run the application.
Alternatively to resolve with Azure storage explorer please find this SO THREAD as suggested by #Seth .
For more information you can refer this SO THREAD .

How do I generate `.generated.h` files in unreal manually on linux?

When I try to open the project, it says "The following modules are missing or built with a different editor version: <project name> Would you like to rebuild them now? If I click yes it says "<project name> could not be compiled. Try rebuilding from source manually." and quits. This is a new project, has not yet been opened due to this error. (I have tried several times with different templates)
So after researching I tried building manually with GenerateProjectFiles.sh -cmakefile -game -project <project file>, then cmake, then make. At first this didn't work because it was using g++ instead of clang, so I changed it to clang, changed the standard to c++14, and now it almost compiles, but it complains that the .generated.h files do not exist. How do I generate them considering I can't open the editor, don't have Visual Studio, and am working on Linux? I also can't change the install files because I don't have permission (work computer).
GenerateProjectFiles.sh output:
Setting up Unreal Engine 4 project files...
chmod: changing permissions of bin/mcs: Operation not permitted
chmod: changing permissions of bin/xbuild: Operation not permitted
Fixing inconsistent case in filenames.
Setting up Mono
<unreal dir>/Engine/Binaries/ThirdParty/Mono/Linux/lib/mono/xbuild/14.0/bin/Microsoft.Common.targets: error : Access to the path "<unreal dir>/Engine/Source/Programs/DotNETCommon/DotNETUtilities/obj/Development/DotNETUtilities.csproj.FilesWrittenAbsolute.txt" is denied. at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0019e] in <98fac219bd4e453693d76fda7bd96ab0>:0
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) [0x00000] in <98fac219bd4e453693d76fda7bd96ab0>:0
at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
at System.IO.StreamWriter.CreateFile (System.String path, System.Boolean append, System.Boolean checkHost) [0x0001c] in <98fac219bd4e453693d76fda7bd96ab0>:0
at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize, System.Boolean checkHost) [0x00055] in <98fac219bd4e453693d76fda7bd96ab0>:0
at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize) [0x00000] in <98fac219bd4e453693d76fda7bd96ab0>:0
at System.IO.StreamWriter..ctor (System.String path, System.Boolean append) [0x00008] in <98fac219bd4e453693d76fda7bd96ab0>:0
at (wrapper remoting-invoke-with-check) System.IO.StreamWriter..ctor(string,bool)
at Microsoft.Build.Tasks.WriteLinesToFile.Execute () [0x0002e] in <1e06a39ffa2a4ecc9361f5e710a0e7cb>:0
<unreal dir>/Engine/Binaries/ThirdParty/Mono/Linux/lib/mono/xbuild/14.0/bin/Microsoft.Common.targets: error : Access to the path "<unreal dir>/Engine/Source/Programs/UnrealBuildTool/obj/Development/UnrealBuildTool.csproj.FilesWrittenAbsolute.txt" is denied. at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0019e] in <98fac219bd4e453693d76fda7bd96ab0>:0
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) [0x00000] in <98fac219bd4e453693d76fda7bd96ab0>:0
at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
at System.IO.StreamWriter.CreateFile (System.String path, System.Boolean append, System.Boolean checkHost) [0x0001c] in <98fac219bd4e453693d76fda7bd96ab0>:0
at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize, System.Boolean checkHost) [0x00055] in <98fac219bd4e453693d76fda7bd96ab0>:0
at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize) [0x00000] in <98fac219bd4e453693d76fda7bd96ab0>:0
at System.IO.StreamWriter..ctor (System.String path, System.Boolean append) [0x00008] in <98fac219bd4e453693d76fda7bd96ab0>:0
at (wrapper remoting-invoke-with-check) System.IO.StreamWriter..ctor(string,bool)
at Microsoft.Build.Tasks.WriteLinesToFile.Execute () [0x0002e] in <1e06a39ffa2a4ecc9361f5e710a0e7cb>:0
Discovering modules, targets and source code for project...
Generating data for project indexing... 100%
make error:
In file included from <project dir>/Source/MyProject2/MyProject2GameMode.cpp:3:
<project dir>/Source/MyProject2/MyProject2GameMode.h:7:10: fatal error:
'MyProject2GameMode.generated.h' file not found
#include "MyProject2GameMode.generated.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
118 warnings and 1 error generated.
make[2]: *** [CMakeFiles/FakeTarget.dir/Source/MyProject2/MyProject2GameMode.cpp.o] Error 1
make[1]: *** [CMakeFiles/FakeTarget.dir/all] Error 2
make: *** [all] Error 2

Image resizer with azure blob storage. Returns "403 forbidden" when going through the resizer

We have been using image resizer with azurereader2 for quite a while with no problem. After a small release (that really shouldnt have anything to do with this) we suddenly get errors when we try to access the images through the resizer.
This is only a problem on our test environment, the new release and image resizer etc. works just fine in production.
Both production and test is hosted in azure, and both use their own azure blob storage.
example url:
test.mysite.com/images/pim/b6ffa894-bc8f-4f1b-a1e8-ef115b78a56f.jpg?width=250&height=312&format=jpg&scale=both&mode=pad
returns the following error
Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (403) Forbidden. ---> System.Net.WebException: The remote server returned an error: (403) Forbidden.
at Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T](HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase`1 cmd, Exception ex) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\Common\Shared\Protocol\HttpResponseParsers.Common.cs:line 50
at Microsoft.WindowsAzure.Storage.Blob.CloudBlobClient.c__DisplayClass13.b__12(RESTCommand`1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Blob\CloudBlobClient.cs:line 788
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:line 299
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:line 50
at Microsoft.WindowsAzure.Storage.Blob.CloudBlobClient.EndGetBlobReferenceFromServer(IAsyncResult asyncResult) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Blob\CloudBlobClient.cs:line 630
at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.c__DisplayClass1`1.b__0(IAsyncResult ar) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Util\AsyncExtensions.cs:line 66
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ImageResizer.Plugins.AzureReader2.AzureReader2Plugin.d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ImageResizer.Util.AsyncUtils.RunSync[TResult](Func`1 func)
at ImageResizer.Storage.Blob.Open() in C:\projects\resizer\Plugins\ImageResizer.Storage\Blob.cs:line 41
at ImageResizer.ImageBuilder.GetStreamFromSource(Object source, ResizeSettings settings, Boolean& disposeStream, String& path, Boolean& restoreStreamPosition)
at ImageResizer.ImageBuilder.LoadImage(Object source, ResizeSettings settings, Boolean restoreStreamPos)
at ImageResizer.ImageBuilder.BuildJob(ImageJob job)
at ImageResizer.ImageBuilder.Build(ImageJob job)
at ImageResizer.ImageBuilder.Build(Object source, Object dest, ResizeSettings settings, Boolean disposeSource, Boolean addFileExtension)
at ImageResizer.ImageBuilder.Build(Object source, Object dest, ResizeSettings settings, Boolean disposeSource)
at ImageResizer.ImageBuilder.Build(Object source, Object dest, ResizeSettings settings)
at ImageResizer.InterceptModule.c__DisplayClass5_0.b__1(Stream stream)
at ImageResizer.Plugins.DiskCache.CustomDiskCache.c__DisplayClass28_0.b__0()
at ImageResizer.Plugins.DiskCache.LockProvider.TryExecute(String key, Int32 timeoutMs, LockCallback success)
at ImageResizer.Plugins.DiskCache.CustomDiskCache.GetCachedFile(String keyBasis, String extension, ResizeImageDelegate writeCallback, Int32 timeoutMs, Boolean asynchronous)
at ImageResizer.Plugins.DiskCache.DiskCache.Process(IResponseArgs e)
at ImageResizer.Plugins.DiskCache.DiskCache.Process(HttpContext context, IResponseArgs e)
at ImageResizer.InterceptModule.HandleRequest(HttpContext context, HttpModuleRequestAssistant ra, IVirtualFile vf)
at XXX.Web.Modules.CustomImageResizingInterceptModule.HandleRequest(HttpContext context, HttpModuleRequestAssistant ra, IVirtualFile vf) in E:\TeamCity\buildAgent\work\4773e55a378b97a1\src\Portal\Portal\Infrastructure\Web\Modules\CustomImageResizingInterceptModule.cs:line 15
at ImageResizer.InterceptModule.CheckRequest_PostAuthorizeRequest(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Request Information
RequestID:e8c13071-0001-00c2-437e-d8b9c7000000
RequestDate:Mon, 29 May 2017 13:19:16 GMT
StatusMessage:Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
the url
test.mysite.com/images/pim/b6ffa894-bc8f-4f1b-a1e8-ef115b78a56f.jpg correctly redirects to the image in the azure blob.
I have tried regenerating the access key for the blob storage, without any luck.
I have tried pointing to another blob storage from our test env, that does not work either.
I can access the test blob storage just fine from my local environment.
/resizer.debug reports 0 issues detected.
Any help is greatly appreciated, let me know if i can provide additional info.
This is purely a azure blob storage connection problem, image resizer is not the culprit.

Error during deployment to azure from visual studio online

I'm getting this weird error when trying to deploy to azure from visual studio online:
Exception Message: Could not find a part of the path 'd:\a\src'. (type DirectoryNotFoundException)
Exception Stack Trace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileSystemEnumerableIterator`1.CommonInit()
at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
at Microsoft.TeamFoundation.Deployment.Workflow.Activities.FindPackageAndParametersFile.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
I'm pretty sure that I am not using a folder named 'd:\a\src' in my solution.
I was able to fix it by changing the Build Agent Folder to something that involves $(SourceDir).

Error publishing log file TFS2012

I have en problem with TFS2012 after i have install an Visual Studio 2012 on a Microsoft Server 2012. Im gettting this error:
Exception Message: TF270016: An error occurred publishing log files from 'D:\Builds\3_2\MES_Projects\PJDGatewayTester - Main\Sources\Src\LPS_CMData\PJDGatewayTest.log' to '\\Server\Drop\Build\PJDGatewayTester - Main\PJDGatewayTester - Main_.6\logs'. Details: Access to the path '\\server\Drop\Build\PJDGatewayTester - Main\PJDGatewayTester - Main_.6\logs' is denied. (type PublishLogFileException)
Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Inner Exception Details:
Exception Message: Access to the path '\\server\Drop\Build\PJDGatewayTester - Main\PJDGatewayTester - Main_.6\logs' is denied. (type UnauthorizedAccessException)
Exception Stack Trace: 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 Microsoft.TeamFoundation.Common.FileSpec.CopyFile(String oldPath, String newPath, Boolean overwriteExisting)
at Microsoft.TeamFoundation.Build.Workflow.Activities.WindowsDropProvider.CopyDirectory(String sourceDirectory, String targetDirectory)
at Microsoft.TeamFoundation.Build.Workflow.Activities.WindowsDropProvider.CopyDirectory(String sourceDirectory, String targetDirectory, String[] renameIfExists)
at Microsoft.TeamFoundation.Build.Workflow.Activities.PublishLogFile.Execute(CodeActivityContext context)
The workflow instance has been canceled. (Reason: The activity 'Try Compile, Test, and Associate Changesets and Work Items' with ID 12211 threw or propagated an exception while being canceled.)
An error occurred while copying diagnostic activity logs to the drop location. Details: Access to the path '\\server\Drop\Build\PJDGatewayTester - Main\PJDGatewayTester - Main_.6\Logs' is denied.
An error occurred while copying diagnostic activity logs to the drop location. Details: Access to the path '\\server\Drop\Build\PJDGatewayTester - Main\PJDGatewayTester - Main_.6\Logs' is denied.
Looks like you just need to give permissions for your build service account to the drop location.

Resources