caddyserver/caddy · warning

--output is required

Error message

--output is required

What it means

The periodic/background ECH key rotation (rotateECHKeys) refreshes its in-memory view of stored configs before deciding what to rotate, and setConfigsFromStorage failed during that refresh. The comment says this re-read guards against another instance having updated storage concurrently.

Source

Thrown at cmd/storagefuncs.go:144

		err = stor.Store(ctx, hdr.Name, b)
		if err != nil {
			return caddy.ExitCodeFailedQuit, fmt.Errorf("reading archive: %v", err)
		}
	}

	fmt.Println("Successfully imported storage")
	return caddy.ExitCodeSuccess, nil
}

func cmdExportStorage(fl Flags) (int, error) {
	exportStorageCmdConfigFlag := fl.String("config")
	exportStorageCmdOutputFlag := fl.String("output")

	if exportStorageCmdConfigFlag == "" {
		return caddy.ExitCodeFailedStartup, errors.New("--config is required")
	}
	if exportStorageCmdOutputFlag == "" {
		return caddy.ExitCodeFailedStartup, errors.New("--output is required")
	}

	// extract storage from config if possible
	storageCfg, err := determineStorage(exportStorageCmdConfigFlag, "")
	if err != nil {
		return caddy.ExitCodeFailedStartup, err
	}

	// load specified storage or fallback to default
	var stor certmagic.Storage
	ctx, cancel := caddy.NewContext(caddy.Context{Context: context.Background()})
	defer cancel()
	if storageCfg != nil && storageCfg.StorageRaw != nil {
		val, err := ctx.LoadModule(storageCfg, "StorageRaw")
		if err != nil {
			return caddy.ExitCodeFailedStartup, err
		}
		stor, err = val.(caddy.StorageConverter).CertMagicStorage()

View on GitHub (pinned to 50e54ee279)

Solutions

  1. Inspect the wrapped error for the storage operation that failed.
  2. Restore storage availability; the rotation loop retries on its next tick, so often no restart is needed once the backend recovers.
  3. Check that no external process is mutating or pruning the ech/configs storage prefix.
  4. If corruption is indicated, reset the ech/configs folder as a last resort (ECH configs regenerate and republish).
Defensive patterns

Strategy: retry

Try / catch

Log-and-retry: this occurs on the background maintenance loop; alert if it persists across ticks, but existing ECH configs keep serving.

Prevention

When it happens

Trigger: rotateECHKeys acquires the ech_rotation lock, calls setConfigsFromStorage, and storage.List or a nested Load returns an error: backend outage, permissions, corrupt state.

Common situations: Multi-instance clusters where one node's view of shared storage goes stale or the backend has an outage during the scheduled rotation tick; storage keys manually deleted or corrupted while Caddy runs.

Related errors


AI-assisted analysis of caddyserver/caddy@50e54ee279 (2026-08-15). Data as JSON: /api/errors/ebf6b93d75641def. Report an issue: GitHub.