R
Railwayβ€’3y ago
meadowhawk

Converting Java app from Heroku Buildpack to Nixpacks

PID: 17ea4c42-9f2e-4000-9f45-4e8f49a32b4c Hi I am attempting to switch off the heroku builder but switching to Nixpack didn't go as expected. (all I did was change builder and run) The build exited with the following error
#8 ERROR: executor failed running [/bin/bash -ol pipefail -c nix-env -if .nixpacks/nixpkgs-a0b7e70db7a55088d3de0cc370a59f9fbcc906c3.nix && nix-collect-garbage -d]: exit code: 100

-----
> [stage-0 4/7] RUN nix-env -if .nixpacks/nixpkgs-a0b7e70db7a55088d3de0cc370a59f9fbcc906c3.nix && nix-collect-garbage -d:
-----
executor failed running [/bin/bash -ol pipefail -c nix-env -if .nixpacks/nixpkgs-a0b7e70db7a55088d3de0cc370a59f9fbcc906c3.nix && nix-collect-garbage -d]: exit code: 100

Error: Docker build failed
#8 ERROR: executor failed running [/bin/bash -ol pipefail -c nix-env -if .nixpacks/nixpkgs-a0b7e70db7a55088d3de0cc370a59f9fbcc906c3.nix && nix-collect-garbage -d]: exit code: 100

-----
> [stage-0 4/7] RUN nix-env -if .nixpacks/nixpkgs-a0b7e70db7a55088d3de0cc370a59f9fbcc906c3.nix && nix-collect-garbage -d:
-----
executor failed running [/bin/bash -ol pipefail -c nix-env -if .nixpacks/nixpkgs-a0b7e70db7a55088d3de0cc370a59f9fbcc906c3.nix && nix-collect-garbage -d]: exit code: 100

Error: Docker build failed
9 Replies
Percy
Percyβ€’3y ago
Project ID: 17ea4c42-9f2e-4000-9f45-4e8f49a32b4c
jr
jrβ€’3y ago
Hi @meadowhawk, I think the issue may be that you have the NIXPACKS_PKGS variable set to jdk. This is resulting in conflicting Java versions
meadowhawk
meadowhawkOPβ€’3y ago
hey thanks for the response! OK so that got me closer, I deleted the value and got to running a build but I'm now getting permission denied while running gradle build.
#10 [stage-0 6/7] RUN --mount=type=cache,id=s/01840f60-dc5d-413b-ad13-7e7e5bdb8770-/root/gradle,target=/root/.gradle ./gradlew build -x check
#10 sha256:1feffe6e3107b40201a72aacb9bb8c5e3fc248b437cd69a98aba499db631919d

#10 0.527 /bin/bash: line 1: ./gradlew: Permission denied
#10 ERROR: executor failed running [/bin/bash -ol pipefail -c ./gradlew build -x check]: exit code: 126
-----
> [stage-0 6/7] RUN --mount=type=cache,id=s/01840f60-dc5d-413b-ad13-7e7e5bdb8770-/root/gradle,target=/root/.gradle ./gradlew build -x check:

-----

executor failed running [/bin/bash -ol pipefail -c ./gradlew build -x check]: exit code: 126
#10 [stage-0 6/7] RUN --mount=type=cache,id=s/01840f60-dc5d-413b-ad13-7e7e5bdb8770-/root/gradle,target=/root/.gradle ./gradlew build -x check
#10 sha256:1feffe6e3107b40201a72aacb9bb8c5e3fc248b437cd69a98aba499db631919d

#10 0.527 /bin/bash: line 1: ./gradlew: Permission denied
#10 ERROR: executor failed running [/bin/bash -ol pipefail -c ./gradlew build -x check]: exit code: 126
-----
> [stage-0 6/7] RUN --mount=type=cache,id=s/01840f60-dc5d-413b-ad13-7e7e5bdb8770-/root/gradle,target=/root/.gradle ./gradlew build -x check:

-----

executor failed running [/bin/bash -ol pipefail -c ./gradlew build -x check]: exit code: 126
Can I build the app in the container or do I have to upload an already build jar file?
jr
jrβ€’3y ago
You can build the app in the container How would you normally build it locally?
meadowhawk
meadowhawkOPβ€’3y ago
I would run 'gradlew build' which does look like what its trying to do. I wonder if gradlew which is in the project repo requires a chmod +x to make it executable? perhaps that is the cause of the permission denied?
jr
jrβ€’3y ago
Very likely. Can you try giving it executable permissions and deploying? This is something that Nixpacks should be doing however
meadowhawk
meadowhawkOPβ€’3y ago
cool OK I'll give that a try and let ya know how it goes, thanks! yup that did it! Guess Nixpack needs to chmod the file when someone forges to do that or just print out the message for the user to go add +x. πŸ™‚ anyway thanks for the help, you guys are awesome!
jr
jrβ€’3y ago
Awesome! Glad that fixed it πŸ˜„ We will definitely make the upstream Nixpacks change
meadowhawk
meadowhawkOPβ€’3y ago
cool, yeah its a million little things I am sure!
Want results from more Discord servers?
Add your server