Dokploy / Dokploy/dokploy

Container crash loop after successful deployment — no notification triggered

Open
#4,339 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
37.4k
Forks
3k
Avg merge
1d 3h
Merged PRs (30d)
73

Description

Title: Container crash loop after successful deployment — no notification triggered

Description

When a deployment completes successfully (build + push to registry succeed and
container starts) but the container immediately crashes due to a runtime error,
Dokploy continues to report the deployment as "successful" and does not send any
notifications. The container enters a restart loop (Docker restart policy keeps
trying), but no alert is sent to the configured notification channels (Slack,
Email, etc.).

This is a real production blind spot — the deployment dashboard shows green,
notifications confirm "deployment successful," but the actual app is down.

Image

Reproduction steps

  1. Configure notifications (Email, Slack, or any) for "Deployment Failed"
    and "Deployment Success" events
  2. Push code to a connected repo with a runtime error that only manifests
    after build (e.g., missing environment variable, missing file in standalone
    build, broken database connection)
  3. Wait for Dokploy to build and deploy
  4. Build completes successfully → "Deployment Success" notification fires
  5. Container starts but crashes within seconds
  6. Container restarts repeatedly (visible in Logs tab — multiple "exited X
    seconds ago" entries)
  7. No notification is sent about the crash loop

Expected behavior

I should receive a notification when:

  • Container exits unexpectedly (non-zero exit code)
  • Container restarts more than N times within M minutes (configurable)
  • Health check fails consistently

Actual behavior

Notifications only fire for build/deploy events. Runtime container failures
are not surfaced through the notification system.

My setup

  • Dokploy version: [check Settings → About]
  • Server: [Contabo VPS / similar]
  • App type: Next.js standalone
  • Notification channels configured: [Slack/Email/etc]

Real scenario from my deployment

Today I deployed an updated Next.js + Payload CMS app. Build succeeded,
deployment notification was sent. The container crash-looped due to
ERR_MODULE_NOT_FOUND for payload.config.ts — Payload couldn't find its
config file in the standalone build. I had no idea this was happening
until I manually checked the Logs tab and saw 5 containers had exited
in the past minute.

Without external monitoring (UptimeRobot, etc.), there's no way to know
the production app is down despite the deployment "succeeding."

Suggested solutions

A few options the team might consider:

  1. Container restart count alerts: Notify when a container restarts more
    than N times within M minutes (configurable threshold)
  2. Health check integration: When a health check is configured and fails
    for X consecutive checks, fire a notification
  3. Container exit code monitoring: Notify on any non-zero exit, not just
    build/deploy events
  4. "Stable run" notification: Only fire "deployment successful"
    notification after the container has been running stably for N seconds
    (e.g., 60s)

Option 4 might be the cleanest — it changes the meaning of "deployment
successful" from "container started" to "container is stably running."

Workarounds I'm using

  • External uptime monitor (UptimeRobot) hitting a /api/health endpoint
  • Manual check of the Logs tab after every deployment

Happy to provide more details, logs, or test fixes if that helps.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how deployment success and failure notifications are emitted, then compare that with the container exits visible in the Logs tab. Decide which runtime signal should define a notification and how thresholds or health-check failures are configured. Done means a reproducible crash loop or sustained health-check failure produces the intended notification without falsely reporting success.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, next.js, typescript
Domain
devops, observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.