Skip to content

🐛 Bug Report: Novu API v2.2.0 fails to boot due to missing entry point or bad PM2 process setup in the image. #8530

@bganesh1284

Description

@bganesh1284

📜 Description

When deploying the official Novu API Docker image ghcr.io/novuhq/novu/api:2.2.0 in Kubernetes, the container fails to start properly. PM2 logs show repeated restarts, but the application never becomes responsive.
No application logs are printed, and login and API routes return 502 from the ingress controller.

👟 Reproduction steps

Deploy the official Novu API image in Kubernetes or Docker:
image: ghcr.io/novuhq/novu/api:2.2.0
No command or args override — using default startup behavior.

Wait for the container to start, then check logs:

kubectl logs
You will see repeated PM2 messages:

App [main:0] starting in -cluster mode-
App [main:0] online
App name:main id:0 disconnected
App [main:0] exited with code [0] via signal [SIGKILL]
...
Check application health via the frontend or directly:

Login attempts from the dashboard fail

API requests like POST /v1/auth/login return 502 Bad Gateway

Exec into the container and try to run the app manually:
kubectl exec -it -- /bin/sh
cd /usr/src/app
node dist/main.js
Result:
Nothing happens (silent run), or process exits without logs.
The expected startup output (e.g., “Listening on port 3000”) is missing.

👍 Expected behavior

Expected Behavior:
The API container should:
Run successfully using the default image + command
Expose /v1/auth/login, /v2/subscribers, etc.
Log startup (e.g., port binding, Mongo/Redis connect)
Novu web page open login properly

👎 Actual Behavior with Screenshots

The container runs PM2 in cluster mode
Logs only show:
App [main:X] starting in -cluster mode-
App [main:X] online
App name:main id:X disconnected
App [main:X] exited with code [0] via signal [SIGKILL]
There is no /dist/apps/api/main.js

Novu API app does not start properly

Novu version

2.2.0

npm version

No response

node version

No response

📃 Provide any additional context for the Bug.

Workaround we made to work:
We were able to get the container working by overriding the container command and args in Kubernetes:
command: ["node"]
args: ["dist/main.js"]
After applying this, the API started, login worked, and backend routes became accessible.

Environment:
Novu version: 2.2.0
Docker image: ghcr.io/novuhq/novu/api:2.2.0
Platform: Kubernetes (Helm-based)
Redis/Mongo: connected fine (validated in other versions)

could you please clarify the actual fix or did I miss anything here?

👀 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?

None

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions