November Happy Hour will be moved to Thursday December 5th.

Exception thrown on startup if connected to a read-only blob storage

Found in

EPiServer.Azure 9.4.0

Fixed in

EPiServer.Azure 9.4.2

(Or a related package)

Created

Jan 25, 2018

Updated

Feb 12, 2018

Area

CMS Core

State

Closed, Fixed and tested


Description

When an Alloy site on CMS 11.3 is setup in a DXC environment with failover, the failover instance is throwing an exception because it tries to write to a read-only blob replica.

Note: Caused by breaking change in NuGet dependency WindowsAzure.Storage 8.x.

Exception

Server Error in '/' Application.
The remote server returned an error: (403) Forbidden.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The remote server returned an error: (403) Forbidden.

Stack Trace:

[WebException: The remote server returned an error: (403) Forbidden.]
System.Net.HttpWebRequest.GetResponse() +2452
Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync(RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:677

[StorageException: The remote server returned an error: (403) Forbidden.]
Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync(RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:604
Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer.CreateIfNotExists(BlobContainerPublicAccessType accessType, BlobRequestOptions requestOptions, OperationContext operationContext) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Blob\CloudBlobContainer.cs:233
EPiServer.Azure.Blobs.DefaultAzureBlobContainer.CreateIfNotExist() +281
System.Threading.Tasks.Task.Execute() +73

[AggregateException: One or more errors occurred.]
System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken) +1307
System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout) +45
System.Threading.Tasks.Task.WaitAll(Task[] tasks) +28

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +221
System.Delegate.DynamicInvokeImpl(Object[] args) +160
EPiServer.Framework.Initialization.InitializationEngine.OnInitComplete() +320
EPiServer.Framework.Initialization.InitializationEngine.ExecuteTransition(Boolean continueTransitions) +232
EPiServer.Framework.Initialization.InitializationModule.EngineExecute(HostType hostType, Action`1 engineAction) +420
EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +167
EPiServer.Global..ctor() +83
ASP.global_asax..ctor() +10

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +197
System.Activator.CreateInstance(Type type, Boolean nonPublic) +114
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1514
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +300
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +27
System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +80
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +225
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +318

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +405
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +113
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +604