2

When my pm2 service is launched I get the following error:

Error: watch /usr/src/app/node_modules/zip-stream/node-modules/loadash/... ENOSCP
    at exports._errnoException (util.js:1034:11)
    at FSWatcher.start (fs.js:1400:19)
    at Object.fs.watch (fs.js:1426:11)
    at createFsWatchInstance (/usr/local/lic/node_modules/pm2/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    ....
    at FSReqWrap.oncomplete (fs.js:114:15)

This occurs only when build and run the docker with:

docker-compose --build up

If I only build the docker, and then command inside the docker:

docker-compose exec downtorrent_back_dev bash

sh start.sh

then, it starts the service without any problems.

This is the docker-compose.yml file:

version: '3'
services:
  downtorrent_back:
    container_name: downtorrent_back_dev
    build:
      context: .
      dockerfile: Dockerfile-back.dev
    volumes:
      - ./back:/usr/src/app
    expose:
      - "10002"
      - "9090"
      - "51413"
    ports:
      - "10002:10002"
      - "9090:9090"

This the script start.sh that starts the service:

#!/bin/bash

# Fix limit on system for watching files
echo fs.inotify.max_user_watches=524288 | tee -a /etc/sysctl.conf && sysctl -p
npm dedupe

# Start transmission torrent client
service transmission-daemon start
# Start service
pm2 start start.config.json --only downtorrent --env dev --no-daemon

And this is the PM2 config file:

{
  "apps": [{
    "name": "downtorrent",
    "script": "./app.js",
    "watch": true,
    "ignoreWatch": ["newrelic_agent.log"],
    "instances": 2,
        "log_date_format" : "DD-MM-YYYY HH:mm Z",
    "exec_mode": "cluster",
    "env": {
      "NODE_ENV": "dev",
      "APP_PORT": 10002
    }
  }]
}

As you can see, I've already tried the proposed solution in this question for the ENOSCP problem, but still not working.

Community
  • 1
  • 1
daniegarcia254
  • 1,157
  • 4
  • 17
  • 36
  • Have you perhaps found a solution to this by now? The problem still seems to be present – Koy Feb 09 '23 at 08:46
  • @Koy no, I didn't find a solution back in the day, and since then, it has become a dead project for me, so...don't know the current status of it – daniegarcia254 Feb 10 '23 at 08:25
  • For what it's worth, in my case it seemed to be completely unrelated to node or pm2 entirely, but rather it was my docker builder cache eating up a lot of space because I'd constantly been building images :D. Occasionally running docker builder prune solved it – Koy Mar 13 '23 at 15:58

0 Answers0