我有一个Powershell脚本,该脚本在Windows Server核心容器上运行时失败。我们认为,正在上传的文件的文件大小会导致错误。命令是:
Set-AzureStorageFileContent -ShareName $ShareName -Source $Source -Path $Path -Force -Context $ctx -WhatIf:$false
容器基本图片为:
FROM microsoft/windowsservercore:1803
错误是:
2018-11-26T11:22:23.7734465Z ##[debug]Exception:
2018-11-26T11:22:23.7790483Z ##
[debug]Microsoft.WindowsAzure.Storage.StorageException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. ---> System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
2018-11-26T11:22:23.7800575Z ##[debug] at System.Net.Sockets.Socket.EndSend(IAsyncResult asyncResult)
2018-11-26T11:22:23.7810276Z ##[debug] at System.Net.Sockets.NetworkStream.EndWrite(IAsyncResult asyncResult)
2018-11-26T11:22:23.7819765Z ##[debug] --- End of inner exception stack trace ---
2018-11-26T11:22:23.7828945Z ##[debug] at System.Net.ConnectStream.EndWrite(IAsyncResult asyncResult)
2018-11-26T11:22:23.7839200Z ##[debug] at System.IO.Stream.<>c.<BeginEndWriteAsync>b__53_1(Stream stream, IAsyncResult asyncResult)
2018-11-26T11:22:23.7850124Z ##[debug] at System.Threading.Tasks.TaskFactory`1.FromAsyncTrimPromise`1.Complete(TInstance thisRef, Func`3 endMethod, IAsyncResult asyncResult, Boolean requiresSynchronization)
2018-11-26T11:22:23.7859409Z ##[debug]--- End of stack trace from previous location where exception was thrown ---
2018-11-26T11:22:23.7869271Z ##[debug] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2018-11-26T11:22:23.7880375Z ##[debug] at Microsoft.WindowsAzure.Storage.Core.Util.AsyncStreamCopier`1.<StartCopyStreamAsyncHelper>d__8.MoveNext()
2018-11-26T11:22:23.7890517Z ##[debug]--- End of stack trace from previous location where exception was thrown ---
2018-11-26T11:22:23.7901153Z ##[debug] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2018-11-26T11:22:23.7911931Z ##[debug] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2018-11-26T11:22:23.7923259Z ##[debug] at Microsoft.WindowsAzure.Storage.Core.Util.AsyncStreamCopier`1.<StartCopyStreamAsync>d__4.MoveNext()
2018-11-26T11:22:23.7931632Z ##[debug] --- End of inner exception stack trace ---
2018-11-26T11:22:23.7941107Z ##[debug] at Microsoft.WindowsAzure.Commands.Storage.Common.DataMovementTransferHelper.<DoTransfer>d__0.MoveNext()
2018-11-26T11:22:23.7950056Z ##[debug]--- End of stack trace from previous location where exception was thrown ---
2018-11-26T11:22:23.7960169Z ##[debug] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2018-11-26T11:22:23.7969672Z ##[debug] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2018-11-26T11:22:23.7979590Z ##[debug] at Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet.SetAzureStorageFileContent.<>c__DisplayClass24_0.<<ExecuteCmdlet>b__0>d.MoveNext()
2018-11-26T11:22:23.7989849Z ##[debug]--- End of stack trace from previous location where exception was thrown ---
2018-11-26T11:22:23.8000359Z ##[debug] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2018-11-26T11:22:23.8010436Z ##[debug] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2018-11-26T11:22:23.8019959Z ##[debug] at Microsoft.WindowsAzure.Commands.Storage.Common.LimitedConcurrencyTaskScheduler.<RunConcurrentTask>d__26.MoveNext()
是否有增加文件大小限制的方法?我们尝试将-ServerTimeoutPerRequest和-ClientTimeoutPerRequest开关添加到Set-AzureStorageFileContent中,而没有任何更改或影响。