{"record":{"id":"7e03763dc83a4cb6","repo":"slimtoolkit/slim","slug":"ambiguous-start-command-cannot-use-app-name-app","errorCode":null,"errorMessage":"ambiguous start command: cannot use [app_name,app_args] and [app_entrypoint,app_cmd] simultaneously","messagePattern":"ambiguous start command: cannot use \\[app_name,app_args\\] and \\[app_entrypoint,app_cmd\\] simultaneously","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/app/sensor/execution/standalone.go","lineNumber":142,"sourceCode":"\t// of the standalone mode, the need for supporting Docker's original\n\t// CMD[] + ENTRYPOINT[] approach arose. However, to keep things simple:\n\t//\n\t//  - These two \"modes\" of starting the target app will be mutually exclusive\n\t//    (from the sensor's users standpoint).\n\t//  - The CMD + ENTRYPOINT mode will be converted back to the AppName + AppArgs\n\t//    early on in the sensor's processing (to prevent cascading changes).\n\n\t// First, check if there is a run-time override of the CMD[] part\n\t// (i.e., anything after the `--` separator).\n\t// If there is some, it'll essentially \"activate\" the CMD + ENTRYPOINT mode.\n\tif args := flag.Args(); len(args) > 0 {\n\t\tcmd.AppCmd = args\n\t}\n\n\t// If it's ENTRYPOINT + CMD mode, converting back to AppName + AppArgs.\n\tif len(cmd.AppEntrypoint)+len(cmd.AppCmd) > 0 {\n\t\tif len(cmd.AppName)+len(cmd.AppArgs) > 0 {\n\t\t\treturn cmd, errors.New(\"ambiguous start command: cannot use [app_name,app_args] and [app_entrypoint,app_cmd] simultaneously\")\n\t\t}\n\n\t\tif len(cmd.AppEntrypoint) > 0 {\n\t\t\tcmd.AppName = cmd.AppEntrypoint[0]\n\t\t\tcmd.AppArgs = append(cmd.AppEntrypoint[1:], cmd.AppCmd...)\n\t\t} else {\n\t\t\tcmd.AppName = cmd.AppCmd[0]\n\t\t\tcmd.AppArgs = cmd.AppCmd[1:]\n\t\t}\n\t}\n\n\treturn cmd, nil\n}\n","sourceCodeStart":124,"sourceCodeEnd":156,"githubUrl":"https://github.com/slimtoolkit/slim/blob/81940d17fa112cc678e32209214bcb2355cb3004/pkg/app/sensor/execution/standalone.go#L124-L156","documentation":"This error is raised in readCommandFile (called by NewStandalone) when a start command specifies the [app_name, app_args] style and the [app_entrypoint, app_cmd] style at the same time. The two forms are mutually exclusive ways to describe the target process, so the parser refuses to guess and converts ENTRYPOINT+CMD into AppName+AppArgs only when no AppName/AppArgs are present.","triggerScenarios":"Providing both app_name/app_args and app_entrypoint/app_cmd keys in the command file passed to NewStandalone; e.g., a generated command file that accumulated fields from two different configuration paths.","commonSituations":"Migrating configs from ENTRYPOINT+CMD style to APPNAME style without removing old keys; tooling that always serializes both fields; hand-edited command JSON with leftover keys.","solutions":["Remove either the app_name/app_args fields or the app_entrypoint/app_cmd fields from the command file","Prefer app_entrypoint+app_cmd if you want Dockerfile-like semantics (first entrypoint element becomes app name)","Prefer app_name+app_args for a single explicit executable","Regenerate the command file with the slim tooling rather than hand-editing"],"exampleFix":"// before (command file)\n{\"app_name\": \"myapp\", \"app_args\": [\"-v\"], \"app_entrypoint\": \"/usr/bin/myapp\", \"app_cmd\": [\"-v\"]}\n// after\n{\"app_entrypoint\": \"/usr/bin/myapp\", \"app_cmd\": [\"-v\"]}","handlingStrategy":"validation","validationCode":"// Go: ensure the two start-command forms are not both set\nfunc hasBothForms(cmd StartCommand) bool {\n    return (cmd.AppName != \"\" || len(cmd.AppArgs) > 0) &&\n           (len(cmd.AppEntrypoint) > 0 || len(cmd.AppCmd) > 0)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Emit exactly one of app_name/app_args or app_entrypoint/app_cmd in generated command files","Validate command files before handing them to NewStandalone","Clear legacy keys when migrating between the two styles"],"tags":["configuration","sensor","dockerfile-semantics","go"],"backgroundTag":"ambiguous-command-config","analyzedSha":"81940d17fa112cc678e32209214bcb2355cb3004","analyzedAt":"2026-08-31T23:06:12.682Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}