R
Railway15mo ago
Draak

Unchanged repo fails to deploy on env var change.

I had this exact setup running last night, and this morning when I changed an environment variable it failed. For debugging I made my start command this:
pwd && ls . && ls bin && ./bin/tklbot
pwd && ls . && ls bin && ./bin/tklbot
Output from deploy logs:
/app
bin
tklbot
/bin/bash: line 1: ./bin/tklbot: No such file or directory
/app
bin
tklbot
/bin/bash: line 1: ./bin/tklbot: No such file or directory
Which seems a little contradictory. My full nixpacks.toml:
[phases.setup]
nixPkgs = ["binutils", "gcc", "rust-bin.stable.latest.default"]

[phases.build]
cmds = ["mkdir -p bin", "cargo build --release", "cp target/release/tklbot bin"]

[start]
cmd = "pwd && ls . && ls bin && ./bin/tklbot"
[phases.setup]
nixPkgs = ["binutils", "gcc", "rust-bin.stable.latest.default"]

[phases.build]
cmds = ["mkdir -p bin", "cargo build --release", "cp target/release/tklbot bin"]

[start]
cmd = "pwd && ls . && ls bin && ./bin/tklbot"
Relevant Cargo.toml sections: (I'm building several binaries with the default /bin module naming.)
[package]
name = "tklbot"
version = "0.3.2"
edition = "2021"
default-run = "tklbot"

[lib]
name = "tklbot"
path = "src/lib.rs"

[[bin]]
name = "tklbot"
path = "src/main.rs"
[package]
name = "tklbot"
version = "0.3.2"
edition = "2021"
default-run = "tklbot"

[lib]
name = "tklbot"
path = "src/lib.rs"

[[bin]]
name = "tklbot"
path = "src/main.rs"
Solution:
Whelp, turns out in my env var shuffle, I dropped NIXPACKS_NO_MUSL=1 which was the root cause. Things are working again. I'd normally ask for a better error but I'm not sure this one would be particularly easy to put into the system.
Jump to solution
3 Replies
Percy
Percy15mo ago
Project ID: 2090e121-cc62-4fbe-9114-5349121f7893
Draak
DraakOP15mo ago
2090e121-cc62-4fbe-9114-5349121f7893 rolling back to the previous successful deployment also doesn't work, so I'm a little dead in the water. Still can't figure this one out. Poking around the image built locally with nixpacks build . shows that /bin/sh ./bin/tklbot results in cannot execute binary file. Thought that could mean it's not built for the right architecture, or that bash can't resolve the absolute path but explicitly specifying both yielded the same results. The nixpacks documentation is pretty sparse, and there isn't much activity in the discord so I'm feeling cornered into building my own docker image before deploying.
Solution
Draak
Draak15mo ago
Whelp, turns out in my env var shuffle, I dropped NIXPACKS_NO_MUSL=1 which was the root cause. Things are working again. I'd normally ask for a better error but I'm not sure this one would be particularly easy to put into the system.
Want results from more Discord servers?
Add your server