Build fails with "Command exited with code" without obvious errors and result codes

soloydenko's Avatar

soloydenko

01 Oct, 2016 04:51 AM

How do I diagnose the root cause and fix the issue with my failing build?

appveyor.yml fails somewhere around the command trying to set up .Net Core CLI and then run dotnet restore.

Build started
git clone -q --branch=appveyor https://github.com/another-guy/Angular2-AspNetCore.git C:\projects\angular2-aspnetcore
git checkout -qf d9d53c9bc838ede3311ac37bb343037def934f23
Running Install scripts
mkdir -Force ".\scripts\obtain\" | Out-Null
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.ps1'))
dotnet-install: Downloading https://dotnetcli.azureedge.net/dotnet/Sdk/1.0.0-preview3-003716/dotnet-dev-win-x64.1.0.0-preview3-003716.zip
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Sdk/1.0.0-preview3-003716/dotnet-dev-win-x64.1.0.0-preview3-003716.zip
dotnet-install: Adding to current process PATH: "C:\Users\appveyor\AppData\Local\Microsoft\dotnet\". Note: This change will not be visible if PowerShell was run as a child process.
dotnet-install: Installation finished
Command exited with code

Build link: https://ci.appveyor.com/project/another-guy/angular2-aspnetcore/bui...
Appveyor.yml link at GitHub: https://raw.githubusercontent.com/another-guy/Angular2-AspNetCore/a...

  1. 1 Posted by Ilya Finkelshte... on 04 Oct, 2016 12:38 AM

    Ilya Finkelshteyn's Avatar

    Hello,

    Apparently at least some of code paths (including happy path) in this script ends with exit 0. Which kills PowerShell session in which script was called.

    We will fix appveyor to tolerate this, here is the issue created - https://github.com/appveyor/ci/issues/1090

    As a workaround you can call it this way:

    - cmd: PowerShell.exe iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.ps1'))

    Also I want to let you know that latest .NET Core is installed on build VMs https://www.appveyor.com/docs/installed-software/, and maybe you can avoid this step at all. If you have some specific reasons to install it yourself -- use, as I said, workaround from above.

    --ilya.

  2. 2 Posted by soloydenko on 04 Oct, 2016 01:12 AM

    soloydenko's Avatar

    Thank you for helping out Ilya!

    I will try to avoid manual tools installation in this scenario then. It may resolve my issue and also make *.yml simpler.

  3. 3 Posted by soloydenko on 06 Oct, 2016 03:42 AM

    soloydenko's Avatar

    I am closing the issue since preinstalled dotnet cli worked for me. Thank you again for looking into it Ilya!

  4. soloydenko closed this discussion on 06 Oct, 2016 03:42 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac