Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: Unable to deploy to Openshift #5412

Closed
2 tasks done
victorcarnaval opened this issue Apr 15, 2024 · 1 comment
Closed
2 tasks done

🐛 Bug Report: Unable to deploy to Openshift #5412

victorcarnaval opened this issue Apr 15, 2024 · 1 comment
Labels

Comments

@victorcarnaval
Copy link

📜 Description

Some scripts that are run as root user, such as npm i pm2 -g, are not feasible on the OpenShift infrastructure due to non-root rules. Is it possible to adopt a different approach without changing the OpenShift user policies? Are you considering modifying the base image to one that already includes PM2?

👟 Reproduction steps

  1. Apply the following deployment file with the Novu API image on OpenShift.
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: novu-api
  name: novu-api
spec:
  replicas: 1
  selector:
    matchLabels:
      app: novu-api
  template:
    metadata:
      labels:
        app: novu-api
    spec:
      containers:
        - envFrom:
            - configMapRef:
                name: novu-cfg
          image: ghcr.io/novuhq/novu/api:0.22.0
          name: api
          livenessProbe:
            httpGet:
              path: /v1/health-check
              port: 3000
            initialDelaySeconds: 300
            periodSeconds: 300
          resources:
            limits:
              cpu: 400m
              memory: 500Mi
            requests:
              cpu: 200m
              memory: 200Mi

👍 Expected behavior

The pod is expected to start without any errors.

👎 Actual Behavior with Screenshots

Error: EACCES: permission denied, mkdir '/.pm2/logs'
    at Object.mkdirSync (node:fs:1382:3)
    at mkdirpNativeSync (/usr/local/lib/node_modules/pm2/node_modules/mkdirp/lib/mkdirp-native.js:29:10)
    at Function.mkdirpSync [as sync] (/usr/local/lib/node_modules/pm2/node_modules/mkdirp/index.js:21:7)
    at module.exports.Client.initFileStructure (/usr/local/lib/node_modules/pm2/lib/Client.js:133:25)
    at new module.exports (/usr/local/lib/node_modules/pm2/lib/Client.js:38:8)
    at new API (/usr/local/lib/node_modules/pm2/lib/API.js:107:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/pm2/index.js:11:18)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
Error: EACCES: permission denied, mkdir '/.pm2/pids'
    at Object.mkdirSync (node:fs:1382:3)
    at mkdirpNativeSync (/usr/local/lib/node_modules/pm2/node_modules/mkdirp/lib/mkdirp-native.js:29:10)
    at Function.mkdirpSync [as sync] (/usr/local/lib/node_modules/pm2/node_modules/mkdirp/index.js:21:7)
    at module.exports.Client.initFileStructure (/usr/local/lib/node_modules/pm2/lib/Client.js:141:25)
    at new module.exports (/usr/local/lib/node_modules/pm2/lib/Client.js:38:8)
    at new API (/usr/local/lib/node_modules/pm2/lib/API.js:107:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/pm2/index.js:11:18)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
Error: ENOENT: no such file or directory, open '/.pm2/module_conf.json'
    at Object.openSync (node:fs:590:3)
    at Object.writeFileSync (node:fs:2202:35)
    at module.exports.Client.initFileStructure (/usr/local/lib/node_modules/pm2/lib/Client.js:149:10)
    at new module.exports (/usr/local/lib/node_modules/pm2/lib/Client.js:38:8)
    at new API (/usr/local/lib/node_modules/pm2/lib/API.js:107:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/pm2/index.js:11:18)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
Error: EACCES: permission denied, mkdir '/.pm2/modules'
    at Object.mkdirSync (node:fs:1382:3)
    at mkdirpNativeSync (/usr/local/lib/node_modules/pm2/node_modules/mkdirp/lib/mkdirp-native.js:29:10)
    at Function.mkdirpSync [as sync] (/usr/local/lib/node_modules/pm2/node_modules/mkdirp/index.js:21:7)
    at module.exports.Client.initFileStructure (/usr/local/lib/node_modules/pm2/lib/Client.js:157:25)
    at new module.exports (/usr/local/lib/node_modules/pm2/lib/Client.js:38:8)
    at new API (/usr/local/lib/node_modules/pm2/lib/API.js:107:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/pm2/index.js:11:18)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
Error: ENOENT: no such file or directory, open '/.pm2/module_conf.json'
    at Object.openSync (node:fs:590:3)
    at Object.readFileSync (node:fs:458:35)
    at Object.Configuration.getAllSync (/usr/local/lib/node_modules/pm2/lib/Configuration.js:299:26)
    at Object.Configuration.getSync (/usr/local/lib/node_modules/pm2/lib/Configuration.js:270:30)
    at new API (/usr/local/lib/node_modules/pm2/lib/API.js:116:44)
    at Object.<anonymous> (/usr/local/lib/node_modules/pm2/index.js:11:18)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
Error: EACCES: permission denied, mkdir '/.pm2/logs'
    at Object.mkdirSync (node:fs:1382:3)
    at mkdirpNativeSync (/usr/local/lib/node_modules/pm2/node_modules/mkdirp/lib/mkdirp-native.js:29:10)
    at Function.mkdirpSync [as sync] (/usr/local/lib/node_modules/pm2/node_modules/mkdirp/index.js:21:7)
    at module.exports.Client.initFileStructure (/usr/local/lib/node_modules/pm2/lib/Client.js:133:25)
    at new module.exports (/usr/local/lib/node_modules/pm2/lib/Client.js:38:8)
    at new API (/usr/local/lib/node_modules/pm2/lib/API.js:107:19)
    at Object.instanciate (/usr/local/lib/node_modules/pm2/lib/binaries/Runtime4Docker.js:65:16)
    at Command.<anonymous> (/usr/local/lib/node_modules/pm2/lib/binaries/Runtime4Docker.js:54:13)
    at Command.listener (/usr/local/lib/node_modules/pm2/node_modules/commander/index.js:315:8)
    at Command.emit (node:events:513:28)
Error: EACCES: permission denied, mkdir '/.pm2/pids'
    at Object.mkdirSync (node:fs:1382:3)
    at mkdirpNativeSync (/usr/local/lib/node_modules/pm2/node_modules/mkdirp/lib/mkdirp-native.js:29:10)
    at Function.mkdirpSync [as sync] (/usr/local/lib/node_modules/pm2/node_modules/mkdirp/index.js:21:7)
    at module.exports.Client.initFileStructure (/usr/local/lib/node_modules/pm2/lib/Client.js:141:25)
    at new module.exports (/usr/local/lib/node_modules/pm2/lib/Client.js:38:8)
    at new API (/usr/local/lib/node_modules/pm2/lib/API.js:107:19)
    at Object.instanciate (/usr/local/lib/node_modules/pm2/lib/binaries/Runtime4Docker.js:65:16)
    at Command.<anonymous> (/usr/local/lib/node_modules/pm2/lib/binaries/Runtime4Docker.js:54:13)
    at Command.listener (/usr/local/lib/node_modules/pm2/node_modules/commander/index.js:315:8)
    at Command.emit (node:events:513:28)
Error: ENOENT: no such file or directory, open '/.pm2/module_conf.json'
    at Object.openSync (node:fs:590:3)
    at Object.writeFileSync (node:fs:2202:35)
    at module.exports.Client.initFileStructure (/usr/local/lib/node_modules/pm2/lib/Client.js:149:10)
    at new module.exports (/usr/local/lib/node_modules/pm2/lib/Client.js:38:8)
    at new API (/usr/local/lib/node_modules/pm2/lib/API.js:107:19)
    at Object.instanciate (/usr/local/lib/node_modules/pm2/lib/binaries/Runtime4Docker.js:65:16)
    at Command.<anonymous> (/usr/local/lib/node_modules/pm2/lib/binaries/Runtime4Docker.js:54:13)
    at Command.listener (/usr/local/lib/node_modules/pm2/node_modules/commander/index.js:315:8)
    at Command.emit (node:events:513:28)
    at Command.parseArgs (/usr/local/lib/node_modules/pm2/node_modules/commander/index.js:651:12)
Error: EACCES: permission denied, mkdir '/.pm2/modules'
    at Object.mkdirSync (node:fs:1382:3)
    at mkdirpNativeSync (/usr/local/lib/node_modules/pm2/node_modules/mkdirp/lib/mkdirp-native.js:29:10)
    at Function.mkdirpSync [as sync] (/usr/local/lib/node_modules/pm2/node_modules/mkdirp/index.js:21:7)
    at module.exports.Client.initFileStructure (/usr/local/lib/node_modules/pm2/lib/Client.js:157:25)
    at new module.exports (/usr/local/lib/node_modules/pm2/lib/Client.js:38:8)
    at new API (/usr/local/lib/node_modules/pm2/lib/API.js:107:19)
    at Object.instanciate (/usr/local/lib/node_modules/pm2/lib/binaries/Runtime4Docker.js:65:16)
    at Command.<anonymous> (/usr/local/lib/node_modules/pm2/lib/binaries/Runtime4Docker.js:54:13)
    at Command.listener (/usr/local/lib/node_modules/pm2/node_modules/commander/index.js:315:8)
    at Command.emit (node:events:513:28)
Error: ENOENT: no such file or directory, open '/.pm2/module_conf.json'
    at Object.openSync (node:fs:590:3)
    at Object.readFileSync (node:fs:458:35)
    at Object.Configuration.getAllSync (/usr/local/lib/node_modules/pm2/lib/Configuration.js:299:26)
    at Object.Configuration.getSync (/usr/local/lib/node_modules/pm2/lib/Configuration.js:270:30)
    at new API (/usr/local/lib/node_modules/pm2/lib/API.js:116:44)
    at Object.instanciate (/usr/local/lib/node_modules/pm2/lib/binaries/Runtime4Docker.js:65:16)
    at Command.<anonymous> (/usr/local/lib/node_modules/pm2/lib/binaries/Runtime4Docker.js:54:13)
    at Command.listener (/usr/local/lib/node_modules/pm2/node_modules/commander/index.js:315:8)
    at Command.emit (node:events:513:28)
    at Command.parseArgs (/usr/local/lib/node_modules/pm2/node_modules/commander/index.js:651:12)
2024-04-15T19:25:28: PM2 error: Error: ENOENT: no such file or directory, open '/.pm2/module_conf.json'
    at Object.openSync (node:fs:590:3)
    at Object.readFileSync (node:fs:458:35)
    at Object.Configuration.getAllSync (/usr/local/lib/node_modules/pm2/lib/Configuration.js:299:26)
    at Object.Configuration.getSync (/usr/local/lib/node_modules/pm2/lib/Configuration.js:270:30)
    at Object.God.init (/usr/local/lib/node_modules/pm2/lib/God.js:71:38)
    at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/God.js:574:5)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
2024-04-15T19:25:28: PM2 log: Launching in no daemon mode
2024-04-15T19:25:28: PM2 error: Error: ENOENT: no such file or directory, open '/.pm2/pm2.pid'
    at Object.openSync (node:fs:590:3)
    at Object.writeFileSync (node:fs:2202:35)
    at module.exports.Daemon.innerStart (/usr/local/lib/node_modules/pm2/lib/Daemon.js:91:8)
    at /usr/local/lib/node_modules/pm2/lib/Client.js:78:14
    at /usr/local/lib/node_modules/pm2/lib/Client.js:321:14
    at processTicksAndRejections (node:internal/process/task_queues:78:11)
    at runNextTicks (node:internal/process/task_queues:65:3)
    at listOnTimeout (node:internal/timers:528:9)
    at processTimers (node:internal/timers:502:7)

Novu version

0.22 (self-hosted on Openshift)

npm version

10.5.0

node version

v20.11.1

📃 Provide any additional context for the Bug.

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to submit PR?

Yes I am willing to submit a PR!

Copy link

linear bot commented Apr 15, 2024

@linear linear bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2024
@AliaksandrRyzhou AliaksandrRyzhou removed their assignment Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants