Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem on build server: No process is on the other end of the pipe #197

Closed
Megadesty opened this issue Jul 24, 2018 · 7 comments
Closed

Comments

@Megadesty
Copy link

Megadesty commented Jul 24, 2018

I'm using Nerdbank.GitVersioning 2.1.65 in a project building on an on-premise VSTS build server (Windows Server 2012R2) with agent version 2.131.0 and dotnet SDK 2.1.301.

I encountered a strange problem for the second time. It seems that it pops up every couple of days. Out of a sudden, a build which was green a minute ago, is now (reproducable) red with the follwing error message. Restarting the build agent does not help, but restarting the server does help. I have no clue what's going wrong here, any ideas?

2018-07-24T08:34:04.4032677Z [command]"C:\Program Files\dotnet\dotnet.exe" build D:\tfs_agent_1\_work\10\s\MyProject\MyProject.csproj -c release --no-restore --verbosity normal
2018-07-24T08:34:04.7517834Z Microsoft (R) Build Engine version 15.7.179.6572 for .NET Core
2018-07-24T08:34:04.7518610Z Copyright (C) Microsoft Corporation. All rights reserved.
2018-07-24T08:34:04.7518713Z 
2018-07-24T08:34:04.8232652Z Build started 7/24/2018 10:34:04 AM.
2018-07-24T08:34:05.1736293Z      1>Project "D:\tfs_agent_1\_work\10\s\MyProject\MyProject.csproj" on node 1 (Build target(s)).
2018-07-24T08:34:05.1736865Z      1>PrepareForBuild:
2018-07-24T08:34:05.1737127Z          Creating directory "bin\release\net461\".
2018-07-24T08:34:05.1741826Z          Creating directory "obj\release\net461\".
2018-07-24T08:34:05.4663278Z      1>Project "D:\tfs_agent_1\_work\10\s\MyProject\MyProject.csproj" (1) is building "D:\tfs_agent_1\_work\10\s\MyProject.Dto\MyProject.Dto.csproj" (3:2) on node 2 (default targets).
2018-07-24T08:34:05.4664316Z      3>PrepareForBuild:
2018-07-24T08:34:05.4664535Z          Creating directory "bin\release\net461\".
2018-07-24T08:34:05.4665686Z          Creating directory "obj\release\net461\".
2018-07-24T08:34:05.8197254Z        GetBuildVersion:
2018-07-24T08:34:05.8197674Z          Building version 2.20.3.41868 from commit 8ca3310388dd35abd32a6806404d87db9c625df6
2018-07-24T08:34:05.8213542Z      3>C:\Users\TFSBUILD\.nuget\packages\nerdbank.gitversioning\2.1.65\build\Nerdbank.GitVersioning.targets(110,5): error MSB4018: The "Nerdbank.GitVersioning.Tasks.SetCloudBuildVariables" task failed unexpectedly. [D:\tfs_agent_1\_work\10\s\MyProject.Dto\MyProject.Dto.csproj]
2018-07-24T08:34:05.8214040Z C:\Users\TFSBUILD\.nuget\packages\nerdbank.gitversioning\2.1.65\build\Nerdbank.GitVersioning.targets(110,5): error MSB4018: System.IO.IOException: No process is on the other end of the pipe [D:\tfs_agent_1\_work\10\s\MyProject.Dto\MyProject.Dto.csproj]
2018-07-24T08:34:05.8214450Z C:\Users\TFSBUILD\.nuget\packages\nerdbank.gitversioning\2.1.65\build\Nerdbank.GitVersioning.targets(110,5): error MSB4018:    at System.ConsolePal.WindowsConsoleStream.Write(Byte[] buffer, Int32 offset, Int32 count) [D:\tfs_agent_1\_work\10\s\MyProject.Dto\MyProject.Dto.csproj]
2018-07-24T08:34:05.8214792Z C:\Users\TFSBUILD\.nuget\packages\nerdbank.gitversioning\2.1.65\build\Nerdbank.GitVersioning.targets(110,5): error MSB4018:    at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder) [D:\tfs_agent_1\_work\10\s\MyProject.Dto\MyProject.Dto.csproj]
2018-07-24T08:34:05.8215128Z C:\Users\TFSBUILD\.nuget\packages\nerdbank.gitversioning\2.1.65\build\Nerdbank.GitVersioning.targets(110,5): error MSB4018:    at System.IO.StreamWriter.WriteLine(String value) [D:\tfs_agent_1\_work\10\s\MyProject.Dto\MyProject.Dto.csproj]
2018-07-24T08:34:05.8215421Z C:\Users\TFSBUILD\.nuget\packages\nerdbank.gitversioning\2.1.65\build\Nerdbank.GitVersioning.targets(110,5): error MSB4018:    at System.IO.SyncTextWriter.WriteLine(String value) [D:\tfs_agent_1\_work\10\s\MyProject.Dto\MyProject.Dto.csproj]
2018-07-24T08:34:05.8216293Z C:\Users\TFSBUILD\.nuget\packages\nerdbank.gitversioning\2.1.65\build\Nerdbank.GitVersioning.targets(110,5): error MSB4018:    at Nerdbank.GitVersioning.CloudBuildServices.VisualStudioTeamServices.SetCloudBuildVariable(String name, String value, TextWriter stdout, TextWriter stderr) [D:\tfs_agent_1\_work\10\s\MyProject.Dto\MyProject.Dto.csproj]
2018-07-24T08:34:05.8216646Z C:\Users\TFSBUILD\.nuget\packages\nerdbank.gitversioning\2.1.65\build\Nerdbank.GitVersioning.targets(110,5): error MSB4018:    at Nerdbank.GitVersioning.Tasks.SetCloudBuildVariables.Execute() [D:\tfs_agent_1\_work\10\s\MyProject.Dto\MyProject.Dto.csproj]
2018-07-24T08:34:05.8217155Z C:\Users\TFSBUILD\.nuget\packages\nerdbank.gitversioning\2.1.65\build\Nerdbank.GitVersioning.targets(110,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [D:\tfs_agent_1\_work\10\s\MyProject.Dto\MyProject.Dto.csproj]
2018-07-24T08:34:05.8217532Z C:\Users\TFSBUILD\.nuget\packages\nerdbank.gitversioning\2.1.65\build\Nerdbank.GitVersioning.targets(110,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [D:\tfs_agent_1\_work\10\s\MyProject.Dto\MyProject.Dto.csproj]
2018-07-24T08:34:05.8299494Z      3>Done Building Project "D:\tfs_agent_1\_work\10\s\MyProject.Dto\MyProject.Dto.csproj" (default targets) -- FAILED.

Used version.json:

{
  "$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
  "version": "2.20",
  "nugetPackageVersion": {
    "semVer": 2
  },
  "cloudBuild": {
    "setVersionVariables": true,
    "setAllVariables": true,
    "buildNumber": {
      "enabled": true,
      "includeCommitId": {
        "when": "nonPublicReleaseOnly",
        "where": "buildMetadata"
      }
    }
  }
}
@mariuszavoi
Copy link

I have the same Problem.
Any help is appreciated !

Thanks

@AArnott
Copy link
Collaborator

AArnott commented Jun 11, 2019

If this still repros for anyone, you might see better reliability by only setting the cloud build number once during your build instead of once per project (fewer times that it could fail).

@AArnott AArnott closed this as completed Jun 11, 2019
@connorads
Copy link

Anyone still having this issue and/or managed to fix this?

Our build is breaking several times a day on our build server

Error messages

The "Nerdbank.GitVersioning.Tasks.SetCloudBuildVariables" task failed unexpectedly.
System.IO.IOException: No process is on the other end of the pipe

Log context

C:\Users\MyUsername\.nuget\packages\nerdbank.gitversioning\2.3.138\build\Nerdbank.GitVersioning.targets(124,5): error MSB4018: The "Nerdbank.GitVersioning.Tasks.SetCloudBuildVariables" task failed unexpectedly. [D:\Jenkins\workspace\PR-123-WN3FQNAP4AICYRFY3AR5LUTV2\Source\Services\TopSecret\TopSecret.Api\TopSecret.Api.csproj]

C:\Users\MyUsername\.nuget\packages\nerdbank.gitversioning\2.3.138\build\Nerdbank.GitVersioning.targets(124,5): error MSB4018: System.IO.IOException: No process is on the other end of the pipe [D:\Jenkins\workspace\PR-123-WN3FQNAP4AICYRFY3AR5LUTV2\Source\Services\TopSecret\TopSecret.Api\TopSecret.Api.csproj]

C:\Users\MyUsername\.nuget\packages\nerdbank.gitversioning\2.3.138\build\Nerdbank.GitVersioning.targets(124,5): error MSB4018:    at System.ConsolePal.WindowsConsoleStream.Write(Byte[] buffer, Int32 offset, Int32 count) [D:\Jenkins\workspace\PR-123-WN3FQNAP4AICYRFY3AR5LUTV2\Source\Services\TopSecret\TopSecret.Api\TopSecret.Api.csproj]

C:\Users\MyUsername\.nuget\packages\nerdbank.gitversioning\2.3.138\build\Nerdbank.GitVersioning.targets(124,5): error MSB4018:    at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder) [D:\Jenkins\workspace\PR-123-WN3FQNAP4AICYRFY3AR5LUTV2\Source\Services\TopSecret\TopSecret.Api\TopSecret.Api.csproj]

C:\Users\MyUsername\.nuget\packages\nerdbank.gitversioning\2.3.138\build\Nerdbank.GitVersioning.targets(124,5): error MSB4018:    at System.IO.StreamWriter.WriteLine(String value) [D:\Jenkins\workspace\PR-123-WN3FQNAP4AICYRFY3AR5LUTV2\Source\Services\TopSecret\TopSecret.Api\TopSecret.Api.csproj]

C:\Users\MyUsername\.nuget\packages\nerdbank.gitversioning\2.3.138\build\Nerdbank.GitVersioning.targets(124,5): error MSB4018:    at System.IO.SyncTextWriter.WriteLine(String value) [D:\Jenkins\workspace\PR-123-WN3FQNAP4AICYRFY3AR5LUTV2\Source\Services\TopSecret\TopSecret.Api\TopSecret.Api.csproj]

C:\Users\MyUsername\.nuget\packages\nerdbank.gitversioning\2.3.138\build\Nerdbank.GitVersioning.targets(124,5): error MSB4018:    at Nerdbank.GitVersioning.CloudBuildServices.Jenkins.SetCloudBuildNumber(String buildNumber, TextWriter stdout, TextWriter stderr) [D:\Jenkins\workspace\PR-123-WN3FQNAP4AICYRFY3AR5LUTV2\Source\Services\TopSecret\TopSecret.Api\TopSecret.Api.csproj]

C:\Users\MyUsername\.nuget\packages\nerdbank.gitversioning\2.3.138\build\Nerdbank.GitVersioning.targets(124,5): error MSB4018:    at Nerdbank.GitVersioning.Tasks.SetCloudBuildVariables.Execute() [D:\Jenkins\workspace\PR-123-WN3FQNAP4AICYRFY3AR5LUTV2\Source\Services\TopSecret\TopSecret.Api\TopSecret.Api.csproj]

C:\Users\MyUsername\.nuget\packages\nerdbank.gitversioning\2.3.138\build\Nerdbank.GitVersioning.targets(124,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [D:\Jenkins\workspace\PR-123-WN3FQNAP4AICYRFY3AR5LUTV2\Source\Services\TopSecret\TopSecret.Api\TopSecret.Api.csproj]

C:\Users\MyUsername\.nuget\packages\nerdbank.gitversioning\2.3.138\build\Nerdbank.GitVersioning.targets(124,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [D:\Jenkins\workspace\PR-123-WN3FQNAP4AICYRFY3AR5LUTV2\Source\Services\TopSecret\TopSecret.Api\TopSecret.Api.csproj]

@AArnott
Copy link
Collaborator

AArnott commented Nov 6, 2019

Please file a bug with Azure Pipelines. This is a sign of a process they've created to capture task output having crashed, I believe.

@connorads
Copy link

connorads commented Nov 6, 2019

Hi @AArnott, thanks for the reply.

We're not using Azure Pipelines we're using a self-hosted Jenkins instance with a Windows build agent. See my previous commment for more details.

If you thought it was Azure Pipelines because of the Microsoft.Build.BackEnd namespace. It seems that is part of MsBuild.

Any other ideas?

@AArnott
Copy link
Collaborator

AArnott commented Nov 6, 2019

Ah, no I just assumed it was Azure Pipelines. Same suggestion with Jenkins though: report the bug to them. The build step that fails is failing while writing special logging commands to the console (presumably for jenkins to parse). But the process that is receiving stdout from your build crashed, so we fail while writing to stdout.

@AArnott
Copy link
Collaborator

AArnott commented Nov 6, 2019

Just a guess: since it sounds like this doesn't always fail for you but sometimes does, perhaps Jenkins is crashing when you try to set a build number that collides with the number of an existing build. You could perhaps confirm/refute that hypothesis by looking at your build history in Jenkins.

AArnott added a commit that referenced this issue Apr 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants