appveyor / ci

AppVeyor community support repository
https://www.appveyor.com
344 stars 64 forks source link

AppVeyor MSBuild logger causes MSB4017 on connection close #3161

Open rainersigwald opened 4 years ago

rainersigwald commented 4 years ago

Copied from original issue: microsoft/msbuild#4850 from @jdanekrh on Friday, October 25, 2019 6:11:41 AM

Steps to reproduce

Happened in https://ci.appveyor.com/project/jdanekrh/qpid-proton/builds/28367519

https://github.com/jdanekrh/qpid-proton/commit/0f15affa826ca5d86fbf3bdbcfdddd3f35731549, but the --parallel is irrelevant, the Appveyor build crashed before reaching that.

Command line

msbuild "C:\projects\qpid-proton\BLD\Proton.sln" /m /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"

Expected behavior

Successful build.

Actual behavior


    569 Warning(s)
    0 Error(s)
Time Elapsed 00:02:13.50
MSBUILD : error MSB4017: The build stopped unexpectedly because of an unexpected logger failure.
Microsoft.Build.Exceptions.InternalLoggerException: The build stopped unexpectedly because of an unexpected logger failure. ---> System.Net.WebException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. ---> 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
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   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.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.WebClient.UploadDataInternal(Uri address, String method, Byte[] data, WebRequest& request)
   at System.Net.WebClient.UploadData(Uri address, String method, Byte[] data)
   at System.Net.WebClient.UploadData(String address, String method, Byte[] data)
   at Appveyor.BuildAgent.Api.RestBuildServices.AddCompilationMessage(String message, Nullable`1 category, String details, String fileName, Nullable`1 line, Nullable`1 column, String projectName, String projectFileName)
   at Appveyor.MSBuildLogger.AppveyorLogger.SendCompilationMessage(BuildMessageCategory category, String message, String code, String file, Int32 lineNumber, Int32 columnNumber, Int32 projectId)
   at Appveyor.MSBuildLogger.AppveyorLogger.eventSource_WarningRaised(Object sender, BuildWarningEventArgs e)
   at Microsoft.Build.Evaluation.ProjectCollection.ReusableLogger.WarningRaisedHandler(Object sender, BuildWarningEventArgs e)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseWarningEvent(Object sender, BuildWarningEventArgs buildEvent)
   --- End of inner exception stack trace ---
   at Microsoft.Build.Exceptions.InternalLoggerException.Throw(Exception innerException, BuildEventArgs e, String messageResourceName, Boolean initializationException, String[] messageArgs)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseWarningEvent(Object sender, BuildWarningEventArgs buildEvent)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.Consume(BuildEventArgs buildEvent)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.Consume(BuildEventArgs buildEvent, Int32 sinkId)
   at Microsoft.Build.BackEnd.Logging.EventRedirectorToSink.Microsoft.Build.Framework.IEventRedirector.ForwardEvent(BuildEventArgs buildEvent)
   at Microsoft.Build.BackEnd.Logging.CentralForwardingLogger.EventSource_AnyEventRaised(Object sender, BuildEventArgs buildEvent)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseAnyEvent(Object sender, BuildEventArgs buildEvent)
Command exited with code 1

OS info:

If applicable, version of the tool that invokes MSBuild (Visual Studio, dotnet CLI, etc):

Environment: APPVEYOR_BUILD_WORKER_IMAGE=Visual Studio 2015, CMAKE_GENERATOR=Visual Studio 14 2015,

Copied from original issue: microsoft/msbuild#4850

rainersigwald commented 4 years ago

From @rainersigwald on Friday, October 25, 2019 2:25:51 PM

This is a bug in AppVeyor's custom logger (or the AppVeyor environment, if the logger should be able to reasonably assume that connections are reliable). I'll move this bug to their public issues repo.