Dokploy/dokploy · error · Error

${message}

Error message

${message}

What it means

runCommand in the scheduler executes a shell command (locally or remotely via execAsyncRemote) and throws the combined output as the error message when the command fails; it also appends a ❌ line to the deployment log. The message content is whatever the command printed to stdout/stderr.

Source

Thrown at packages/server/src/utils/schedules/utils.ts:94

			if (!containerId) {
				const target =
					scheduleType === "compose"
						? `service '${serviceName}' of compose '${compose?.name}'`
						: `application '${application?.appName}'`;
				const message = `Container not found for ${target}, make sure the service is running`;
				if (serverId) {
					await execAsyncRemote(
						serverId,
						`echo ${quote([`❌ ${message}`])} >> ${quote([deployment.logPath])}`,
					);
				} else {
					const writeStream = createWriteStream(deployment.logPath, {
						flags: "a",
					});
					writeStream.write(`❌ ${message}\n`);
					writeStream.end();
				}
				throw new Error(message);
			}

			if (serverId) {
				await execAsyncRemote(
					serverId,
					`
					set -e
					echo "Running scheduled command" >> ${quote([deployment.logPath])};
					docker exec ${quote([containerId])} ${quote([shellType])} -c ${quote([command])} >> ${quote([deployment.logPath])} 2>> ${quote([deployment.logPath])} || {
						echo "❌ Command failed" >> ${quote([deployment.logPath])};
						exit 1;
					}
					echo "✅ Command executed successfully" >> ${quote([deployment.logPath])};
					`,
				);
			} else {
				const writeStream = createWriteStream(deployment.logPath, {
					flags: "a",

View on GitHub (pinned to 546686ea35)

Solutions

  1. Read the full message: it contains the command's stderr explaining the failure
  2. Run the same command manually (or via execAsyncRemote on the target server) to reproduce
  3. Fix the underlying script/binary/path issue the message points to
  4. Verify remote server connectivity and SSH credentials when serverId is involved
Defensive patterns

Strategy: try-catch

Validate before calling

if (serverId) {
  await execAsyncRemote(serverId, 'echo ok'); // connectivity precheck
}

Try / catch

try {
  await runCommand(...);
} catch (e) {
  const log = e instanceof Error ? e.message : String(e);
  // message contains command stderr; run it manually to reproduce
}

Prevention

When it happens

Trigger: Scheduled job's command exits non-zero: missing binary, bad path, failed build/deploy step, or remote server unreachable when serverId is set.

Common situations: Cron-style schedule firing after a server rebuild where paths changed; app deploy command failing due to compile errors; remote server offline or SSH connection dropped.


AI-assisted analysis of Dokploy/dokploy@546686ea35 (2026-08-27). Data as JSON: /api/errors/b28027cb08075464. Report an issue: GitHub.