Nodejs server takes up too long to host

Hey, Im trying to host simple express nodejs server, after deployment it freezes on this build log, it took literally 8 minutes like that and after that it deployed, but why? it was never doing like that Project Id: 35d80b31-b3e7-44ab-b79d-a61fdf8d83f8
26 Replies
Percy
Percy2y ago
Project ID: N/A
yaviscoke
yaviscokeOP2y ago
maybe second one will help me
yaviscoke
yaviscokeOP2y ago
this is build log that is where it freezes maybe I know the reason I have miltiple folder
project/
client/
console/
server/
project/
client/
console/
server/
so I try to host server/ so can it be the issue that railway also hosts client and console?
yaviscoke
yaviscokeOP2y ago
I've this in root directory
yaviscoke
yaviscokeOP2y ago
so maybe it should be fixing issue
#10 [stage-0 6/10] COPY . /app/.
#10 sha256:a892376723fdcf4dd1e580202c1c3f35b535da63aa2ad253b6a20b061fe0a5c9
#10 CACHED

#11 [stage-0 7/10] RUN --mount=type=cache,id=s/6cbde450-9e3a-4e0f-902b-648762901537-/root/npm,target=/root/.npm npm ci
#11 sha256:e0fcf73168c4ce3a90f33d77d6744adfb72858baba15ac9c7d8ac97d4db8014d
#11 CACHED

#9 [stage-0 5/10] RUN printf '\nPATH=/app/node_modules/.bin:$PATH' >> /root/.profile
#9 sha256:4601eb78ee915d1a9b6bd4468d4cfd3dd0700fd5f06ae94fea14f5ef0e404d8f
#9 CACHED

#12 [stage-0 8/10] COPY . /app/.
#12 sha256:1c0892267bd252fd9a54eddce188c5c2c14487f4997a5f928a68ca4db3f9f42f
#12 CACHED

#13 [stage-0 9/10] RUN --mount=type=cache,id=s/6cbde450-9e3a-4e0f-902b-648762901537-node_modules/cache,target=/app/node_modules/.cache node index.js
#13 sha256:7a6e93ed657539654cb59470f4bf000257142936e5f67c8885462908d3412b7d

#13 1.685 [START] Server Listens Port 8000

#13 4.196 [START] Database connected

#13 ...

#8 [stage-0 4/10] RUN nix-env -if .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix && nix-collect-garbage -d
#8 sha256:8140e2522bbb55a00c2bf23712f267b5b893cdb2c2ecfa314e2afd5874ed7687
#8 CACHED


#13 [stage-0 9/10] RUN --mount=type=cache,id=s/6cbde450-9e3a-4e0f-902b-648762901537-node_modules/cache,target=/app/node_modules/.cache node index.js
#13 sha256:7a6e93ed657539654cb59470f4bf000257142936e5f67c8885462908d3412b7d
#10 [stage-0 6/10] COPY . /app/.
#10 sha256:a892376723fdcf4dd1e580202c1c3f35b535da63aa2ad253b6a20b061fe0a5c9
#10 CACHED

#11 [stage-0 7/10] RUN --mount=type=cache,id=s/6cbde450-9e3a-4e0f-902b-648762901537-/root/npm,target=/root/.npm npm ci
#11 sha256:e0fcf73168c4ce3a90f33d77d6744adfb72858baba15ac9c7d8ac97d4db8014d
#11 CACHED

#9 [stage-0 5/10] RUN printf '\nPATH=/app/node_modules/.bin:$PATH' >> /root/.profile
#9 sha256:4601eb78ee915d1a9b6bd4468d4cfd3dd0700fd5f06ae94fea14f5ef0e404d8f
#9 CACHED

#12 [stage-0 8/10] COPY . /app/.
#12 sha256:1c0892267bd252fd9a54eddce188c5c2c14487f4997a5f928a68ca4db3f9f42f
#12 CACHED

#13 [stage-0 9/10] RUN --mount=type=cache,id=s/6cbde450-9e3a-4e0f-902b-648762901537-node_modules/cache,target=/app/node_modules/.cache node index.js
#13 sha256:7a6e93ed657539654cb59470f4bf000257142936e5f67c8885462908d3412b7d

#13 1.685 [START] Server Listens Port 8000

#13 4.196 [START] Database connected

#13 ...

#8 [stage-0 4/10] RUN nix-env -if .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix && nix-collect-garbage -d
#8 sha256:8140e2522bbb55a00c2bf23712f267b5b893cdb2c2ecfa314e2afd5874ed7687
#8 CACHED


#13 [stage-0 9/10] RUN --mount=type=cache,id=s/6cbde450-9e3a-4e0f-902b-648762901537-node_modules/cache,target=/app/node_modules/.cache node index.js
#13 sha256:7a6e93ed657539654cb59470f4bf000257142936e5f67c8885462908d3412b7d
Finn
Finn2y ago
What's the table at the top loo like I can see that the logs say server started...
yaviscoke
yaviscokeOP2y ago

╔═════════ Nixpacks v1.4.0 ═════════╗
║ setup │ nodejs-16_x, npm-8_x ║
║───────────────────────────────────║
║ install │ npm ci ║
║───────────────────────────────────║
║ build │ node index.js ║
║───────────────────────────────────║
║ start │ npm run start ║
╚═══════════════════════════════════╝

╔═════════ Nixpacks v1.4.0 ═════════╗
║ setup │ nodejs-16_x, npm-8_x ║
║───────────────────────────────────║
║ install │ npm ci ║
║───────────────────────────────────║
║ build │ node index.js ║
║───────────────────────────────────║
║ start │ npm run start ║
╚═══════════════════════════════════╝
did u mean this?
==============
Using Nixpacks
==============
context: 829eb695b27261b6eea5850cfd6b9054

╔═════════ Nixpacks v1.4.0 ═════════╗
║ setup │ nodejs-16_x, npm-8_x ║
║───────────────────────────────────║
║ install │ npm ci ║
║───────────────────────────────────║
║ build │ node index.js ║
║───────────────────────────────────║
║ start │ npm run start ║
╚═══════════════════════════════════╝


#1 [internal] load build definition from Dockerfile

#1 sha256:0e68aac7b6b10d589b2e7b571153ee5ee1ed50d7f76945ae0a935065136cb606
#1 transferring dockerfile: 2.40kB done
#1 DONE 0.0s

#2 [internal] load .dockerignore
#2 sha256:a138e020156693f6f4a877a0f4e52da1bdf66a0f293b37e9cc681f81f3b23d04
#2 transferring context: 2B done
#2 DONE 0.0s

#3 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1675123887
#3 sha256:9d31f583d9ab20c30bd28e4ececbb10e93dd12feaa73c6ea2547339b1c8114f5

#3 DONE 0.3s

#4 [stage-0 1/8] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1675123887@sha256:333533685bd20add1a7cf3f4c9142c9775e207bb13a0fb8150471182cfe78d5d
#4 sha256:cea519024678006fcf77fa980bab1c515e434288be34814c6a7883c5a535bc7a
#4 DONE 0.0s

#5 [stage-0 2/8] WORKDIR /app/
#5 sha256:8a2728349c4dca0cbfe99c7a43344101bf52e7b3fd086e87a928a471b6406ab9
#5 CACHED

#6 [internal] load build context
#6 sha256:c6646a0db83281fe80a4e3c46b3fc7570d9886664cc84ed0cd2a189558627935

#6 transferring context: 210.79kB done
#6 DONE 0.0s

#7 [stage-0 3/10] COPY .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix
#7 sha256:76c1b34a8bf59010972f89335b1cba97089f01c31b03fa12f1cbf3e33e5c8b88
#7 CACHED

#8 [stage-0 4/10] RUN nix-env -if .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix && nix-collect-garbage -d
#8 sha256:8140e2522bbb55a00c2bf23712f267b5b893cdb2c2ecfa314e2afd5874ed7687
#8 CACHED

#10 [stage-0 6/10] COPY . /app/.
#10 sha256:a892376723fdcf4dd1e580202c1c3f35b535da63aa2ad253b6a20b061fe0a5c9
#10 CACHED

#11 [stage-0 7/10] RUN --mount=type=cache,id=s/6cbde450-9e3a-4e0f-902b-648762901537-/root/npm,target=/root/.npm npm ci
#11 sha256:e0fcf73168c4ce3a90f33d77d6744adfb72858baba15ac9c7d8ac97d4db8014d
#11 CACHED

#9 [stage-0 5/10] RUN printf '\nPATH=/app/node_modules/.bin:$PATH' >> /root/.profile
#9 sha256:4601eb78ee915d1a9b6bd4468d4cfd3dd0700fd5f06ae94fea14f5ef0e404d8f
#9 CACHED

#12 [stage-0 8/10] COPY . /app/.
#12 sha256:1c0892267bd252fd9a54eddce188c5c2c14487f4997a5f928a68ca4db3f9f42f
#12 CACHED

#13 [stage-0 9/10] RUN --mount=type=cache,id=s/6cbde450-9e3a-4e0f-902b-648762901537-node_modules/cache,target=/app/node_modules/.cache node index.js
#13 sha256:7a6e93ed657539654cb59470f4bf000257142936e5f67c8885462908d3412b7d

#13 1.685 [START] Server Listens Port 8000

#13 4.196 [START] Database connected

#13 ...

#8 [stage-0 4/10] RUN nix-env -if .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix && nix-collect-garbage -d
#8 sha256:8140e2522bbb55a00c2bf23712f267b5b893cdb2c2ecfa314e2afd5874ed7687
#8 CACHED


#13 [stage-0 9/10] RUN --mount=type=cache,id=s/6cbde450-9e3a-4e0f-902b-648762901537-node_modules/cache,target=/app/node_modules/.cache node index.js
#13 sha256:7a6e93ed657539654cb59470f4bf000257142936e5f67c8885462908d3412b7d

BuildImage timeout, Retrying...
==============
Using Nixpacks
==============
context: 829eb695b27261b6eea5850cfd6b9054

╔═════════ Nixpacks v1.4.0 ═════════╗
║ setup │ nodejs-16_x, npm-8_x ║
║───────────────────────────────────║
║ install │ npm ci ║
║───────────────────────────────────║
║ build │ node index.js ║
║───────────────────────────────────║
║ start │ npm run start ║
╚═══════════════════════════════════╝


#1 [internal] load build definition from Dockerfile

#1 sha256:0e68aac7b6b10d589b2e7b571153ee5ee1ed50d7f76945ae0a935065136cb606
#1 transferring dockerfile: 2.40kB done
#1 DONE 0.0s

#2 [internal] load .dockerignore
#2 sha256:a138e020156693f6f4a877a0f4e52da1bdf66a0f293b37e9cc681f81f3b23d04
#2 transferring context: 2B done
#2 DONE 0.0s

#3 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1675123887
#3 sha256:9d31f583d9ab20c30bd28e4ececbb10e93dd12feaa73c6ea2547339b1c8114f5

#3 DONE 0.3s

#4 [stage-0 1/8] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1675123887@sha256:333533685bd20add1a7cf3f4c9142c9775e207bb13a0fb8150471182cfe78d5d
#4 sha256:cea519024678006fcf77fa980bab1c515e434288be34814c6a7883c5a535bc7a
#4 DONE 0.0s

#5 [stage-0 2/8] WORKDIR /app/
#5 sha256:8a2728349c4dca0cbfe99c7a43344101bf52e7b3fd086e87a928a471b6406ab9
#5 CACHED

#6 [internal] load build context
#6 sha256:c6646a0db83281fe80a4e3c46b3fc7570d9886664cc84ed0cd2a189558627935

#6 transferring context: 210.79kB done
#6 DONE 0.0s

#7 [stage-0 3/10] COPY .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix
#7 sha256:76c1b34a8bf59010972f89335b1cba97089f01c31b03fa12f1cbf3e33e5c8b88
#7 CACHED

#8 [stage-0 4/10] RUN nix-env -if .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix && nix-collect-garbage -d
#8 sha256:8140e2522bbb55a00c2bf23712f267b5b893cdb2c2ecfa314e2afd5874ed7687
#8 CACHED

#10 [stage-0 6/10] COPY . /app/.
#10 sha256:a892376723fdcf4dd1e580202c1c3f35b535da63aa2ad253b6a20b061fe0a5c9
#10 CACHED

#11 [stage-0 7/10] RUN --mount=type=cache,id=s/6cbde450-9e3a-4e0f-902b-648762901537-/root/npm,target=/root/.npm npm ci
#11 sha256:e0fcf73168c4ce3a90f33d77d6744adfb72858baba15ac9c7d8ac97d4db8014d
#11 CACHED

#9 [stage-0 5/10] RUN printf '\nPATH=/app/node_modules/.bin:$PATH' >> /root/.profile
#9 sha256:4601eb78ee915d1a9b6bd4468d4cfd3dd0700fd5f06ae94fea14f5ef0e404d8f
#9 CACHED

#12 [stage-0 8/10] COPY . /app/.
#12 sha256:1c0892267bd252fd9a54eddce188c5c2c14487f4997a5f928a68ca4db3f9f42f
#12 CACHED

#13 [stage-0 9/10] RUN --mount=type=cache,id=s/6cbde450-9e3a-4e0f-902b-648762901537-node_modules/cache,target=/app/node_modules/.cache node index.js
#13 sha256:7a6e93ed657539654cb59470f4bf000257142936e5f67c8885462908d3412b7d

#13 1.685 [START] Server Listens Port 8000

#13 4.196 [START] Database connected

#13 ...

#8 [stage-0 4/10] RUN nix-env -if .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix && nix-collect-garbage -d
#8 sha256:8140e2522bbb55a00c2bf23712f267b5b893cdb2c2ecfa314e2afd5874ed7687
#8 CACHED


#13 [stage-0 9/10] RUN --mount=type=cache,id=s/6cbde450-9e3a-4e0f-902b-648762901537-node_modules/cache,target=/app/node_modules/.cache node index.js
#13 sha256:7a6e93ed657539654cb59470f4bf000257142936e5f67c8885462908d3412b7d

BuildImage timeout, Retrying...
that the whole logs
Finn
Finn2y ago
Does your project need a build command? ( Is it pure js )?
yaviscoke
yaviscokeOP2y ago
yeah its pure
Finn
Finn2y ago
Nice just set the environment variable NIXPACKS_BUILD_CMD to be empty
yaviscoke
yaviscokeOP2y ago
i was hosting it normally but what happened now idk
Finn
Finn2y ago
In the environment variable tab
yaviscoke
yaviscokeOP2y ago
okay
Finn
Finn2y ago
( or if you have configured the build command manually remove that )
yaviscoke
yaviscokeOP2y ago
like that right?
Finn
Finn2y ago
Ya
yaviscoke
yaviscokeOP2y ago
oh my god
Finn
Finn2y ago
In the settings tab did you set any setting called build command?
yaviscoke
yaviscokeOP2y ago
i had that in build
Finn
Finn2y ago
Who's god Ya Remove that lol
yaviscoke
yaviscokeOP2y ago
lol
Finn
Finn2y ago
I hope your package.json has a start a script
yaviscoke
yaviscokeOP2y ago
I thought that was starting command where i was writing yeah its hosted now thanks
Finn
Finn2y ago
Perfect
Want results from more Discord servers?
Add your server