{"record":{"id":"4970dae5fa938f1c","repo":"amir20/dozzle","slug":"unknown-action-s-4970da","errorCode":null,"errorMessage":"unknown action: %s","messagePattern":"unknown action: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cloud/tools_actions.go","lineNumber":128,"sourceCode":"\tcase container.Remove:\n\t\treturn \"removed\"\n\tdefault:\n\t\treturn string(action) + \"ed\"\n\t}\n}\n\nfunc resolveAction(name string) (container.ContainerAction, error) {\n\tswitch name {\n\tcase \"start_container\":\n\t\treturn container.Start, nil\n\tcase \"stop_container\":\n\t\treturn container.Stop, nil\n\tcase \"restart_container\":\n\t\treturn container.Restart, nil\n\tcase \"remove_container\":\n\t\treturn container.Remove, nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unknown action: %s\", name)\n\t}\n}\n","sourceCodeStart":110,"sourceCodeEnd":131,"githubUrl":"https://github.com/amir20/dozzle/blob/d9463cbe21874e44ab79db6fa63e746ca7d22928/internal/cloud/tools_actions.go#L110-L131","documentation":"resolveAction maps a tool action name string to a container.Action constant. If the name is not one of the supported actions (start/stop/restart/remove container), it returns this error listing nothing, so the caller sees the unrecognized action string.","triggerScenarios":"Calling the container action tool (via executeContainerAction) with an action name that is not exactly one of: start_container, stop_container, restart_container, remove_container.","commonSituations":"LLM agent inventing actions like \"pause_container\", \"kill\", or \"start\" (missing _container suffix); typos or camelCase instead of snake_case; calling an action renamed in a newer Dozzle version.","solutions":["Use one of the exact supported names: start_container, stop_container, restart_container, remove_container.","Check AvailableTools() in internal/cloud/tools.go for the current action list and parameter schema.","Fix casing/spelling: names are lowercase snake_case with the _container suffix."],"exampleFix":"// before\n{\"action\":\"start\"}\n// after\n{\"action\":\"start_container\"}","handlingStrategy":"validation","validationCode":"const ALLOWED_ACTIONS = [\"start_container\", \"stop_container\", \"restart_container\", \"remove_container\"];\nif (!ALLOWED_ACTIONS.includes(action)) {\n  throw new Error(`unsupported action '${action}'; must be one of ${ALLOWED_ACTIONS.join(\", \")}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  return await callTool(\"container_action\", JSON.stringify({ action, containerId }));\n} catch (e) {\n  if (String(e).includes(\"unknown action\")) {\n    // correct the action name to one of the snake_case *_container variants\n  }\n  throw e;\n}","preventionTips":["Keep a constant list of valid action names in agent code instead of free-form strings.","Use lowercase snake_case with the _container suffix exactly as defined in resolveAction.","Re-check AvailableTools() after upgrading Dozzle in case actions changed."],"tags":["cloud-tools","docker","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"d9463cbe21874e44ab79db6fa63e746ca7d22928","analyzedAt":"2026-09-07T10:08:55.855Z","contentChangedAt":"2026-09-07T10:08:55.855Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}