Description
Error Message and Logs
When trying to deploy a Bun project I get the error:
--------------------
| ENV NIXPACKS_PATH=/app/node_modules/.bin:$NIXPACKS_PATH
| COPY . /app/.
| >>> RUN --mount=type=cache,id=k4kc0og00kc00wgok04g8scw-/root/bun,target=/root/.bun bun i --no-save
| # build phase
--------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c bun install --ignore-scripts" did not complete successfully: exit code: 132
After some digging and by re-using the same version of nixpacks that Coolify is using, I pin-pointed the error to be:
STEP 11/16: RUN --mount=type=cache,id=xGhFpvQL5qw-/root/bun,target=/root/.bun bun i --no-save
bun install v1.1.43 (76800b04)
2 | "lockfileVersion": 1,
^
error: Unknown lockfile version
at bun.lock:2:22
InvalidLockfileVersion: failed to parse lockfile: 'bun.lock'
Locally, when working with the project, I use Bun v1.2+ which is the version the lockfile v1 has been introduced (lockfile version was 0 before that).
When I try to rebuild project with the latest version of nixpacks it works fine.
Steps to Reproduce
- Install the latest version of Bun (v1.2.x)
- Init a simple project such as it creates a
bun.lock
file with lockVersion 1 - Try to deploy that project using the latest version of Coolify (using v4.0.0-beta.420.5 in my case)
- Observe that it fails to deploy during the dependencies installation phase (the underlying reason being that the Bun version is too old in the nixpack used and therefore do not recognize the lockfile version)
Another way of seeing the issue, if you have nix installed on your computer, you can follow steps 1 and 2, then run the following to open a nix shell with nixpacks 1.34.0 (ref):
nix shell github:nixos/nixpkgs/c5dd43934613ae0f8ff37c59f61c507c2e8f980d#nixpacks
You can then build the project: nixpacks build /path/to/bun/project
Example Repository URL
No response
Coolify Version
v4.0.0-beta.420.5
Are you using Coolify Cloud?
No (self-hosted)
Operating System and Version (self-hosted)
Ubuntu 22.04.5 LTS
Additional Information
I didn't pin-point all versions updates in the different components involved here (Bun, nixpacks, nixpackages, Coolify) but it appears to me that fixing it should technically be as simple as updating the version of Nixpacks that Coolify is using (i don't however the kind of side-impact it could have)