GoogleCloudPlatform / buildpacks

Builders and buildpacks designed to run on Google Cloud's container platforms
Apache License 2.0
967 stars 144 forks source link

Can't pack dotnet 8 (in gcp and locally) #447

Open GraDea opened 3 weeks ago

GraDea commented 3 weeks ago

I tried to pack your reference dotnet-project (https://github.com/GoogleCloudPlatform/buildpack-samples/tree/master/sample-dotnet) by documentation and received the error:

[builder] ERROR: failed to build: exit status 1 ERROR: failed to build: executing lifecycle: failed with status code: 51

I checked the Go and Java-gradle versions, and they were built successfully.

Also, I tried to publish my own dotnet app to Cloud Run and received the same messages.

Bellow full verbose

e.peshkov@epeshkov-MacBook-Pro sample-dotnet % pack build --builder=gcr.io/buildpacks/builder sample-dotnet --verbose Builder gcr.io/buildpacks/builder is untrusted As a result, the phases of the lifecycle which require root access will be run in separate trusted ephemeral containers. For more information, see https://medium.com/buildpacks/faster-more-secure-builds-with-pack-0-11-0-4d0c633ca619 Pulling image gcr.io/buildpacks/builder:latest latest: Pulling from buildpacks/builder Digest: sha256:f2a01bf2d0502af2175f3af0a4d16a558d8cb056980ec39469559b013775654a Status: Image is up to date for gcr.io/buildpacks/builder:latest CheckReadAccess succeeded for the run image gcr.io/buildpacks/google-22/run Selected run image gcr.io/buildpacks/google-22/run Pulling image gcr.io/buildpacks/google-22/run with platform linux/amd64 latest: Pulling from buildpacks/google-22/run Digest: sha256:f64ca5a9c953581fd780dc9df6f5fd13677fa2fc7602d7a4316c50bd774ad7cb Status: Image is up to date for gcr.io/buildpacks/google-22/run:latest Pulling image buildpacksio/lifecycle:0.17.7 with platform linux/amd64 0.17.7: Pulling from buildpacksio/lifecycle Digest: sha256:42e2ea1eec79c769a4c301cbb3536890d8d3860effde4034d8c6fc57f93f9587 Status: Image is up to date for buildpacksio/lifecycle:0.17.7 Creating ephemeral lifecycle from buildpacksio/lifecycle:0.17.7 with uid 1000 and gid 1000. With workspace dir Selecting ephemeral lifecycle image pack.local/lifecycle/746f737a66646b617276:latest for build Using build cache volume pack-cache-library_sample-dotnet_latest-1115be1eff1b.build Created ephemeral bridge network pack.local-network-7171646b706875746a6b with ID 85336d1bc8a30942c3dc4efc1abbe559af6798cae49463abf184ac19d5159efc ===> ANALYZING Running the analyzer on OS linux from image pack.local/lifecycle/746f737a66646b617276:latest with: Container Settings: Args: /cnb/lifecycle/analyzer -log-level debug -daemon -run /layers/run.toml -run-image gcr.io/buildpacks/google-22/run -launch-cache /launch-cache sample-dotnet System Envs: CNB_USER_ID=1000 CNB_GROUP_ID=1000 CNB_PLATFORM_API=0.12 Image: pack.local/lifecycle/746f737a66646b617276:latest User: root Labels: map[author:pack] Host Settings: Binds: /var/run/docker.sock:/var/run/docker.sock pack-cache-library_sample-dotnet_latest-1115be1eff1b.launch:/launch-cache pack-layers-fxonqqhacq:/layers pack-app-qgtlwrxnrw:/workspace Network Mode: pack.local-network-7171646b706875746a6b [analyzer] Starting analyzer... [analyzer] Parsing inputs... [analyzer] Ensuring privileges... [analyzer] Executing command... [analyzer] Timer: Analyzer started at 2024-08-18T20:52:48Z [analyzer] Image with name "sample-dotnet" not found [analyzer] Found image with identifier "857ec7818c92f1d8317c35ba4d3bb366e2a2c42b2f13e93dbd2ba3930542657d" [analyzer] Timer: Analyzer ran for 436.375µs and ended at 2024-08-18T20:52:48Z [analyzer] Run image info in analyzed metadata is: [analyzer] {"Reference":"857ec7818c92f1d8317c35ba4d3bb366e2a2c42b2f13e93dbd2ba3930542657d","Image":"gcr.io/buildpacks/google-22/run","Extend":false,"target":{"os":"linux","arch":"amd64"}} ===> DETECTING Running the detector on OS linux from image gcr.io/buildpacks/builder:latest with: Container Settings: Args: /cnb/lifecycle/detector -app /workspace -log-level debug System Envs: CNB_PLATFORM_API=0.12 Image: gcr.io/buildpacks/builder:latest User: Labels: map[author:pack] Host Settings: Binds: pack-layers-fxonqqhacq:/layers pack-app-qgtlwrxnrw:/workspace Network Mode: pack.local-network-7171646b706875746a6b [detector] Starting detector... [detector] Parsing inputs... [detector] Ensuring privileges... [detector] Executing command... [detector] Timer: Detector started at 2024-08-18T20:52:48Z [detector] ======== Output: google.dotnet.sdk@0.9.1 ======== [detector] Opting in: found project files: ./helloworld.csproj [detector] ======== Output: google.dotnet.functions-framework@0.0.1 ======== [detector] Opting out: GOOGLE_FUNCTION_TARGET not set [detector] ======== Output: google.dotnet.publish@0.9.0 ======== [detector] Opting in: found project files: ./helloworld.csproj [detector] ======== Output: google.dotnet.runtime@0.9.1 ======== [detector] Opting in: found project files: ./helloworld.csproj [detector] ======== Output: google.config.entrypoint@0.9.0 ======== [detector] Opting out: GOOGLE_ENTRYPOINT not set, no valid entrypoint in app.yaml and Procfile not found [detector] ======== Output: google.utils.label-image@0.0.2 ======== [detector] Opting in: always enabled [detector] ======== Results ======== [detector] pass: google.dotnet.sdk@0.9.1 [detector] skip: google.dotnet.functions-framework@0.0.1 [detector] pass: google.dotnet.publish@0.9.0 [detector] pass: google.dotnet.runtime@0.9.1 [detector] skip: google.config.entrypoint@0.9.0 [detector] pass: google.utils.label-image@0.0.2 [detector] Resolving plan... (try #1) [detector] 4 of 6 buildpacks participating [detector] google.dotnet.sdk 0.9.1 [detector] google.dotnet.publish 0.9.0 [detector] google.dotnet.runtime 0.9.1 [detector] google.utils.label-image 0.0.2 [detector] Timer: Detector ran for 67.283167ms and ended at 2024-08-18T20:52:48Z ===> RESTORING Running the restorer on OS linux from image pack.local/lifecycle/746f737a66646b617276:latest with: Container Settings: Args: /cnb/lifecycle/restorer -cache-dir /cache -daemon -log-level debug System Envs: CNB_USER_ID=1000 CNB_GROUP_ID=1000 CNB_PLATFORM_API=0.12 Image: pack.local/lifecycle/746f737a66646b617276:latest User: root Labels: map[author:pack] Host Settings: Binds: pack-cache-library_sample-dotnet_latest-1115be1eff1b.build:/cache /var/run/docker.sock:/var/run/docker.sock pack-layers-fxonqqhacq:/layers pack-app-qgtlwrxnrw:/workspace Network Mode: pack.local-network-7171646b706875746a6b [restorer] Starting restorer... [restorer] Parsing inputs... [restorer] Ensuring privileges... [restorer] Executing command... [restorer] Timer: Restorer started at 2024-08-18T20:52:49Z [restorer] Restoring Layer Metadata [restorer] Reading buildpack directory: /layers/google.dotnet.sdk [restorer] Reading buildpack directory: /layers/google.dotnet.publish [restorer] Reading buildpack directory: /layers/google.dotnet.runtime [restorer] Reading buildpack directory: /layers/google.utils.label-image [restorer] Reading Buildpack Layers directory /layers [restorer] Reading buildpack directory: /layers/google.dotnet.sdk [restorer] Reading Buildpack Layers directory /layers [restorer] Reading buildpack directory: /layers/google.dotnet.publish [restorer] Reading Buildpack Layers directory /layers [restorer] Reading buildpack directory: /layers/google.dotnet.runtime [restorer] Reading Buildpack Layers directory /layers [restorer] Reading buildpack directory: /layers/google.utils.label-image [restorer] Timer: Restorer ran for 1.05325ms and ended at 2024-08-18T20:52:49Z ===> BUILDING Running the builder on OS linux from image gcr.io/buildpacks/builder:latest with: Container Settings: Args: /cnb/lifecycle/builder -app /workspace -log-level debug System Envs: CNB_PLATFORM_API=0.12 Image: gcr.io/buildpacks/builder:latest User: Labels: map[author:pack] Host Settings: Binds: pack-layers-fxonqqhacq:/layers pack-app-qgtlwrxnrw:/workspace Network Mode: pack.local-network-7171646b706875746a6b [builder] Starting builder... [builder] Parsing inputs... [builder] Ensuring privileges... [builder] Executing command... [builder] Timer: Builder started at 2024-08-18T20:52:49Z [builder] Running build for buildpack google.dotnet.sdk@0.9.1 [builder] Looking up buildpack [builder] Finding plan [builder] Creating plan directory [builder] Preparing paths [builder] Running build command [builder] === .NET - Sdk (google.dotnet.sdk@0.9.1) === [builder] Looking for global.json in /workspace [builder] Using latest stable .NET Core SDK version [builder] 2024/08/18 20:52:49 [DEBUG] GET https://dl.google.com/runtimes/ubuntu2204/dotnetsdk/version.json [builder] CACHE MISS: "dotnetsdk" [builder] Installing .NET SDK v8.0.401. [builder] 2024/08/18 20:52:49 [DEBUG] GET https://dl.google.com/runtimes/ubuntu2204/dotnetsdk/dotnetsdk-8.0.401.tar.gz [builder] Processing layers [builder] Updating environment [builder] Reading output files [builder] Updating buildpack processes [builder] Updating process list [builder] Finished running build for buildpack google.dotnet.sdk@0.9.1 [builder] Running build for buildpack google.dotnet.publish@0.9.0 [builder] Looking up buildpack [builder] Finding plan [builder] Creating plan directory [builder] Preparing paths [builder] Running build command [builder] === .NET - Publish (google.dotnet.publish@0.9.0) === [builder] Installing application dependencies. [builder] CACHE MISS: "packages" [builder] ***** CACHE MISS: "prod dependencies" [builder] -------------------------------------------------------------------------------- [builder] Running "dotnet restore --packages /layers/google.dotnet.publish/packages ./helloworld.csproj (DOTNET_CLI_TELEMETRY_OPTOUT=true)" [builder] [builder] Welcome to .NET 8.0! [builder] --------------------- [builder] SDK Version: 8.0.401 [builder] [builder] ---------------- [builder] Installed an ASP.NET Core HTTPS development certificate. [builder] To trust the certificate, view the instructions: https://aka.ms/dotnet-https-linux [builder] [builder] ---------------- [builder] Write your first app: https://aka.ms/dotnet-hello-world [builder] Find out what's new: https://aka.ms/dotnet-whats-new [builder] Explore documentation: https://aka.ms/dotnet-docs [builder] Report issues and find source on GitHub: https://github.com/dotnet/core [builder] Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli [builder] -------------------------------------------------------------------------------------- [builder] Done "dotnet restore --packages /layers/google.dotnet.publish/pack..." (1.089642542s) [builder] -------------------------------------------------------------------------------- [builder] failed to build: (error ID: ce40b84e): [builder] Welcome to .NET 8.0! [builder] --------------------- [builder] SDK Version: 8.0.401 [builder] [builder] ---------------- [builder] Installed an ASP.NET Core HTTPS development certificate. [builder] To trust the certificate, view the instructions: https://aka.ms/dotnet-https-linux [builder] [builder] ---------------- [builder] Write your first app: https://aka.ms/dotnet-hello-world [builder] Find out what's new: https://aka.ms/dotnet-whats-new [builder] Explore documentation: https://aka.ms/dotnet-docs [builder] Report issues and find source on GitHub: https://github.com/dotnet/core [builder] Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli [builder] -------------------------------------------------------------------------------------- [builder] -------------------------------------------------------------------------------- [builder] Sorry your project couldn't be built. [builder] Our documentation explains ways to configure Buildpacks to better recognise your project: [builder] -> https://cloud.google.com/docs/buildpacks/overview [builder] If you think you've found an issue, please report it: [builder] -> https://github.com/GoogleCloudPlatform/buildpacks/issues/new [builder] -------------------------------------------------------------------------------- [builder] Timer: Builder ran for 12.588935673s and ended at 2024-08-18T20:53:01Z [builder] ERROR: failed to build: exit status 1 ERROR: failed to build: executing lifecycle: failed with status code: 51

ludoch commented 3 weeks ago

@jama22 you wrote the sample years ago. It is still working?

kennethye1 commented 3 weeks ago

I'm unable to reproduce this. I also deployed via gcloud run deploy --source .