-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Application is crashing and getting the permission denied after deploying the DotNet app. #3184
Comments
Hey @mukeshcpande We are not fluent in dotnet, could you please provide a sample application that we could just start playing with? Also, korifi does not come with the dotnet buildpack by default, how did you install it? As per the error you are seeing:
It could be that the buildpack building the app image is not setting proper permission on the executable, i.e. it might be an issue with the dotnet buildpack. |
Hi @danail-branekov , Those are samples given in the below repo and you can use either 'fdd-app' or 'fde-app' and can deploy the published contains as is to see the 'permission denied' error message https://github.com/paketo-buildpacks/samples/tree/main/dotnet-core/aspnet 'fdd-app' - https://github.com/paketo-buildpacks/samples/tree/main/dotnet-core/fdd-app 'fde-app' - github.com/paketo-buildpacks/samples/tree/main/dotnet-core/fde-app //////log trace////// |
Hmm, seems to be working for me. I could not use fda-app and fde-app as they do not have their csproj file which seems to be required by So here is how it looks on my side:
I am using Am I missing something? |
Hi @danail-branekov, Following app contents are already the published directory contents and that's why you're not seeing the '*.csproj' 'fdd-app' - https://github.com/paketo-buildpacks/samples/tree/main/dotnet-core/fdd-app 'fde-app' - https://github.com/paketo-buildpacks/samples/tree/main/dotnet-core/fde-app You can try deploying them directly from the above paths. Could you please try command "dotnet publish -c release -r linux-x64" followed by push and let us know the output? Our output while deploying where issue is happening when we go with the runtime command as '-r linux-x64' 2024-03-28T16:18:53.97-0500 [STG/] OUT Assigning launch processes: and ending up with the error If we go with the simple publish command like how you tried above, will work for us as well "dotnet publish -c release" and deployment traces are, 2024-03-28T16:16:09.63-0500 [STG/] OUT Assigning launch processes: |
Thank you for the details, @mukeshcpande Using
Note that the build output on my side says:
This seems to be a bit different from what you see, I wonder how that makes a difference.
Could you provide a full list of commands that you are running? I noticed that you are probably using Windows, I wonder whether that makes a difference. |
Hi @danail-branekov, Looks like you're pulling the image from "Pulling localregistry-docker-registry.default.svc.cluster.local:30050", are you adding the Dockerfile while doing the publish or doing publish alone without any extra files? Yes I'm publishing on windows machine followed by deployment. |
The local registry is just an oci registry running locally on the cluster, it could be anything else, e.g. dockerhub or Google artifact registry. We are not putting the dockerfile there ourselves, it is Korifi pushing the app image that is produced by packeto buildpacks as part of the cf push command. We are running the commands above on Ubuntu against a local kind cluster. We do not have access to windows machines to test there. |
Hi @danail-branekov dotnet publish -c release --self-contained -r linux-x64 However if we try the same above command to publish the app image and try to deploy with the Packeto buildpack from windows machine, deployment is getting failed. What is the difference between buildpacks where one is working fine after publish from the windows/linux machine and other one is unable to work. |
Hey @mukeshcpande Thanks for the update!
Unfortunately I am not familiar with dotnet and the dotnet buildpack. I would suggest discussing the topic with https://github.com/paketo-buildpacks/dotnet-core (assuming this is the correct buildpack) maintainers. |
Thanks for all your help and will check with the respective team. |
What happened?
Published the dotnet app with target framework 6 with the following command
dotnet publish "C:\gitRepo\SampleAsp\SampleAsp.csproj" -c release --self-contained -r linux-x64 --output "C:\gitRepo\SampleAsp\output"
After publish when deploying the app getting following error as
16:54:31.11-0500 [STG/] OUT paketo-buildpacks/icu 0.7.7
2024-03-18T16:54:31.11-0500 [STG/] OUT paketo-buildpacks/dotnet-execute 0.14.29
2024-03-18T16:54:31.11-0500 [STG/] OUT Timer: Detector ran for 44.385842ms and ended at 2024-03-18T21:54:31Z
2024-03-18T16:54:31.95-0500 [STG/] OUT Warning: No cached data will be used, no cache specified.
2024-03-18T16:54:31.95-0500 [STG/] OUT Timer: Restorer started at 2024-03-18T21:54:31Z
2024-03-18T16:54:31.95-0500 [STG/] OUT Timer: Restorer ran for 127.492µs and ended at 2024-03-18T21:54:31Z
2024-03-18T16:54:33.43-0500 [STG/] OUT Timer: Builder started at 2024-03-18T21:54:33Z
2024-03-18T16:54:33.44-0500 [STG/] OUT
2024-03-18T16:54:33.44-0500 [STG/] OUT Paketo Buildpack for CA Certificates 3.6.8
2024-03-18T16:54:33.44-0500 [STG/] OUT https://github.com/paketo-buildpacks/ca-certificates
2024-03-18T16:54:33.44-0500 [STG/] OUT Launch Helper: Contributing to layer
2024-03-18T16:54:33.44-0500 [STG/] OUT Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
2024-03-18T16:54:33.46-0500 [STG/] OUT Paketo Buildpack for ICU 0.7.7
2024-03-18T16:54:33.46-0500 [STG/] OUT Resolving ICU version
2024-03-18T16:54:33.46-0500 [STG/] OUT Candidate version sources (in priority order):
2024-03-18T16:54:33.46-0500 [STG/] OUT -> ""
2024-03-18T16:54:33.46-0500 [STG/] OUT
2024-03-18T16:54:33.46-0500 [STG/] OUT Selected ICU version (using ): 74.2
2024-03-18T16:54:33.46-0500 [STG/] OUT
2024-03-18T16:54:33.46-0500 [STG/] OUT Executing build process
2024-03-18T16:54:33.46-0500 [STG/] OUT Installing ICU
2024-03-18T16:54:34.22-0500 [STG/] OUT Completed in 762ms
2024-03-18T16:54:34.22-0500 [STG/] OUT
2024-03-18T16:54:34.22-0500 [STG/] OUT Generating SBOM for /layers/paketo-buildpacks_icu/icu
2024-03-18T16:54:34.22-0500 [STG/] OUT Completed in 0s
2024-03-18T16:54:34.22-0500 [STG/] OUT
2024-03-18T16:54:34.24-0500 [STG/] OUT Paketo Buildpack for .NET Execute 0.14.29
2024-03-18T16:54:34.24-0500 [STG/] OUT Generating SBOM for /workspace
2024-03-18T16:54:34.28-0500 [STG/] OUT Completed in 36ms
2024-03-18T16:54:34.28-0500 [STG/] OUT
2024-03-18T16:54:34.28-0500 [STG/] OUT Assigning launch processes:
2024-03-18T16:54:34.28-0500 [STG/] OUT SampleAsp (default): /workspace/SampleAsp
2024-03-18T16:54:34.28-0500 [STG/] OUT
2024-03-18T16:54:34.31-0500 [STG/] OUT Timer: Builder ran for 873.043637ms and ended at 2024-03-18T21:54:34Z
2024-03-18T16:54:37.15-0500 [STG/] OUT Warning: No cached data will be used, no cache specified.
2024-03-18T16:54:37.36-0500 [STG/] OUT Timer: Exporter started at 2024-03-18T21:54:37Z
2024-03-18T16:54:37.39-0500 [STG/] OUT Adding layer 'paketo-buildpacks/ca-certificates:helper'
2024-03-18T16:54:37.65-0500 [STG/] OUT Adding layer 'paketo-buildpacks/icu:icu'
2024-03-18T16:54:38.89-0500 [STG/] OUT Adding layer 'paketo-buildpacks/dotnet-execute:port-chooser'
2024-03-18T16:54:38.96-0500 [STG/] OUT Adding layer 'buildpacksio/lifecycle:launch.sbom'
2024-03-18T16:54:42.62-0500 [STG/] OUT Adding 1/1 app layer(s)
2024-03-18T16:54:42.69-0500 [STG/] OUT Adding layer 'buildpacksio/lifecycle:launcher'
2024-03-18T16:54:42.83-0500 [STG/] OUT Adding layer 'buildpacksio/lifecycle:config'
2024-03-18T16:54:42.83-0500 [STG/] OUT Adding layer 'buildpacksio/lifecycle:process-types'
2024-03-18T16:54:42.83-0500 [STG/] OUT Adding label 'io.buildpacks.lifecycle.metadata'
2024-03-18T16:54:42.83-0500 [STG/] OUT Adding label 'io.buildpacks.build.metadata'
2024-03-18T16:54:42.83-0500 [STG/] OUT Adding label 'io.buildpacks.project.metadata'
2024-03-18T16:54:42.83-0500 [STG/] OUT Setting default process type 'SampleAsp'
2024-03-18T16:54:42.83-0500 [STG/] OUT Timer: Saving harbor.dell.com/pcf-images/korifi/kob/d32428c9-a580-481e-addb-4120701596be-droplets... started at 2024-03-18T21:54:42Z
2024-03-18T16:54:45.32-0500 [STG/] OUT *** Images (sha256:396b002694907ea1a79a5448ead1948651616089632b0f210fc6fe1bb9aaae9a):
2024-03-18T16:54:45.32-0500 [STG/] OUT harbor.dell.com/pcf-images/korifi/kob/d32428c9-a580-481e-addb-4120701596be-droplets
2024-03-18T16:54:45.32-0500 [STG/] OUT harbor.dell.com/pcf-images/korifi/kob/d32428c9-a580-481e-addb-4120701596be-droplets:b1.20240318.215420
2024-03-18T16:54:45.32-0500 [STG/] OUT Timer: Saving harbor.dell.com/pcf-images/korifi/kob/d32428c9-a580-481e-addb-4120701596be-droplets... ran for 2.486000673s and ended at 2024-03-18T21:54:45Z
2024-03-18T16:54:45.32-0500 [STG/] OUT Timer: Exporter ran for 7.953359261s and ended at 2024-03-18T21:54:45Z
2024-03-18T16:54:46.40-0500 [STG/] OUT Build successful
2024-03-18T16:55:09.82-0500 [APP/] OUT Setting ASPNETCORE_URLS=http://0.0.0.0:8080
2024-03-18T16:55:09.83-0500 [APP/] OUT ERROR: failed to launch: path lookup: exec: "/workspace/SampleAsp": permission denied
What you expected to happen
Contents from the publish directory for the dotnet app should get deployed successfully and run without any crash along with the permission issue.
Acceptance Criteria
GIVEN : Build and Publish, when deploying the app
WHEN I : After deployment start of the app
THEN I : Crash with the permission denied error
How to reproduce it (as minimally and precisely as possible)
Create any sample hello world app, build and publish per above given command and deploy the contents of the output directory in the container.
Anything else we need to know?
No response
Environment
Revision of codebase:
Kubernetes version (use
kubectl version
):Cloud provider or hardware configuration:
Others:
The text was updated successfully, but these errors were encountered: