#Deployment error Nestjs (node) ENOSPC

1 messages · Page 1 of 1 (latest)

stark smelt
#

I migrate my app from Heroku to Railway a week ago. My made the first deployment and everything works OK. Now I made the first commit to the main branch and because of the trigger (by Github) the deployment/build is trigger but a I keep getting and build error which I search in the internet and all the answer are related to "increase the limit of inotify watchers on your system".
This is the build error:

#13 7.102     at FSWatcher.<computed> (node:internal/fs/watchers:244:19)
#13 7.102     at Object.watch (node:fs:2301:34)
#13 7.102     at createFsWatchInstance (/app/node_modules/chokidar/lib/nodefs-handler.js:119:15)
#13 7.102     at setFsWatchListener (/app/node_modules/chokidar/lib/nodefs-handler.js:166:15)
#13 7.102     at NodeFsHandler._watchWithNodeFs (/app/node_modules/chokidar/lib/nodefs-handler.js:331:14)
#13 7.102     at NodeFsHandler._handleFile (/app/node_modules/chokidar/lib/nodefs-handler.js:395:23)
#13 7.102     at NodeFsHandler._addToNodeFs (/app/node_modules/chokidar/lib/nodefs-handler.js:637:21)
#13 7.102 Emitted 'error' event on FSWatcher instance at:
#13 7.102     at FSWatcher._handleError (/app/node_modules/chokidar/index.js:647:10)
#13 7.102     at NodeFsHandler._addToNodeFs (/app/node_modules/chokidar/lib/nodefs-handler.js:645:18) {
#13 7.102   errno: -28,
#13 7.102   syscall: 'watch',
#13 7.102   code: 'ENOSPC',
#13 7.102   path: '/app/src/email/img/confirmacionCuerpo.png',
#13 7.102   filename: '/app/src/email/img/confirmacionCuerpo.png'
#13 7.102 }
#13 ERROR: executor failed running [/bin/bash -ol pipefail -c npm run build]: exit code: 1
 
-----
> [stage-0 9/9] RUN --mount=type=cache,id=s/89c7db64-8cf1-4911-b34e-829524bc70d8-node_modules/cache,target=node_modules/.cache npm run build:
-----
executor failed running [/bin/bash -ol pipefail -c npm run build]: exit code: 1
 
Error: Docker build failed
oak steeple
#

What's your build command/script? @stark smelt

stark smelt
#

the default: "npm run start:prod"

oak steeple
#

what's npm run start:prod set to?

#

And you sure this is your build command?

stark smelt
#

wait think I left the default "yarn run build"

#

is that ok?

oak steeple
#

Not here, check your package.json

#

What's your build script set to?

stark smelt
#

I assume would be "nest build"

oak steeple
# stark smelt

Paste sudo sysctl fs.inotify.max_user_watches=524288 && npm run build over there ^

stark smelt
#

it failed

#
#13 [stage-0 9/9] RUN --mount=type=cache,id=s/89c7db64-8cf1-4911-b34e-829524bc70d8-node_modules/cache,target=node_modules/.cache npm run build
#13 sha256:798bad2c6175d1be169b1ad7f0da70aba76e034ba62009db18d79019a537eed1
 
#13 1.221 npm WARN config production Use `--omit=dev` instead.
#13 1.241
#13 1.241 > [email protected] prebuild
#13 1.241 > rimraf dist
#13 1.241
#13 1.324
#13 1.324 > [email protected] build
#13 1.324 > sudo sysctl fs.inotify.max_user_watches=524288 && npm run build
#13 1.324
 
#13 1.342 sudo: sysctl: command not found
#13 ERROR: executor failed running [/bin/bash -ol pipefail -c npm run build]: exit code: 1
 
-----
> [stage-0 9/9] RUN --mount=type=cache,id=s/89c7db64-8cf1-4911-b34e-829524bc70d8-node_modules/cache,target=node_modules/.cache npm run build:
-----
executor failed running [/bin/bash -ol pipefail -c npm run build]: exit code: 1
 
Error: Docker build failed ```
stark smelt
#

I have to add that in this folder "System limit for number of file watchers reached, watch '/app/src/email/img/" I only have 3 images, so It's kind of weird to reach the limit of space

stark smelt
shrewd raven
#

Does nest touch anything related to those files in the build step?

fast ermine
#

could you create an example repo to reproduce this issue?