tag:help.appveyor.com,2012-11-13:/discussions/problems/28750-strange-error-when-pushing-logs-through-nukebuild-in-appveyorAppVeyor: Discussion 2021-01-11T07:46:01Ztag:help.appveyor.com,2012-11-13:Comment/489080322020-12-16T08:58:17Z2020-12-16T08:58:17ZStrange error when pushing logs through Nuke.Build in AppVeyor<div><p>We recently started trying to use Nuke.Build to make our build steps scriptable in another way, but we've gotten some strange errors when pushing logs.</p>
<p>What does <code>exit code 2</code> mean when we call <code>appveyor.exe</code>?<br>
AppVeyor Version: 7.0.2942 (on-prem, Team Edition)</p>
<pre>
<code>Application: _build.exe
CoreCLR Version: 4.700.20.47201
.NET Core Version: 3.1.9
Description: The process was terminated due to an unhandled exception.
Exception Info: Nuke.Common.Tooling.ProcessException: Process 'appveyor.exe' exited with code 2.
> "C:\Program Files\AppVeyor\HostAgent\appveyor.exe" AddMessage "B:\Builds\[redacted]-fu0hq6uwi5ix56x3\[redacted]:
warning CS0618: 'IHostingEnvironment' is obsolete: 'This type is obsolete and will be removed in a future version.
The recommended alternative is Microsoft.AspNetCore.Hosting.IWebHostEnvironment.' [B:\Builds\[redacted]-fu0hq6uwi5ix56x3\[redacted]]" -Category Warning -Details ""
@ B:\Builds\[redacted]-fu0hq6uwi5ix56x3
at Nuke.Common.Tooling.ProcessExtensions.AssertZeroExitCode(IProcess process)
at Nuke.Common.Tooling.ToolExecutor.Execute(String arguments, String workingDirectory, IReadOnlyDictionary`2 environmentVariables, Nullable`1 timeout, Nullable`1 logOutput, Nullable`1 logInvocation, Nullable`1 logTimestamp, String logFile, Action`2 customLogger, Func`2 outputFilter)
at Nuke.Common.CI.AppVeyor.AppVeyor.WriteMessage(AppVeyorMessageCategory category, String message, String details)
at Nuke.Common.OutputSinks.OutputSink.WriteAndReportWarning(String text, String details)
at Nuke.Common.Tooling.ProcessTasks.<>c__DisplayClass11_0.<GetOutputCollection>b__1(Object s, DataReceivedEventArgs e)
at System.Diagnostics.AsyncStreamReader.FlushMessageQueue(Boolean rethrowInNewThread)
--- End of stack trace from previous location where exception was thrown ---
at System.Diagnostics.AsyncStreamReader.<>c.<FlushMessageQueue>b__18_0(Object edi)
at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi)
at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action`1 callback, TState& state)
at System.Threading.QueueUserWorkItemCallback.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()</code>
</pre></div>Chris Gårdenbergtag:help.appveyor.com,2012-11-13:Comment/489080322020-12-16T17:43:50Z2020-12-16T17:43:50ZStrange error when pushing logs through Nuke.Build in AppVeyor<div><p>Hi Chris,</p>
<p>Try calling the API with curl and see what's returned: <a href="https://www.appveyor.com/docs/build-worker-api/#add-message">https://www.appveyor.com/docs/build-worker-api/#add-message</a></p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/489080322020-12-17T07:11:46Z2020-12-17T07:11:46ZStrange error when pushing logs through Nuke.Build in AppVeyor<div><p>When we call the API normally it works ok, but we do have some issues when there's a lot of output sometimes. And we can't really catch that error, since it occurs in the Nuke.Build script, and most of the messages outputted that way works fine.</p>
<p>We have multiple simultaneous builds running at the same time, with no problem of outputting to the log.</p>
<p>We've turned off parallel testing and building to see if that would mitigate the issue, but so far our tests haven't worked out that well.</p>
<p>And if we build the project before running the tests, it also works fine, so it could be a edge case scenario where we run <code>dotnet test</code> before having built the project (which should in turn build the project if it needs to)</p>
<p>Is there some way to configure the AppVeyor Hostagent to log input/output to file?</p></div>Chris Gårdenbergtag:help.appveyor.com,2012-11-13:Comment/489080322020-12-18T02:09:35Z2020-12-18T02:09:35ZStrange error when pushing logs through Nuke.Build in AppVeyor<div><p>Could you drop me a link to some of the failing builds please?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/489080322021-01-11T07:46:00Z2021-01-11T07:46:00ZStrange error when pushing logs through Nuke.Build in AppVeyor<div><p>Sorry for the delay, we've been on winter vacation.</p>
<p>I cannot link to the builds as the server is on-prem with internal only access.</p>
<p>I'll ask my coworkers if they have solved the issue themselves while I was away.</p></div>Chris Gårdenberg