{"record":{"id":"d3edadd5d7570649","repo":"Dokploy/dokploy","slug":"internal-server-error-d3edad","errorCode":"INTERNAL_SERVER_ERROR","errorMessage":"Error on deploy mysql${error}","messagePattern":"Error on deploy mysql(.+?)","errorType":"exception","errorClass":"TRPCError","httpStatus":500,"severity":"critical","filePath":"packages/server/src/services/mysql.ts","lineNumber":164,"sourceCode":"\t\t\t\tmysql.serverId,\n\t\t\t\t`docker pull ${quote([mysql.dockerImage])}`,\n\t\t\t\tonData,\n\t\t\t);\n\t\t} else {\n\t\t\tawait pullImage(mysql.dockerImage, onData);\n\t\t}\n\n\t\tawait buildMysql(mysql);\n\t\tawait updateMySqlById(mysqlId, {\n\t\t\tapplicationStatus: \"done\",\n\t\t});\n\t\tonData?.(\"Deployment completed successfully!\");\n\t} catch (error) {\n\t\tonData?.(`Error: ${error}`);\n\t\tawait updateMySqlById(mysqlId, {\n\t\t\tapplicationStatus: \"error\",\n\t\t});\n\t\tthrow new TRPCError({\n\t\t\tcode: \"INTERNAL_SERVER_ERROR\",\n\t\t\tmessage: `Error on deploy mysql${error}`,\n\t\t});\n\t}\n\treturn mysql;\n};\n","sourceCodeStart":146,"sourceCodeEnd":171,"githubUrl":"https://github.com/Dokploy/dokploy/blob/546686ea3587f12ec5652217dedd9f7960fb6d15/packages/server/src/services/mysql.ts#L146-L171","documentation":"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}`).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the appended error text and server logs to get the docker-level cause (docker ps -a, docker logs, journalctl -u docker)","Fix the specific docker issue: free the port, remove orphan containers, pull the image manually","Retry the deploy once the server/docker daemon is healthy","Check the service is on a server with enough disk/memory"],"exampleFix":"// after: mark status handled and inspect real cause\ntry {\n  await deployMySql(id);\n} catch (e) {\n  console.error((e as TRPCError).message); // 'Error on deploy mysqlError: port is already allocated' → free the port\n}","handlingStrategy":"try-catch","validationCode":"// pre-flight on the target server\nconst info = await execAsync(serverId, \"docker info --format '{{.ServerVersion}}'\");\nif (!info.stdout.trim()) throw new Error(\"docker daemon unreachable\");","typeGuard":null,"tryCatchPattern":"try { await deployMySql(mysqlId, onData); } catch (e) { logger.error((e as TRPCError).message); await checkServiceStatus(mysqlId); /* status is already 'error' */ throw e; }","preventionTips":["Run docker pre-flight (daemon up, image pullable, port free) before deploy","Stream onData logs to capture the docker-level failure","Expect applicationStatus 'error' after this throw — plan recovery UX"],"tags":["mysql","deploy","docker","internal"],"backgroundTag":"docker-deploy-failed","analyzedSha":"546686ea3587f12ec5652217dedd9f7960fb6d15","analyzedAt":"2026-08-27T05:18:58.095Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}