SteeltoeOSS / Samples

Steeltoe samples and reference application collection
https://steeltoe.io/
Apache License 2.0
643 stars 251 forks source link

Configuration/AspDotNetCore/CloudFoundry does not push #117

Closed siennathesane closed 5 years ago

siennathesane commented 5 years ago

GIVEN

This version of the Samples repository

Samples/Configuration/src/AspDotNetCore/CloudFoundry master ✓ git --no-pager log -n1
commit f039eedf737beecfe0e784bde8d4e207cf9eed58 (HEAD -> master, origin/master)
Author: Chris Cheetham <chris@cheetham.com>
Date:   Mon Jul 8 14:45:35 2019 -0400

    fix behave arg

WHEN

I cf push cloud-test --random-route in the Configuration/src/AspDotNetCore/CloudFoundry directory

USING

The dotnet-core_buildpack-cflinuxfs3-v2.2.12.zip buildpack from upstream cf and this cf version:

$ cf api
api endpoint:   https://api.fr.cloud.gov
api version:    2.138.0

THEN

I see these errors

Pushing from manifest to org <redacted> / space <redacted> as mike.lloyd@gsa.gov...
Using manifest file /Users/<redacted>/Development/dotnet/Samples/Configuration/src/AspDotNetCore/CloudFoundry/manifest.yml
Getting app info...
Updating app with these attributes...
  name:                cloud-test
  path:                /Users/<redacted>/Development/dotnet/Samples/Configuration/src/AspDotNetCore/CloudFoundry
  buildpacks:
    dotnet_core_buildpack
  disk quota:          1G
  health check type:   port
  instances:           1
  memory:              512M
  stack:               cflinuxfs3
  env:
    ASPNETCORE_ENVIRONMENT
  routes:
    <redacted>

Updating app cloud-test...
Mapping routes...
Comparing local files to remote cache...
Packaging files to upload...
Uploading files...
 201.22 KiB / 201.22 KiB [=============================================================================================================================================================================] 100.00% 1s

Waiting for API to complete processing files...

Staging app and tracing logs...
   Downloading dotnet_core_buildpack...
   Downloaded dotnet_core_buildpack
   Cell 5141b1ca-9fb7-4cfd-bc81-1661301ce2b7 creating container for instance 95b3650f-ad5a-4f37-b5ab-6b8a7e8acc07
   Cell 5141b1ca-9fb7-4cfd-bc81-1661301ce2b7 successfully created container for instance 95b3650f-ad5a-4f37-b5ab-6b8a7e8acc07
   Downloading app package...
   Downloaded app package (606.5K)
   -----> Dotnet-Core Buildpack version 2.2.12
   -----> Supplying Dotnet Core
   -----> Installing libunwind 1.3.1
          Download [https://buildpacks.cloudfoundry.org/dependencies/libunwind/libunwind-1.3.1-cflinuxfs3-96d2f3d0.tar.gz]
          using the default SDK
   -----> Installing dotnet-sdk 2.2.204
          Download [https://buildpacks.cloudfoundry.org/dependencies/dotnet-sdk/dotnet-sdk.2.2.204.linux-amd64-cflinuxfs3-3278b7aa.tar.xz]
   -----> Installing dotnet-runtime 2.2.5
          Download [https://buildpacks.cloudfoundry.org/dependencies/dotnet-runtime/dotnet-runtime.2.2.5.linux-amd64-cflinuxfs3-45a01508.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 5141b1ca-9fb7-4cfd-bc81-1661301ce2b7 stopping instance 95b3650f-ad5a-4f37-b5ab-6b8a7e8acc07
   Cell 5141b1ca-9fb7-4cfd-bc81-1661301ce2b7 destroying container for instance 95b3650f-ad5a-4f37-b5ab-6b8a7e8acc07
Error staging application: App staging failed in the buildpack compile phase
FAILED
cf-gitbot commented 5 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/168273602

The labels on this github issue will be updated when the story is started.

TimHess commented 5 years ago

That project is multi-targeted to run as either net461 or netcoreapp2.1. It makes sense that the buildpack wouldn't know what version of dotnet to use as two options have been specified.

It should work to either dotnet publish first or drop one of the targetframeworks from CloudFoundry.csproj

siennathesane commented 5 years ago

Ah, okay, I wasn't sure if it was a native push or required a publish. Thanks @TimHess