To Reproduce
Bug Report: Scheduled Task Continues Running After Server Update While Dokploy Shows It as Cancelled
Description
I found an issue related to scheduled tasks during a Dokploy server update.
When a Dokploy server update is performed while a scheduled task (Cron/Scheduled Job) is currently running, the task continues executing in the background even after the server comes back online. However, Dokploy incorrectly reports that the scheduled task was cancelled, and the service status becomes Stopped, requiring a manual redeploy.
This creates a mismatch between the actual runtime state and the state shown in the Dokploy UI.
Steps to Reproduce
- Deploy a service that contains a scheduled task (Cron Job).
- Start a scheduled task that runs for a noticeable amount of time.
- While the scheduled task is still running, perform a Dokploy server update.
- Wait for the server to restart and become available again.
- Open the service in the Dokploy dashboard.
Expected Behavior
-
Running scheduled tasks should either:
- be gracefully terminated during the update, or
- be properly tracked after the server restarts.
-
The Dokploy UI should accurately reflect the actual state of the scheduled task.
-
The service should remain in a consistent state without requiring manual intervention.
Actual Behavior
- The scheduled task continues running in the background after the server update.
- Dokploy marks the scheduled task as Cancelled.
- The service status is shown as Stopped.
- The UI no longer reflects the actual running background process.
- The service must be manually redeployed to restore the correct state.
Impact
This can lead to:
- Incorrect monitoring information.
- Confusion about whether scheduled jobs are still executing.
- Background processes continuing without being visible in the UI.
- Risk of duplicate executions if the user restarts or redeploys the service, assuming the original job has stopped.
Environment
- Dokploy Version: (please fill in)
- Docker Version: (please fill in)
- Operating System: (please fill in)
- Deployment Type: (VPS/Dedicated Server/etc.)
Additional Information
It appears that after the Dokploy server update, the scheduler or process state is not synchronized with the actual running container/process. The UI reports the scheduled task as cancelled even though the underlying process continues to execute in the background.
This seems to be a state synchronization issue between Dokploy and the running scheduled task after the server update.
Current vs. Expected behavior
Following the steps described above, I expected Dokploy to either gracefully stop the running scheduled task during the server update or correctly track its state after the server restarted.
Instead, I observed that:
- The scheduled task continues running in the background even after the Dokploy server update is completed.
- In the Dokploy UI, the scheduled task is marked as Cancelled, even though the process is still actively running.
- The service status is shown as Stopped, despite the background task continuing to execute.
- To restore the service to a normal state, I have to manually redeploy it.
This results in an inconsistent state between the actual running process and what Dokploy reports in the UI. It can also lead to confusion and potentially duplicate job executions if the service is redeployed while the original scheduled task is still running.
Provide environment information
Operating System:
OS: Ubuntu 20.04
Arch: arm64
Dokploy version:
0.29.14
VPS Provider:
Hostinger
What applications/services are you trying to deploy?
Docker Compose application with a scheduled (Cron) task for python image.
Which area(s) are affected? (Select all that apply)
Application
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
No response
Will you send a PR to fix it?
No
To Reproduce
Bug Report: Scheduled Task Continues Running After Server Update While Dokploy Shows It as Cancelled
Description
I found an issue related to scheduled tasks during a Dokploy server update.
When a Dokploy server update is performed while a scheduled task (Cron/Scheduled Job) is currently running, the task continues executing in the background even after the server comes back online. However, Dokploy incorrectly reports that the scheduled task was cancelled, and the service status becomes Stopped, requiring a manual redeploy.
This creates a mismatch between the actual runtime state and the state shown in the Dokploy UI.
Steps to Reproduce
Expected Behavior
Running scheduled tasks should either:
The Dokploy UI should accurately reflect the actual state of the scheduled task.
The service should remain in a consistent state without requiring manual intervention.
Actual Behavior
Impact
This can lead to:
Environment
Additional Information
It appears that after the Dokploy server update, the scheduler or process state is not synchronized with the actual running container/process. The UI reports the scheduled task as cancelled even though the underlying process continues to execute in the background.
This seems to be a state synchronization issue between Dokploy and the running scheduled task after the server update.
Current vs. Expected behavior
Following the steps described above, I expected Dokploy to either gracefully stop the running scheduled task during the server update or correctly track its state after the server restarted.
Instead, I observed that:
This results in an inconsistent state between the actual running process and what Dokploy reports in the UI. It can also lead to confusion and potentially duplicate job executions if the service is redeployed while the original scheduled task is still running.
Provide environment information
Which area(s) are affected? (Select all that apply)
Application
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
No response
Will you send a PR to fix it?
No