{"record":{"id":"08630043ec243738","repo":"louislam/dockge","slug":"please-enter-a-docker-run-command","errorCode":null,"errorMessage":"Please enter a docker run command","messagePattern":"Please enter a docker run command","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"frontend/src/pages/DashboardHome.vue","lineNumber":249,"sourceCode":"                }\n            });\n        },\n\n        getStatusNum(statusName) {\n            let num = 0;\n\n            for (let stackName in this.$root.completeStackList) {\n                const stack = this.$root.completeStackList[stackName];\n                if (statusNameShort(stack.status) === statusName) {\n                    num += 1;\n                }\n            }\n            return num;\n        },\n\n        convertDockerRun() {\n            if (this.dockerRunCommand.trim() === \"docker run\") {\n                throw new Error(\"Please enter a docker run command\");\n            }\n\n            // composerize is working in dev, but after \"vite build\", it is not working\n            // So pass to backend to do the conversion\n            this.$root.getSocket().emit(\"composerize\", this.dockerRunCommand, (res) => {\n                if (res.ok) {\n                    this.$root.composeTemplate = res.composeTemplate;\n                    this.$router.push(\"/compose\");\n                } else {\n                    this.$root.toastRes(res);\n                }\n            });\n        },\n\n        /**\n         * Updates the displayed records when a new important heartbeat arrives.\n         * @param {object} heartbeat - The heartbeat object received.\n         * @returns {void}","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/louislam/dockge/blob/f809ae192b571944ad773e9866d3e67064ae8043/frontend/src/pages/DashboardHome.vue#L231-L267","documentation":"In frontend/src/pages/DashboardHome.vue, convertDockerRun() refuses to convert a docker run command to compose when the input is effectively empty — exactly or essentially just 'docker run' with no arguments. It throws this error to stop the client from sending a pointless composerize request to the backend, since composerize cannot produce a meaningful compose file without an image or options.","triggerScenarios":"Clicking the convert button while the docker-run input contains only the placeholder/default text 'docker run' (trim() === 'docker run'), i.e. no image, ports, volumes, or flags were entered.","commonSituations":"Users clicking convert before typing anything, with the input pre-filled by the 'docker run' template; pasting whitespace that gets trimmed back to the default; UI state reset leaving the default command in place.","solutions":["Type or paste the full docker run command including the image (e.g. `docker run -d -p 8080:80 nginx`)","Clear the field and paste the complete command from your notes or shell history","Check that no leading/trailing content is missing after trimming whitespace","Retry the conversion after the command includes at least an image name"],"exampleFix":"// before\nthis.dockerRunCommand = \"docker run\";\nthis.convertDockerRun(); // throws\n// after\nconst cmd = this.dockerRunCommand.trim();\nif (cmd !== \"docker run\" && cmd.split(/\\s+/).length > 2) {\n  this.convertDockerRun();\n}","handlingStrategy":"validation","validationCode":"const cmd = this.dockerRunCommand.trim();\nif (!cmd || cmd === \"docker run\" || cmd.split(/\\s+/).length < 3) {\n  showError(\"Enter a full docker run command including the image.\");\n  return;\n}","typeGuard":null,"tryCatchPattern":"try {\n  this.convertDockerRun();\n} catch (e) {\n  if (e.message === \"Please enter a docker run command\") {\n    this.showError(\"Paste your full docker run command (e.g. docker run -d -p 80:80 nginx).\");\n  } else throw e;\n}","preventionTips":["Only enable the convert button once the input contains more than 'docker run'","Validate that the command includes an image name before converting","Clear placeholder/default text when the field receives focus","Paste complete commands from shell history to avoid truncated input"],"tags":["frontend","validation","docker-run","composerize"],"backgroundTag":"empty-input-validation","analyzedSha":"f809ae192b571944ad773e9866d3e67064ae8043","analyzedAt":"2026-08-31T19:13:50.919Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}