Strange error when pushing logs through Nuke.Build in AppVeyor
This discussion is public.
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.
What does exit code 2
mean when we call appveyor.exe
?
AppVeyor Version: 7.0.2942 (on-prem, Team Edition)
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()
Support Staff 1
Feodor Fitsner
on 16 Dec, 2020 05:43 PM
Hi Chris,
Try calling the API with curl and see what's returned: https://www.appveyor.com/docs/build-worker-api/#add-message
2
Chris Gårdenberg
on 17 Dec, 2020 07:11 AM
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.
We have multiple simultaneous builds running at the same time, with no problem of outputting to the log.
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.
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
dotnet test
before having built the project (which should in turn build the project if it needs to)Is there some way to configure the AppVeyor Hostagent to log input/output to file?
Support Staff 3
Feodor Fitsner
on 18 Dec, 2020 02:09 AM
Could you drop me a link to some of the failing builds please?
4
Chris Gårdenberg
on 11 Jan, 2021 07:46 AM
Sorry for the delay, we've been on winter vacation.
I cannot link to the builds as the server is on-prem with internal only access.
I'll ask my coworkers if they have solved the issue themselves while I was away.