question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Travis-CI failure with .NET Core

See original GitHub issue

Hi,

You may remember me as the person who asked for .NET Core support. I finally got around to unit-testing my game and decided to add Travis-CI integration.

TL;DR it failed with something related to MonoGame. Can you please tell me if/what I’m doing wrong? It looks like it’s failing to build the project.

The core error appears to be:

/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: The "GetMGCBTask" task failed unexpectedly. 

The full stack:

/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: The "GetMGCBTask" task failed unexpectedly. [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: System.IO.InvalidDataException: Central Directory corrupt. ---> System.IO.IOException: Invalid argument [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018:    at System.IO.FileStream.CheckFileCall(Int64 result, Boolean ignoreNotSupported) [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018:    at System.IO.FileStream.Seek(Int64 offset, SeekOrigin origin) [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018:    at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory() [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018:    --- End of inner exception stack trace --- [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018:    at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory() [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018:    at System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode mode, Boolean leaveOpen) [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018:    at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding) [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018:    at System.IO.Compression.ZipFile.Open(String archiveFileName, ZipArchiveMode mode, Encoding entryNameEncoding) [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018:    at System.IO.Compression.ZipFile.ExtractToDirectory(String sourceArchiveFileName, String destinationDirectoryName, Encoding entryNameEncoding, Boolean overwrite) [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018:    at MSBuildTasks.GetMGCBTask.Execute() in /home/harry/GitHub/MonoGame.Content.Builder/Tasks/GetMGCBTask.cs:line 38 [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(92,5): error MSB3073: The command "mono "/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MGCB/build/MGCB.exe" /@:"/home/travis/build/nightblade9/escape-to-earth/EscapeToEarth/Content/Content.mgcb" /platform:DesktopGL /quiet /outputDir:"bin/DesktopGL/Content" /intermediateDir:"obj/DesktopGL/Content"" exited with code 127. [/home/travis/build/nightblade9/escape-to-earth/EscapeToEarth/EscapeToEarth.csproj]

Travis log here.

Travis configuration:

language: csharp
solution: escape-to-earth.sln
mono: none
dotnet: 2.2.200
script:
  cd EscapeToEarth.UnitTests
dotnet test

Project repository lives here. I can build this locally and run tests on Windows 8/10.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nightblade9commented, Aug 16, 2018

I don’t know. Travis workspaces are still a mystery to me (I don’t know how to view/save files on disk).

Instead, I did some googling on how to get MonoGame projects to build on Travis. I found this wonderful answer; the summary is that I added these changes to my .travis.yml file:

before_install:
  - wget http://www.monogame.net/releases/v3.4/MonoGame.Linux.zip
  - unzip MonoGame.Linux.zip
  - find * -type f -exec chmod 777 {} \; # lazy just make all executable
install:
  - sudo apt-get install -qq monodevelop libopenal-dev ttf-mscorefonts-installer gtk-sharp2; # install needed packages for the monogame sdk
  - sudo ./generate.sh && yes Y|sudo ./monogame-linux.run; # install monogame sdk

(This is a slightly modified version because one of the packages, erm, I think it doesn’t exist in the version of Linux that the Travis docker container is using.)

This resulted in a successful build, so I’m good to go now. Thanks for your help.

0reactions
Thrakacommented, Aug 16, 2018

Nope, SadConsole just loads direct PNG files and doesn’t use the pipeline. I just looked up linux exit code 127 and it says that it really means file not found. https://stackoverflow.com/questions/1763156/127-return-code-from

Does /home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MGCB/build/MGCB.exe exist?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build failed for ASP.NET Core 3.1 in Travis CI
1 Answer 1 · The main problem I think is that the nuget dotnet restore command is not found in linux virtual machine...
Read more >
CI failing with .NET core project · Issue #6831 · travis-ci ...
I setup up CI and it's saying the OS doesn't support .NET core. You can view the build results here => https://travis-ci.org/quattro004/ ...
Read more >
NET Core 3.1 builds are failing - Enterprise
Hello, the Travis builds for our .NET Core 3.1 projects are failing. I can't provide a link to one of the failed builds...
Read more >
Common Build Problems
One possible cause for builds failing unexpectedly can be calling set -e (also known as set errexit ), either directly in your .travis.yml...
Read more >
Configuring CI for .Net Core using Travis CI and Xunit
One of the key myths and challenges around using .net core at the moment is the lack of support or information around getting...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found