Dokploy/dokploy · critical · TRPCError

INTERNAL_SERVER_ERROR

INTERNAL_SERVER_ERROR

Error message

Error on deploy mysql${error}

What it means

deployMySql runs the docker deployment (e.g. docker compose up / container creation) and on any thrown error marks the service as applicationStatus 'error' and rethrows as INTERNAL_SERVER_ERROR with 'Error on deploy mysql' plus the raw error text (note: no space — template is `Error on deploy mysql${error}`).

Source

Thrown at packages/server/src/services/mysql.ts:164

				mysql.serverId,
				`docker pull ${quote([mysql.dockerImage])}`,
				onData,
			);
		} else {
			await pullImage(mysql.dockerImage, onData);
		}

		await buildMysql(mysql);
		await updateMySqlById(mysqlId, {
			applicationStatus: "done",
		});
		onData?.("Deployment completed successfully!");
	} catch (error) {
		onData?.(`Error: ${error}`);
		await updateMySqlById(mysqlId, {
			applicationStatus: "error",
		});
		throw new TRPCError({
			code: "INTERNAL_SERVER_ERROR",
			message: `Error on deploy mysql${error}`,
		});
	}
	return mysql;
};

View on GitHub (pinned to 546686ea35)

Solutions

  1. Read the appended error text and server logs to get the docker-level cause (docker ps -a, docker logs, journalctl -u docker)
  2. Fix the specific docker issue: free the port, remove orphan containers, pull the image manually
  3. Retry the deploy once the server/docker daemon is healthy
  4. Check the service is on a server with enough disk/memory

Example fix

// after: mark status handled and inspect real cause
try {
  await deployMySql(id);
} catch (e) {
  console.error((e as TRPCError).message); // 'Error on deploy mysqlError: port is already allocated' → free the port
}
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-flight on the target server
const info = await execAsync(serverId, "docker info --format '{{.ServerVersion}}'");
if (!info.stdout.trim()) throw new Error("docker daemon unreachable");

Try / catch

try { await deployMySql(mysqlId, onData); } catch (e) { logger.error((e as TRPCError).message); await checkServiceStatus(mysqlId); /* status is already 'error' */ throw e; }

Prevention

When it happens

Trigger: Docker daemon unreachable on the target server, image pull failure, port already allocated, invalid mount/network referenced by the generated compose config, out of disk space.

Common situations: Server restarted and dockerd not up yet, registry rate limits on pulling mysql image, conflicting container name from a previous failed deploy, wrong docker socket permissions.

Related errors


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