1

I want to deploy my project using Pivotal from Bamboo. During the deployment of my .NetCore 3.1 project, I'm getting the error "Unable to install dotnet-runtime: could not find a version of dotnet-runtime to install". The deployment stack is set to cflinuxfs3.

I've tried specifying dotnet runtime version (3.1 and 3.1.5) in .csproj file but it got the same error so I removed it.

I've also created a buildpack.yml file and specified the .netcore sdk version as 3.1.x in there.

I'm sharing the property group from csproj and the manifest.yml file.

-- Error Log --

Downloading app package...
Downloaded app package (6.4M) -----> Dotnet-Core Buildpack version 2.3.12
-----> Supplying Dotnet Core -----> Installing libunwind 1.4.0
Copy[/tmp/buildpacks/b7bd2a36eb284e204524c677d2dbbfa2/dependencies/a54cfafce3d2a14e4f96777d5fd471f4/libunwind_1.4.0_linux_noarch_cflinuxfs3_05e08b22.tgz] using the default SDK
-----> Installing dotnet-sdk 3.1.301
Copy[/tmp/buildpacks/b7bd2a36eb284e204524c677d2dbbfa2/dependencies/b422801667458a262ba26a3117b93e4f/dotnet-sdk_3.1.301_linux_x64_any-stack_80a771e4.tar.xz]

-----> Installing dotnet-runtime 3.1.5
Copy[/tmp/buildpacks/b7bd2a36eb284e204524c677d2dbbfa2/dependencies/40b5a460524fe7f1795c876445349a31/dotnet-runtime_3.1.5_linux_x64_any-stack_1aa84612.tar.xz]

-----> Finalizing Dotnet Core
ERROR Unable to install dotnet-runtime: could not find a version of dotnet-runtime to install Failed to compile droplet: Failed to run finalize script: exit status 12 Exit status 223 Cell ffe536bc-374c-46b5-a620-e3366dab6b22 stopping instance b71ecb48-0083-4fd1-8f59-3a77b05de0e0

Error staging application: App staging failed in the buildpack compile phase

-- .csproj --

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <ServerGarbageCollection>true</ServerGarbageCollection>
    <ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
    <IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
    <NoWarn>$(NoWarn);1591</NoWarn>
  </PropertyGroup>

-- manifest.yml --

---
applications:
- name: projectName
  memory: 1G
  timeout: 240
  instances: 1
  routes:
   - route: routeAddress
  services:
   - ARCHITECTURE.SERVICES-TST.ServiceRegistry
   - ProjectName.Redis
   - ProjectName.Dynatrace
   - ProjectName.ConfigServer
  env:
    DT_TAGS: ((appName)) ((dc))-((env))
    TZ: country
    ASPNETCORE_ENVIRONMENT: environmentName
    SPRING_CLOUD_CONFIG_LABEL: configLabel
esdoodle
  • 247
  • 2
  • 21

1 Answers1

1

Ok, here's what is happening.

  1. The code is looking at the RuntimeFrameworkVersion in your .csproj file.

  2. When that is empty, it's going to look at the TargetFramework and attempt to find a substring match using the regex netcoreapp(.*).

  3. It is expecting that to have a single match, but in your case it does not, so you get that error message: could not find a version of dotnet-runtime to install.

Based on your .csproj file, it seems like what you have should be OK though. I did a quick check and the regex works and returns the version.

You could try setting RuntimeFrameworkVersion which would take a slightly different code path and might work for you.

You are trying to perform a source-based deployment. You could try dotnet publish first followed by a Framework Dependent Deployment which again would force a different code path.

It might be that the buildpack isn't finding your file, but it's hard to say without more info.

Daniel Mikusa
  • 13,716
  • 1
  • 22
  • 28