amir20/dozzle · error

unknown action

Error message

unknown action: %s

What it means

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.

Solutions

  1. Use one of the exact supported names: start_container, stop_container, restart_container, remove_container.
  2. Check AvailableTools() in internal/cloud/tools.go for the current action list and parameter schema.
  3. Fix casing/spelling: names are lowercase snake_case with the _container suffix.

Example fix

// before
{"action":"start"}
// after
{"action":"start_container"}
Defensive patterns

Strategy: validation

Validate before calling

const ALLOWED_ACTIONS = ["start_container", "stop_container", "restart_container", "remove_container"];
if (!ALLOWED_ACTIONS.includes(action)) {
  throw new Error(`unsupported action '${action}'; must be one of ${ALLOWED_ACTIONS.join(", ")}`);
}

Try / catch

try {
  return await callTool("container_action", JSON.stringify({ action, containerId }));
} catch (e) {
  if (String(e).includes("unknown action")) {
    // correct the action name to one of the snake_case *_container variants
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of amir20/dozzle@d9463cbe21 (2026-09-07). Data as JSON: /api/errors/4970dae5fa938f1c. Report an issue: GitHub.

Appendix: source

Thrown at internal/cloud/tools_actions.go:128

	case container.Remove:
		return "removed"
	default:
		return string(action) + "ed"
	}
}

func resolveAction(name string) (container.ContainerAction, error) {
	switch name {
	case "start_container":
		return container.Start, nil
	case "stop_container":
		return container.Stop, nil
	case "restart_container":
		return container.Restart, nil
	case "remove_container":
		return container.Remove, nil
	default:
		return "", fmt.Errorf("unknown action: %s", name)
	}
}

View on GitHub (pinned to d9463cbe21)