build command does not work all suddenly

nanoscalesimulationsTRIAL

a year ago

For a month ago, i updated some code, pushed it to origin master and Railway will there after update itself from the new push - and everything worked fine.
But now it wont have a succesfull build, it says the start command does not work AKA npm run setup-production. But i have not changed anything in my server.js nor package.json on the server.

3 Replies

a year ago

please provide actual logs / error messages


nanoscalesimulationsTRIAL

a year ago

ls
Build Logs
Deploy Logs

Filter
Filter logs using "", (), AND, OR, -

[Region: us-west1]

==============

Using Nixpacks

==============
context: 34a4f0f4fc4cf4e1ee9db9a5e97cd386

╔═══════════ Nixpacks v1.21.2 ══════════╗

║ setup │ nodejs18, npm-9x ║

║───────────────────────────────────────║

║ install │ npm ci ║

║───────────────────────────────────────║

║ build │ npm run setup-production ║

║───────────────────────────────────────║

║ start │ node server.js ║

╚═══════════════════════════════════════╝

0 building with "default" instance using docker driver

1 [internal] load build definition from Dockerfile

1 transferring dockerfile: 2.58kB done

1 DONE 0.0s

2 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1707782610

2 DONE 0.3s

3 [stage-0 1/15] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1707782610@sha256:8f4b0fd95dc3311cf9a59f236d8d7d7f956fe21a2a1d64b53c82f12c4e859f09

3 DONE 0.0s

4 [stage-0 2/15] 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: 16.07MB 0.1s done

6 DONE 0.2s

7 [stage-0 3/10] COPY .nixpacks/nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix .nixpacks/nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix

7 CACHED

8 [stage-0 4/10] RUN nix-env -if .nixpacks/nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix && nix-collect-garbage -d

8 CACHED

9 [stage-0 5/10] COPY . /app/.

9 DONE 0.1s

10 [stage-0 6/10] RUN --mount=type=cache,id=s/24a236d5-c04e-4bc7-9264-803a4837b136-/root/npm,target=/root/.npm npm ci

12 37.60 npm

WARN config production Use --omit=dev instead.

12 37.67

12 37.67 > nanoscale@1.0.0 build-client

12 37.67 > cd client && npm run build

12 37.67

12 38.02 npm

WARN config production Use --omit=dev instead.

12 38.09

12 38.09 > nanoscale@0.1.0 build

12 38.09 > react-scripts build

12 38.09

12 39.92 Creating an optimized production build…

12 44.00 One of your dependencies, babel-preset-react-app, is importing the

12 44.00 "@babel/plugin-proposal-private-property-in-object" package without

12 44.00 declaring it in its dependencies. This is currently working because

12 44.00 "@babel/plugin-proposal-private-property-in-object" is already in your

12 44.00 node_modules folder for unrelated reasons, but it may break at any time.

12 44.00

12 44.00 babel-preset-react-app is part of the create-react-app project, which

12 44.00 is not maintianed anymore. It is thus unlikely that this bug will

12 44.00 ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to

12 44.00 your devDependencies to work around this error. This will make this message

12 44.00 go away.

12 44.00

12 131.4

12 131.4 Treating warnings as errors because process.env.CI = true.

12 131.4 Most CI servers set it automatically.

12 131.4

12 131.4 Failed to compile.

12 131.4

12 131.4 [eslint]

12 131.4 src/pages/Home.js

12 131.4 Line 16:10: 'FaLongArrowAltRight' is defined but never used no-unused-vars

12 131.4

12 131.4

12 ERROR: process "/bin/bash -ol pipefail -c npm run setup-production" did not complete successfully: exit code: 1

[stage-0 8/10] RUN --mount=type=cache,id=s/24a236d5-c04e-4bc7-9264-803a4837b136-nodemodules/cache,target=/app/nodemodules/.cache npm run setup-production:

131.4 Treating warnings as errors because process.env.CI = true.

131.4 Most CI servers set it automatically.

131.4

131.4 Failed to compile.

131.4

131.4 [eslint]

131.4 src/pages/Home.js

131.4 Line 16:10: 'FaLongArrowAltRight' is defined but never used no-unused-vars

131.4

131.4

Dockerfile:24

22 | # build phase

23 | COPY . /app/.

24 | >>> RUN --mount=type=cache,id=s/24a236d5-c04e-4bc7-9264-803a4837b136-nodemodules/cache,target=/app/nodemodules/.cache npm run setup-production

25 |

26 |

ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm run setup-production" did not complete successfully: exit code: 1

Error: Docker build failed


nanoscalesimulationsTRIAL

a year ago

But the buildcustom command setup-production works locally though and the start command with the server file.
its exactly the same as the last succesful build..

JSON

{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "npm run setup-production"
},
"deploy": {
"numReplicas": 1,
"startCommand": "node server.js",
"sleepApplication": false,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}