amir20/dozzle · error

invalid image check mode

Error message

invalid image check mode: <input> (expected automatic, manual or off)

What it means

ParseMode is a strict enum validator for the image-update-check Mode type. The input string matched none of the three accepted values (automatic, manual, off), so the flag/config value is a typo or unsupported value and startup cannot determine whether registry egress is allowed.

Solutions

  1. Use exactly one of: automatic, manual, or off (case-sensitive).
  2. Check the --image-check flag or config key for typos like 'Auto' or 'disabled'.
  3. Wrap with usage feedback showing the accepted values when surfacing CLI parse errors.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/imagecheck/checker.go:32 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at internal/imagecheck/checker.go:32

// Mode controls whether Dozzle contacts registries at all.
type Mode string

const (
	// ModeAutomatic checks in the background when a container is viewed.
	ModeAutomatic Mode = "automatic"
	// ModeManual only checks when a user explicitly asks.
	ModeManual Mode = "manual"
	// ModeOff disables the feature entirely; no route, no egress.
	ModeOff Mode = "off"
)

func ParseMode(input string) (Mode, error) {
	switch mode := Mode(input); mode {
	case ModeAutomatic, ModeManual, ModeOff:
		return mode, nil
	default:
		return "", errors.New("invalid image check mode: " + input + " (expected automatic, manual or off)")
	}
}

// Status is the outcome of an update check for a single container.
type Status string

const (
	StatusUpToDate        Status = "up-to-date"
	StatusUpdateAvailable Status = "update-available"
	// StatusPinned means the container runs a digest-pinned image, which by
	// definition cannot drift.
	StatusPinned Status = "pinned"
	// StatusNotCheckable means the image has no registry digest locally,
	// which is the case for locally built images.
	StatusNotCheckable Status = "not-checkable"
	// StatusAuthRequired means the registry refused an anonymous request.
	StatusAuthRequired Status = "auth-required"
	// StatusSkipped means the container opted out via label.

View on GitHub (pinned to d9463cbe21)