Microsoft.WindowsAzure.Storage.StorageException:基础连接已关闭

时间:2018-07-16 03:42:08

标签: umbraco azure-blob-storage

还有其他人经历过吗?看起来该代码无法连接到Azure容器。我检查了容器的运行状况,过去24小时没有任何问题报告。还有什么地方可以看?

2018-07-16 01:41:13,906 [P13036/D2/T1] ERROR Umbraco.Core.UmbracoApplicationBase - An unhandled exception occurred
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.WindowsAzure.Storage.StorageException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: The read operation failed, see inner exception. ---> System.InvalidProgramException: Common Language Runtime detected an invalid program.
   at System.Net.SSPISecureChannelType.DecryptMessage(SafeDeleteContext context, SecurityBufferDescriptor inputOutput, UInt32 sequenceNumber)
   at System.Net.SSPIWrapper.EncryptDecryptHelper(OP op, SSPIInterface SecModule, SafeDeleteContext context, SecurityBuffer[] input, UInt32 sequenceNumber)
   at System.Net.Security.SecureChannel.Decrypt(Byte[] payload, Int32& offset, Int32& count)
   at System.Net.Security._SslStream.ProcessFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security._SslStream.StartFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   --- End of inner exception stack trace ---
   at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.TlsStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:line 695
   --- End of inner exception stack trace ---
   at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:line 604
   at Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer.Create(BlobContainerPublicAccessType accessType, BlobRequestOptions requestOptions, OperationContext operationContext) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Blob\CloudBlobContainer.cs:line 68
   at 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:line 233
   at Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer.CreateIfNotExists(BlobRequestOptions requestOptions, OperationContext operationContext) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Blob\CloudBlobContainer.cs:line 196
   at Our.Umbraco.FileSystemProviders.Azure.AzureFileSystem.CreateContainer(CloudBlobClient cloudBlobClient, String containerName, BlobContainerPublicAccessType accessType)
   at Our.Umbraco.FileSystemProviders.Azure.AzureFileSystem..ctor(String containerName, String rootUrl, String connectionString, Int32 maxDays, Boolean useDefaultRoute, BlobContainerPublicAccessType accessType)
   at Our.Umbraco.FileSystemProviders.Azure.AzureFileSystem.GetInstance(String containerName, String rootUrl, String connectionString, String maxDays, String useDefaultRoute, String usePrivateContainer)
   at Our.Umbraco.FileSystemProviders.Azure.AzureBlobFileSystem..ctor(String containerName, String rootUrl, String connectionString, String maxDays, String useDefaultRoute)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Umbraco.Core.IO.FileSystemProviderManager.GetUnderlyingFileSystemNoCache(String alias, Func`1 fallback)
   at Umbraco.Core.IO.FileSystemProviderManager.<>c__DisplayClass56_0`1.<GetFileSystemProvider>b__0(String _)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Umbraco.Core.IO.FileSystemProviderManager.GetFileSystemProvider[TFileSystem](Func`1 fallback)
   at Umbraco.Core.IO.FileSystemProviderManager.CreateWellKnownFileSystems()
   at Umbraco.Core.IO.FileSystemProviderManager..ctor()
   at Umbraco.Core.IO.FileSystemProviderManager.get_Current()
   at Umbraco.Core.Services.MediaService..ctor(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IEventMessagesFactory eventMessagesFactory, IDataTypeService dataTypeService, IUserService userService)
   at Umbraco.Core.Services.ServiceContext.<>c__DisplayClass34_0.<BuildServiceCache>b__12()
   at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
   at System.Lazy`1.get_Value()
   at Umbraco.Web.Models.Mapping.MediaModelMapper.<>c__DisplayClass0_0.<ConfigureMappings>b__9(IMemberConfigurationExpression`1 expression)
   at AutoMapper.MappingExpression`2.ForDestinationMember(IMemberAccessor destinationProperty, Action`1 memberOptions) in c:\dev\AutoMapper\src\AutoMapper\Internal\MappingExpression.cs:line 542
   at AutoMapper.MappingExpression`2.ForMember(Expression`1 destinationMember, Action`1 memberOptions) in c:\dev\AutoMapper\src\AutoMapper\Internal\MappingExpression.cs:line 183
   at Umbraco.Web.Models.Mapping.MediaModelMapper.ConfigureMappings(IConfiguration config, ApplicationContext applicationContext)
   at Umbraco.Core.CoreBootManager.<InitializeModelMappers>b__32_0(IConfiguration configuration)
   at AutoMapper.Mapper.Initialize(Action`1 action) in c:\dev\AutoMapper\src\AutoMapper\Mapper.cs:line 237
   at Umbraco.Core.CoreBootManager.InitializeModelMappers()
   at Umbraco.Core.CoreBootManager.Initialize()
   at Umbraco.Web.WebBootManager.Initialize()
   at Umbraco.Core.UmbracoApplicationBase.StartApplication(Object sender, EventArgs e)
   at Umbraco.Core.UmbracoApplicationBase.Application_Start(Object sender, EventArgs e)

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,其中任何HttpClient调用(在C#中)在Azure中都因上述错误而开始失败。 在没有更改Azure或WebApp的任何内容的情况下开始发生这种情况。

将应用程序从32bit更改为64bit可以解决此问题。

  • 转到Azure门户
  • 选择您的应用服务
  • 转到设置下的“应用程序设置”
  • 将平台从32位更改为64位
  • 这可能会自动重启Web服务,但是我也手动完成了

我正在等待Azure对更改的正式答复。