{"record":{"id":"9927eb543ba5834e","repo":"amir20/dozzle","slug":"unknown-action-s-9927eb","errorCode":null,"errorMessage":"unknown action: %s","messagePattern":"unknown action: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/container/types.go","lineNumber":288,"sourceCode":"\tMessage string `json:\"m\"`\n}\n\ntype ContainerAction string\n\nconst (\n\tStart   ContainerAction = \"start\"\n\tStop    ContainerAction = \"stop\"\n\tRestart ContainerAction = \"restart\"\n\tRemove  ContainerAction = \"remove\"\n)\n\nfunc ParseContainerAction(input string) (ContainerAction, error) {\n\taction := ContainerAction(input)\n\tswitch action {\n\tcase Start, Stop, Restart, Remove:\n\t\treturn action, nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unknown action: %s\", input)\n\t}\n}\n\ntype UpdateProgress struct {\n\tStatus  string `json:\"status\"`  // \"pulling\", \"recreating\", \"done\", \"error\", \"up-to-date\"\n\tLayer   string `json:\"layer\"`   // Docker layer ID (pull events only)\n\tCurrent int64  `json:\"current\"` // Bytes downloaded\n\tTotal   int64  `json:\"total\"`   // Total bytes for layer\n\tError   string `json:\"error\"`   // Only when Status=\"error\"\n}\n\ntype LogEvent struct {\n\tType        LogType `json:\"t,omitempty\"`\n\tMessage     any     `json:\"m,omitempty\"`\n\tRawMessage  string  `json:\"rm,omitempty\"`\n\tTimestamp   int64   `json:\"ts\"`\n\tId          uint32  `json:\"id,omitempty\"`\n\tLevel       string  `json:\"l,omitempty\"`","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/amir20/dozzle/blob/d9463cbe21874e44ab79db6fa63e746ca7d22928/internal/container/types.go#L270-L306","documentation":"ParseContainerAction validates an action string against the fixed set Start, Stop, Restart, Remove. Any other string is rejected with 'unknown action', preventing arbitrary strings from reaching the container lifecycle endpoints.","triggerScenarios":"containerActions handler parses a user-supplied action string from an HTTP request (e.g. POST actions/{action}) that is not exactly 'start', 'stop', 'restart', or 'remove' (case-sensitive).","commonSituations":"Typos like 'restrt' or 'kill'; capitalized 'Start' from a UI or script; unsupported verbs like 'pause' or 'unpause' which Dozzle does not implement; URL-encoding or whitespace issues.","solutions":["Use one of the supported actions exactly: start, stop, restart, remove","Lowercase the input and trim whitespace before sending","Map unsupported verbs (pause/kill) to the closest supported action in your client"],"exampleFix":"// before\nParseContainerAction(\"Pause\")\n// after\nParseContainerAction(\"stop\") // one of start|stop|restart|remove","handlingStrategy":"validation","validationCode":"validActions := map[string]bool{\"start\":true,\"stop\":true,\"restart\":true,\"remove\":true}\nif !validActions[strings.ToLower(strings.TrimSpace(input))] { /* reject early */ }","typeGuard":null,"tryCatchPattern":"action, err := ParseContainerAction(input)\nif err != nil {\n  // return 400 with supported actions list\n}","preventionTips":["Whitelist actions in UI/client before sending","Lowercase and trim action inputs","Remember pause/kill are not supported actions in Dozzle"],"tags":["docker","container-actions","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-16T09:17:16.951Z"}