Dockerfile doesn't exist but is causing an error
#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s
#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 1.92kB done
#2 DONE 0.0s
#3 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1684957838
#3 DONE 0.1s
#4 [stage-0 1/10] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1684957838@sha256:eb26a5ad60faad269d01ac896a4eefb5e7987040d39549dbe5d8cdfd1a830b75
#4 DONE 0.0s
#5 [internal] load build context
#5 transferring context: 196.20kB done
#5 DONE 0.0s
#6 [stage-0 2/10] WORKDIR /app/
#6 CACHED
#7 [stage-0 3/8] COPY .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix
#7 CACHED
#8 [stage-0 4/8] RUN nix-env -if .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix && nix-collect-garbage -d
#8 CACHED
#9 [stage-0 5/8] COPY . /app/.
#9 CACHED
#10 [stage-0 6/8] RUN --mount=type=cache,id=s/fcb3d32c-0355-4251-a652-117731599b75-/root/npm,target=/root/.npm npm ci
#10 0.925 npm ERR! Cannot read property '@fastify/mongodb' of undefined
#10 0.930
#10 0.930 npm ERR! A complete log of this run can be found in:
#10 0.930 npm ERR! /root/.npm/_logs/2023-06-15T03_14_40_445Z-debug.log
#10 ERROR: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 1
-----
> [stage-0 6/8] RUN --mount=type=cache,id=s/fcb3d32c-0355-4251-a652-117731599b75-/root/npm,target=/root/.npm npm ci:
#10 0.925 npm ERR! Cannot read property '@fastify/mongodb' of undefined
#10 0.930
#10 0.930 npm ERR! A complete log of this run can be found in:
#10 0.930 npm ERR! /root/.npm/_logs/2023-06-15T03_14_40_445Z-debug.log
-----
Dockerfile:20
-------------------
18 | ENV NIXPACKS_PATH /app/node_modules/.bin:$NIXPACKS_PATH
19 | COPY . /app/.
20 | >>> RUN --mount=type=cache,id=s/fcb3d32c-0355-4251-a652-117731599b75-/root/npm,target=/root/.npm npm ci
21 |
22 | # build phase
-------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 1
Error: Docker build failed
#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s
#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 1.92kB done
#2 DONE 0.0s
#3 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1684957838
#3 DONE 0.1s
#4 [stage-0 1/10] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1684957838@sha256:eb26a5ad60faad269d01ac896a4eefb5e7987040d39549dbe5d8cdfd1a830b75
#4 DONE 0.0s
#5 [internal] load build context
#5 transferring context: 196.20kB done
#5 DONE 0.0s
#6 [stage-0 2/10] WORKDIR /app/
#6 CACHED
#7 [stage-0 3/8] COPY .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix
#7 CACHED
#8 [stage-0 4/8] RUN nix-env -if .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix && nix-collect-garbage -d
#8 CACHED
#9 [stage-0 5/8] COPY . /app/.
#9 CACHED
#10 [stage-0 6/8] RUN --mount=type=cache,id=s/fcb3d32c-0355-4251-a652-117731599b75-/root/npm,target=/root/.npm npm ci
#10 0.925 npm ERR! Cannot read property '@fastify/mongodb' of undefined
#10 0.930
#10 0.930 npm ERR! A complete log of this run can be found in:
#10 0.930 npm ERR! /root/.npm/_logs/2023-06-15T03_14_40_445Z-debug.log
#10 ERROR: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 1
-----
> [stage-0 6/8] RUN --mount=type=cache,id=s/fcb3d32c-0355-4251-a652-117731599b75-/root/npm,target=/root/.npm npm ci:
#10 0.925 npm ERR! Cannot read property '@fastify/mongodb' of undefined
#10 0.930
#10 0.930 npm ERR! A complete log of this run can be found in:
#10 0.930 npm ERR! /root/.npm/_logs/2023-06-15T03_14_40_445Z-debug.log
-----
Dockerfile:20
-------------------
18 | ENV NIXPACKS_PATH /app/node_modules/.bin:$NIXPACKS_PATH
19 | COPY . /app/.
20 | >>> RUN --mount=type=cache,id=s/fcb3d32c-0355-4251-a652-117731599b75-/root/npm,target=/root/.npm npm ci
21 |
22 | # build phase
-------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 1
Error: Docker build failed
20 Replies
Project ID:
fcb3d32c-0355-4251-a652-117731599b75,fcb3d32c-0355-4251-a652-117731599b75,fcb3d32c-0355-4251-a652-117731599b75
if you didnt know, nixpacks generates a dockerfile so that it can then build an image
oh, whats the error then
cause it works hosting locally
nothing specfically related to railway
send package.json please
{
"name": "magicband",
"version": "1.0.0",
"description": "WED server",
"main": "index.js",
"scripts": {
"start": "node index.js",
"lint": "eslint ."
},
"engines": {
"node": "14.x"
},
"keywords": [],
"author": "JTmaveryk",
"license": "MIT",
"dependencies": {
"@fastify/mongodb": "^7.0.0",
"@logtail/browser": "^0.4.0",
"@logtail/js": "^0.4.0",
"@logtail/node": "^0.4.0",
"@sentry/node": "^7.55.2",
"@sentry/profiling-node": "^1.0.4",
"axios": "^1.4.0",
"dotenv": "^16.1.4",
"fastify": "^4.18.0",
"mongodb": "^5.6.0",
"noblox.js": "^4.14.1",
"pastebin-api": "^5.1.6"
},
"devDependencies": {
"eslint": "^8.42.0"
}
}
{
"name": "magicband",
"version": "1.0.0",
"description": "WED server",
"main": "index.js",
"scripts": {
"start": "node index.js",
"lint": "eslint ."
},
"engines": {
"node": "14.x"
},
"keywords": [],
"author": "JTmaveryk",
"license": "MIT",
"dependencies": {
"@fastify/mongodb": "^7.0.0",
"@logtail/browser": "^0.4.0",
"@logtail/js": "^0.4.0",
"@logtail/node": "^0.4.0",
"@sentry/node": "^7.55.2",
"@sentry/profiling-node": "^1.0.4",
"axios": "^1.4.0",
"dotenv": "^16.1.4",
"fastify": "^4.18.0",
"mongodb": "^5.6.0",
"noblox.js": "^4.14.1",
"pastebin-api": "^5.1.6"
},
"devDependencies": {
"eslint": "^8.42.0"
}
}
delete your lock file, then run
npm i --package-lock-only
same issue
context: 93b195b0ecb4e07a2d8504b836b3df2b
╔═════════ Nixpacks v1.9.0 ═════════╗
║ setup │ nodejs-14_x, npm-8_x ║
║───────────────────────────────────║
║ install │ npm ci ║
║───────────────────────────────────║
║ start │ npm start --omit=dev ║
╚═══════════════════════════════════╝
#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s
#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 1.92kB done
#2 DONE 0.0s
#3 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1684957838
#3 DONE 0.1s
#4 [ 1/12] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1684957838@sha256:eb26a5ad60faad269d01ac896a4eefb5e7987040d39549dbe5d8cdfd1a830b75
#4 DONE 0.0s
#5 [internal] load build context
#5 transferring context: 196.20kB done
#5 DONE 0.0s
#6 [stage-0 4/8] RUN nix-env -if .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix && nix-collect-garbage -d
#6 CACHED
#7 [ 2/12] WORKDIR /app/
#7 CACHED
#8 [stage-0 3/8] COPY .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix
#8 CACHED
#9 [stage-0 5/8] COPY . /app/.
#9 CACHED
#10 [stage-0 6/8] RUN --mount=type=cache,id=s/fcb3d32c-0355-4251-a652-117731599b75-/root/npm,target=/root/.npm npm ci
#10 1.439 npm
ERR! Cannot read property '@fastify/mongodb' of undefined
#10 1.466
#10 1.466 npm ERR! A complete log of this run can be found in:
#10 1.466 npm ERR! /root/.npm/_logs/2023-06-15T03_27_31_625Z-debug.log
#10 ERROR: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 1
-----
> [stage-0 6/8] RUN --mount=type=cache,id=s/fcb3d32c-0355-4251-a652-117731599b75-/root/npm,target=/root/.npm npm ci:
ERR! Cannot read property '@fastify/mongodb' of undefined
#10 1.466
#10 1.466 npm ERR! A complete log of this run can be found in:
#10 1.466 npm ERR! /root/.npm/_logs/2023-06-15T03_27_31_625Z-debug.log
-----
Dockerfile:20
-------------------
18 | ENV NIXPACKS_PATH /app/node_modules/.bin:$NIXPACKS_PATH
19 | COPY . /app/.
20 | >>> RUN --mount=type=cache,id=s/fcb3d32c-0355-4251-a652-117731599b75-/root/npm,target=/root/.npm npm ci
21 |
22 | # build phase
-------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 1
Error: Docker build failed
context: 93b195b0ecb4e07a2d8504b836b3df2b
╔═════════ Nixpacks v1.9.0 ═════════╗
║ setup │ nodejs-14_x, npm-8_x ║
║───────────────────────────────────║
║ install │ npm ci ║
║───────────────────────────────────║
║ start │ npm start --omit=dev ║
╚═══════════════════════════════════╝
#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s
#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 1.92kB done
#2 DONE 0.0s
#3 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1684957838
#3 DONE 0.1s
#4 [ 1/12] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1684957838@sha256:eb26a5ad60faad269d01ac896a4eefb5e7987040d39549dbe5d8cdfd1a830b75
#4 DONE 0.0s
#5 [internal] load build context
#5 transferring context: 196.20kB done
#5 DONE 0.0s
#6 [stage-0 4/8] RUN nix-env -if .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix && nix-collect-garbage -d
#6 CACHED
#7 [ 2/12] WORKDIR /app/
#7 CACHED
#8 [stage-0 3/8] COPY .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix
#8 CACHED
#9 [stage-0 5/8] COPY . /app/.
#9 CACHED
#10 [stage-0 6/8] RUN --mount=type=cache,id=s/fcb3d32c-0355-4251-a652-117731599b75-/root/npm,target=/root/.npm npm ci
#10 1.439 npm
ERR! Cannot read property '@fastify/mongodb' of undefined
#10 1.466
#10 1.466 npm ERR! A complete log of this run can be found in:
#10 1.466 npm ERR! /root/.npm/_logs/2023-06-15T03_27_31_625Z-debug.log
#10 ERROR: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 1
-----
> [stage-0 6/8] RUN --mount=type=cache,id=s/fcb3d32c-0355-4251-a652-117731599b75-/root/npm,target=/root/.npm npm ci:
ERR! Cannot read property '@fastify/mongodb' of undefined
#10 1.466
#10 1.466 npm ERR! A complete log of this run can be found in:
#10 1.466 npm ERR! /root/.npm/_logs/2023-06-15T03_27_31_625Z-debug.log
-----
Dockerfile:20
-------------------
18 | ENV NIXPACKS_PATH /app/node_modules/.bin:$NIXPACKS_PATH
19 | COPY . /app/.
20 | >>> RUN --mount=type=cache,id=s/fcb3d32c-0355-4251-a652-117731599b75-/root/npm,target=/root/.npm npm ci
21 |
22 | # build phase
-------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 1
Error: Docker build failed
did you do what i said tho
yep
okay, set
NIXPACKS_NO_CACHE
= 1
in the service variablesnode 14 is very outdated
it said its LTS stable
odd
what should i set it to?
18, and then update your deps to ones that dont use old versions of node
all deps are latest
set
engines.node
= 18
thenworked, ty!
that was fast
"engines": {
"node": "18"
},
"engines": {
"node": "18"
},