{"record":{"id":"06ada638a84705eb","repo":"louislam/dockge","slug":"failed-to-restart-please-check-the-terminal-outpu","errorCode":null,"errorMessage":"Failed to restart, please check the terminal output for more information.","messagePattern":"Failed to restart, please check the terminal output for more information\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"backend/stack.ts","lineNumber":443,"sourceCode":"            throw new Error(\"Failed to start, please check the terminal output for more information.\");\n        }\n        return exitCode;\n    }\n\n    async stop(socket: DockgeSocket) : Promise<number> {\n        const terminalName = getComposeTerminalName(socket.endpoint, this.name);\n        let exitCode = await Terminal.exec(this.server, socket, terminalName, \"docker\", this.getComposeOptions(\"stop\"), this.path);\n        if (exitCode !== 0) {\n            throw new Error(\"Failed to stop, please check the terminal output for more information.\");\n        }\n        return exitCode;\n    }\n\n    async restart(socket: DockgeSocket) : Promise<number> {\n        const terminalName = getComposeTerminalName(socket.endpoint, this.name);\n        let exitCode = await Terminal.exec(this.server, socket, terminalName, \"docker\", this.getComposeOptions(\"restart\"), this.path);\n        if (exitCode !== 0) {\n            throw new Error(\"Failed to restart, please check the terminal output for more information.\");\n        }\n        return exitCode;\n    }\n\n    async down(socket: DockgeSocket) : Promise<number> {\n        const terminalName = getComposeTerminalName(socket.endpoint, this.name);\n        let exitCode = await Terminal.exec(this.server, socket, terminalName, \"docker\", this.getComposeOptions(\"down\"), this.path);\n        if (exitCode !== 0) {\n            throw new Error(\"Failed to down, please check the terminal output for more information.\");\n        }\n        return exitCode;\n    }\n\n    async update(socket: DockgeSocket) {\n        const terminalName = getComposeTerminalName(socket.endpoint, this.name);\n        let exitCode = await Terminal.exec(this.server, socket, terminalName, \"docker\", this.getComposeOptions(\"pull\"), this.path);\n        if (exitCode !== 0) {\n            throw new Error(\"Failed to pull, please check the terminal output for more information.\");","sourceCodeStart":425,"sourceCodeEnd":461,"githubUrl":"https://github.com/louislam/dockge/blob/f809ae192b571944ad773e9866d3e67064ae8043/backend/stack.ts#L425-L461","documentation":"Stack.restart() runs 'docker compose restart' and throws this Error when it exits non-zero; details go to the compose terminal. restart re-creates processes in place, so it fails differently from up/down (e.g. it doesn't pull images or apply compose.yaml changes).","triggerScenarios":"compose restart exits non-zero: daemon/runtime error, container can't be stopped then started again, compose project lookup fails, resource exhaustion on the host.","commonSituations":"Restarting after editing compose.yaml expecting changes to apply (restart ignores edits — must deploy/up instead); wedged container after host OOM; daemon hiccup during restart.","solutions":["Read the compose terminal output for the docker error","If you changed compose.yaml, use Deploy/Up (compose up -d) instead of Restart — restart does not apply config changes","Check host resources (memory/disk) and docker daemon health","Force-recreate via 'docker compose up -d --force-recreate' if restart keeps failing"],"exampleFix":"// before\nawait stack.restart(socket); // config edits not applied, may fail\n// after\nif (composeYAMLChanged) {\n    await stack.deploy(socket); // compose up -d applies changes\n} else {\n    await stack.restart(socket);\n}","handlingStrategy":"validation","validationCode":"function needsRecreate(composeYAMLChanged: boolean): boolean {\n    // compose restart does NOT apply compose.yaml changes\n    return composeYAMLChanged;\n}\nif (needsRecreate(yamlChanged)) {\n    await stack.deploy(socket); // compose up -d applies changes\n} else {\n    await stack.restart(socket);\n}","typeGuard":"function restartedOk(exitCode: number | undefined): boolean {\n    return exitCode === 0;\n}","tryCatchPattern":"try {\n    await stack.restart(socket);\n} catch (e) {\n    log.error(\"restart\", \"Restart failed — if compose.yaml changed use deploy (up -d), else check daemon/container state\");\n    throw e;\n}","preventionTips":["Use Deploy/Up after editing compose.yaml — Restart ignores edits","Check host memory/disk before mass restarts","Avoid restarting during daemon maintenance windows","Use up -d --force-recreate when restart is unreliable"],"tags":["docker","docker-compose","restart","terminal"],"backgroundTag":"docker-compose-restart-failed","analyzedSha":"f809ae192b571944ad773e9866d3e67064ae8043","analyzedAt":"2026-08-31T19:13:50.919Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}