C# builds are failing: .NET Core installation error

#1

Started encountering this today:

C# support for Travis-CI is community maintained.
Please open any issues at https://travis-ci.community/c/languages/37-category and cc @joshua-anderson @akoeplinger @nterry
Installing .NET Core
$ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
$ export DOTNET_CLI_TELEMETRY_OPTOUT=1

6.10s0.47sE: Unable to locate package dotnet-sdk-2.1
E: Couldn't find any package by glob 'dotnet-sdk-2.1'
E: Couldn't find any package by regex 'dotnet-sdk-2.1'
The command "sudo apt-get install -qq dotnet-sdk-2.1=2.1.502*" failed and exited with 100 during .

Your build has been stopped.

Is this some transient issue that’s in progress?

Here’s my travis.yml:

language: csharp
solution: FirebaseAdmin/FirebaseAdmin.sln

matrix:
  include:
    - dotnet: 2.1.502
      mono: none
      script:
       - dotnet build FirebaseAdmin/FirebaseAdmin
       - dotnet build FirebaseAdmin/FirebaseAdmin.Snippets
       - dotnet build FirebaseAdmin/FirebaseAdmin.IntegrationTests
       - dotnet test FirebaseAdmin/FirebaseAdmin.Tests
#2

Came across the same issue today, using dist: xenial instead of trusty fixed the issue for me.

3 Likes
#3

I saw this today, too. My version numbers are slightly different.

Adding dist:xenial fixed the problem for me, too; but the build time went up, from ~3 minutes to 4.5 minutes.

#4

What a pain, builds are going even longer now? Can’t wait until I move all my stuff to azure dev ops, this is garbo

#5

Time actually got faster for me

#6

Yes, I also worked around the issue by switching to xenial. And it did increase the build time by about a minute (at least looks that way for now – don’t have enough data points yet).

#7

I am very thankful to the Travis and C# community for providing such awesome support. For free.

I noticed that the first build (whenever I change something significant) often takes longer. I will monitor and see if subsequent builds are faster or not.

A few minutes is not too long for me. I commit, at best, every 15 minutes (if not a couple of times a day). I can live with this.

1 Like
#8

We are seeing a similar error today:

Installing .NET Core
$ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
$ export DOTNET_CLI_TELEMETRY_OPTOUT=1
E: Unable to locate package dotnet-sdk-2.2
E: Couldn't find any package by glob 'dotnet-sdk-2.2'
E: Couldn't find any package by regex 'dotnet-sdk-2.2'
The command "sudo apt-get install -qq dotnet-sdk-2.2" failed and exited with 100 during .

My hypothesis is this is the result of Microsoft updating the distro package source as there is a new “point” release of dotnet core sdk today (2.2.5). The official guidance from MS suggests that this can be fixed by purging the package source, reinstalling it and then running apt update/install: https://dotnet.microsoft.com/download/linux-package-manager/ubuntu18-10/sdk-current#ubuntu18-04-issue

Would it be possible to update the shell script Travis is using to install dotnet to follow this guidance in case of failure?

#9

Me too, it’s also failing, although I did dotnet: 2.1.400 now instead of 2.1.300 and it’s seems to be going