cake-build / cake-vso

Cake integration for Azure DevOps.
https://marketplace.visualstudio.com/items/cake-build.cake
18 stars 18 forks source link

Build script started to fail on installing #addins #35

Closed ivoloshin closed 4 years ago

ivoloshin commented 7 years ago

What You Are Seeing?

On our build server everything worked fine until recently, when I started to get the following error:

2017-02-28T21:13:18.0881311Z Analyzing build script...
2017-02-28T21:13:18.0891312Z Processing build script...
2017-02-28T21:13:18.0891312Z Installing addins...
2017-02-28T21:13:20.6342764Z ##[error]'NETStandard.Library' already has a dependency defined for 'Microsoft.NETCore.Platforms'.
2017-02-28T21:13:20.6402768Z NuGet exited with 1
2017-02-28T21:13:20.6422772Z Could not find any assemblies compatible with .NETFramework,Version=v4.5.
2017-02-28T21:13:20.6442777Z ##[error]Error: Failed to install addin 'Cake.XdtTransform'.
2017-02-28T21:13:20.6562770Z ##[error]Unexpected exit code 1 returned from tool Cake.exe
2017-02-28T21:13:20.6752781Z Finishing task: Cake
2017-02-28T21:13:20.6852792Z ##[error]Task Cake failed. This caused the job to fail. Look at the logs for the task for more details.

What version of Cake are you using?

VSTFS Plugin Cake 0.2.4 Cake 0.17.0

Are you running on a 32 or 64 bit system?

64bit

What environment are you running on? Hosted? Custom?

Windows Server 2012 TFS Build Client

How Did You Get This To Happen? (Steps to Reproduce)

When I run the script from TFS, the install of addin fails. Then I remote to the machine and try to run in from command line and I get same errors. I then delete the tools folder and run it again and it works.

So here's what I did. I downloaded a latest version of the Cake.ps1 and overwrote the one here C:\agent\tasks\Cake\0.2.4 and that fixed it.

ivoloshin commented 7 years ago

So, something to add. The script ran again and failed. Then I re-queued it and it succeeded. It would be helpful if anyone knew why it would fail randomly with such an error. Definitely seems related to nuget, but I'm not sure how it's affecting it.

devlead commented 7 years ago

Was it the same agent? Sme version of nuget.exe for both?

ivoloshin commented 7 years ago

Yes, nothing changed with the location or agent. Yesterday it errored until I replaced Cake.ps1 file. I thought that fixed it, but I didn't run a diff on the two cake files. Today it errored only the first time.

agc93 commented 7 years ago

@ivoloshin If possible, can you try running this scenario through the Cake extension again? We've updated to 0.3.0 which changes how NuGet gets invoked during the build.

ivoloshin commented 7 years ago

Seems random. I went into the build folder and deleted tools folder. Then queued up TFS build again and it worked. Not sure what's going on.

ivoloshin commented 7 years ago

So, this random error never went away... Now it errors with the this component: Error: Failed to install addin 'Cake.WebDeploy'.

mapspiral commented 7 years ago

My build fails with exactly the same issue.

I'm building using a hosted VSTS agent.

Preparing task execution handler.
Executing the powershell script: d:\a\_tasks\Cake_b88ea9a0-7d6e-11e5-b5de-d57d652482f7\0.2.4\Cake.ps1
Installing Cake...
Installing 'Cake 0.23.0'.
Successfully installed 'Cake 0.23.0'.
Executing build script...
d:\a\1\s\build\tools\Cake\Cake.exe "d:\a\1\s\build\SpatialEye.DevOps.Cake.cake" -target="Deploy" -verbosity="Minimal" --paths_tools="d:\a\1\s\build\tools" --experimental
'NETStandard.Library' already has a dependency defined for 'Microsoft.NETCore.Platforms'.
NuGet exited with 1
An error occured while installing package Cake.FileHelpers.
Error: Failed to install addin 'Cake.FileHelpers'.
System.Exception: Unexpected exit code 1 returned from tool Cake.exe
   at Microsoft.TeamFoundation.DistributedTask.Task.Internal.InvokeToolCmdlet.ProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()
PowerShell script completed with 1 errors.

UPDATE: the build continuously fails - it is not random.

UPDATE2: i was able to fix the issue by checking in a more recent version of nuget.exe and use that one from my cake script.

gep13 commented 4 years ago

@ivoloshin @mapspiral we haven't heard anything on this issue for a while, so I am going to go ahead and close this out. If you are still seeing an issue, feel free to reply on this issue, and we can investigate further.