Resolution
Restart the Tentacle service on the affected target machine. This releases the stale lock and lets the waiting deployments proceed. It works for Listening and Polling Tentacles. The restart may cancel the task that is currently stuck on that target.
Symptom
A deployment sits at a step with a Wait log entry that never finishes:
Waiting for the script in task XXXXX to finish as this script requires that no other Octopus scripts are executing on this target at the same time.
When you open the task ID from the message (for example /app#/Spaces-X/tasks/XXXXX), Octopus shows:
Resource is not found or it doesn't exist in the current space context. Please contact your administrator for more information.
Scope: when this is the right article
Use this article if all of the following are true:
- A deployment or a runbook is stuck on a "Waiting for the script in task XXXXX to finish..." message.
- The task ID opens a "Resource is not found..." error.
- The target uses a Tentacle and you can access the machine to restart its service.
If the ID in the message links to a real, running task, that task is the blocker. Let it finish or cancel it instead.
Cause
Octopus runs only one script at a time on a given target. A script that is stuck, or cancelled but not yet released, keeps holding that lock on the Tentacle. Every other task for that target then waits behind it. The task ID in the message may not correspond to any task you can find, so you can't identify the blocker from the UI. This is tracked in Wait message references an ID with no matching task (GitHub issue #10134).
Diagnosis and fix
-
In Octopus, open the waiting deployment's task log and note the target name shown in the step.
-
Check Tasks for any other running task on that target. If one exists, let it finish or cancel it, then check whether the waiting task proceeds. If no real task exists, continue.
-
Sign in to the target machine that the waiting step names.
-
Restart the Tentacle service.
-
Open the Tentacle Manager app, and select Restart
- Or open the Services app, find OctopusDeploy Tentacle, and click restart.
-
Or using the Tentacle.exe command line command
tentacle service --restart -
Wait for the service to start. A Polling Tentacle will reconnect to the Octopus Server on its next poll.
Please note: restarting the service may cancel the task currently stuck on this target. Re-run that deployment afterwards if needed.
Verify
- In Octopus, go to Infrastructure → Deployment Targets, open the target, and confirm its health check passes.
- Open the waiting deployment's task log. The "Waiting for the script..." entry should clear and the step should continue, or the stuck task should show as cancelled.
- Queue a new deployment to the same target and confirm it starts without waiting.