a year ago
Logs:
[Region: us-west1]
==============
Using Nixpacks
==============
context: c746867dc69f63e1d8cf2f2eef05d2b0
╔══════════════════ Nixpacks v1.22.0 ═════════════════╗
║ setup │ nodejs_20, bun, openssl, python38, gcc ║
║─────────────────────────────────────────────────────║
║ install │ bun i --no-save ║
║─────────────────────────────────────────────────────║
║ build │ bun run build ║
║─────────────────────────────────────────────────────║
║ start │ bun run start:production ║
╚═════════════════════════════════════════════════════╝
0 building with "default" instance using docker driver
1 [internal] load build definition from Dockerfile
1 transferring dockerfile: 3.12kB done
1 DONE 0.0s
2 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1715645001
2 DONE 0.1s
3 [stage-0 1/8] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1715645001@sha256:0adbb12760de3fbd024031e191540449b0e9003d298dbf698b6b48708750530e
3 DONE 0.0s
4 [stage-0 2/8] WORKDIR /app/
4 CACHED
5 [internal] load .dockerignore
5 transferring context: 2B done
5 DONE 0.0s
6 [internal] load build context
6 transferring context: 597.32kB 0.0s done
6 DONE 0.0s
7 [stage-0 3/10] COPY .nixpacks/nixpkgs-bf446f08bff6814b569265bef8374cfdd3d8f0e0.nix .nixpacks/nixpkgs-bf446f08bff6814b569265bef8374cfdd3d8f0e0.nix
7 CACHED
8 [stage-0 4/10] RUN nix-env -if .nixpacks/nixpkgs-bf446f08bff6814b569265bef8374cfdd3d8f0e0.nix && nix-collect-garbage -d
8 33.07 installing 'bf446f08bff6814b569265bef8374cfdd3d8f0e0-env'
8 33.67 error:
8 33.67 … while calling the 'derivationStrict' builtin
8 33.67 at :9:12:
8 33.67 8|
8 33.67 9| strict = derivationStrict drvAttrs;
8 33.67 | ^
8 33.67 10|
8 33.67
8 33.67 … while evaluating derivation 'bf446f08bff6814b569265bef8374cfdd3d8f0e0-env'
8 33.67 whose name attribute is located at /nix/store/0mh3vks8cyvqq94dhqjpx9hmx8k537gl-source/pkgs/stdenv/generic/make-derivation.nix:331:7
8 33.67
8 33.67 … while evaluating attribute 'passAsFile' of derivation 'bf446f08bff6814b569265bef8374cfdd3d8f0e0-env'
8 33.67 at /nix/store/0mh3vks8cyvqq94dhqjpx9hmx8k537gl-source/pkgs/build-support/trivial-builders/default.nix:69:9:
8 33.67 68| inherit buildCommand name;
8 33.67 69| passAsFile = [ "buildCommand" ]
8 33.67 | ^
8 33.67 70| ++ (derivationArgs.passAsFile or [ ]);
8 33.67
8 33.67 (stack trace truncated; use '--show-trace' to show the full, detailed trace)
8 33.67
8 33.67 error: undefined variable 'python38'
8 33.67 at /app/.nixpacks/nixpkgs-bf446f08bff6814b569265bef8374cfdd3d8f0e0.nix:19:35:
8 33.67 18| '')
8 33.67 19| bun gcc nodejs_20 openssl python38
8 33.67 | ^
8 33.67 20| ];
8 ERROR: process "/bin/bash -ol pipefail -c nix-env -if .nixpacks/nixpkgs-bf446f08bff6814b569265bef8374cfdd3d8f0e0.nix && nix-collect-garbage -d" did not complete successfully: exit code: 1
> ⓘ Deployment information is only viewable by project members and Railway employees.
4 Replies
a year ago
The problem is that you are trying to install an old version of Python (3.8). In your nixpacks.toml
file, can you try changing to python3
instead. This will use version 3.11 which is much newer.
a year ago
Thanks. I updated that, but it fails on a new error now. This commit did previously build. I started getting this build error after updating an env var.
10 6.460 /bin/bash: line 1: node-gyp: command not found
10 6.460
10 6.460 error: install script from "unix-dgram" exited with 127
10 ERROR: process "/bin/bash -ol pipefail -c bun i --no-save" did not complete successfully: exit code: 127
[stage-0 6/10] RUN --mount=type=cache,id=s/32b76108-4485-4302-9ca3-968d91f98d33-/root/bun,target=/root/.bun bun i --no-save:
0.444 bun install v1.1.8 (89d25807)
0.448 Resolving dependencies
0.749 Resolved, downloaded and extracted [2]
6.460 /bin/bash: line 1: node-gyp: command not found
6.460
6.460 error: install script from "unix-dgram" exited with 127
Dockerfile:20
18 | ENV NIXPACKSPATH /app/nodemodules/.bin:$NIXPACKS_PATH
19 | COPY . /app/.
20 | >>> RUN --mount=type=cache,id=s/32b76108-4485-4302-9ca3-968d91f98d33-/root/bun,target=/root/.bun bun i --no-save
21 |
22 | # build phase
ERROR: failed to solve: process "/bin/bash -ol pipefail -c bun i --no-save" did not complete successfully: exit code: 127
Error: Docker build failed
a year ago
Railway recently updated the version of Bun that is installed by default (1.1.8). This looks to have subsequently broke some builds that rely on node-gyp. The problem seems to be that node-gyp
is not found. Which is strange as I expected bun to install it as a sub-dependency. You can try adding it to the package.json
file (e.g. bun i node-gyp
). Some initial research shows that this seems to be a Bun issue that a few others are experiencing too
However, I am not ruling out that it is an issue with how we are building with Node and Bun. Could you please provide a list of the dependencies that Bun is installing so I can investigate further (sharing a slimmed down package.json
file works).
Alternatively, you can also downgrade the version of Nixpacks that Railway is using to go back to a known working version. In a railway.json
file you can add the contents
{
"$schema":"https://railway.app/railway.schema.json",
"build":{
"nixpacksVersion":"1.21.2",
}
}
This will build with the version that you were using previously.
Status changed to Solved railway[bot] • 12 months ago
a year ago
Thanks jr :) We added node-gyp to our package.json and that fixed the issue.
Here's our dependencies if that helps:
"dependencies": {
"@bloxroute/solana-trader-client-ts": "^2.1.2",
"@company-z/scarab-schema": "1.12.5",
"@coral-xyz/anchor": "^0.29.0",
"@jup-ag/api": "^6.0.19",
"@prisma/client": "^5.13.0",
"@sentry/node": "^7.113.0",
"@sentry/types": "^7.113.0",
"@solana/buffer-layout": "^4.0.1",
"@solana/spl-token": "^0.4.6",
"@solana/web3.js": "^1.91.8",
"@turnkey/api-key-stamper": "^0.4.0",
"@turnkey/http": "^2.10.0",
"@turnkey/solana": "^0.3.5",
"@turnkey/viem": "^0.4.17",
"bignumber.js": "^9.1.2",
"bs58": "^5.0.0",
"bullmq": "^5.7.8",
"debug": "^4.3.4",
"dotenv": "^16.4.5",
"fastify": "^4.26.2",
"inversify": "^6.0.2",
"ioredis": "^5.4.1",
"node-cron": "^3.0.3",
"node-gyp": "^10.1.0",
"reflect-metadata": "^0.1.14",
"repl": "^0.1.3",
"reverse-mirage": "^1.0.3",
"viem": "~2.7.22",
"winston": "^3.13.0",
"winston-syslog": "^2.7.0",
"ws": "^8.17.0",
"yn": "^5.0.0",
"zod": "^3.23.6"
},
"devDependencies": {
"@types/debug": "^4.1.12",
"@types/eslint": "^8.56.10",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.10",
"@types/node-cron": "^3.0.11",
"@types/supertest": "^2.0.12",
"@types/winston-syslog": "^2.4.3",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"chalk": "^5.3.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-simple-import-sort": "^12.1.0",
"jest": "^29.7.0",
"jest-mock-extended": "^3.0.7",
"prettier": "^3.2.5",
"prisma": "^5.13.0",
"supertest": "^6.3.4",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0",
"typescript": "^5.4.5",
"zod-prisma-types": "^3.1.6"
},
"engines": {
"node": "20.x"
}