madskristensen/VsixGallery

Upload fails after move of project

Closed this issue · 3 comments

Since my repo has moved from https://github.com/tom-englert/ResXResourceManager to https://github.com/dotnet/ResXResourceManager I can't upload my extension any longer.

https://dev.azure.com/tom-englert/Open%20Source/_build/results?buildId=3628&view=logs&j=fd490c07-0b22-5182-fac9-6d67fe1e939b&t=93477e13-d765-5095-a9ee-8e38816a86b7

Upload fails with
-Exception: >System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from 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

Is there any way to fix this?

I rewrote and updated vsixgallery.com. You need the latest .ps1 script. Make sure to always dynamically download the script instead of having a copy of it like this example.

I tried this, but it fails as well. It fails with any .vsix I have tried.
I downloaded the source of the gallery and ran it locally - there it works.

(new-object Net.WebClient).DownloadString("https://raw.github.com/madskristensen/ExtensionScripts/master/AppVeyor/vsix.ps1") | iex

$env:APPVEYOR_REPO_PROVIDER = 'github'
$env:APPVEYOR_REPO_NAME = 'dotnet/ResXResourceManager'

Vsix-PublishToGallery "D:\Develop\My Open Source\Deploy\ResXManager.VSIX.vsix"

looking at the call stack it looks like an SSL issue

System.Net.Sockets.SocketException: An existing connection was fo
rcibly closed by the remote host
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
   at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.ConnectStream.WriteHeaders(Boolean async)
   --- End of inner exception stack trace ---
   at System.Net.WebClient.UploadFile(Uri address, String method, String fileName)
   at System.Net.WebClient.UploadFile(String address, String fileName)

Could fix it by enabling Tls12 in the script