invalid ov.conf aborts boot with no remediation pointer, and auto-restart turns it into a silent crash loop
What happens
OpenViking rejects unknown top-level ov.conf fields with a ValueError and exits 1. Strict validation is the right behavior, and I know it was requested in #855.
The problem is the failure surface. On boot the operator gets one bare line on stderr:
Unknown config field 'claude_code' in OpenVikingConfig
That line omits which config file was read, what to run next, and where the supported fields are documented. Under a process manager with auto-restart (launchd KeepAlive, systemd Restart=always, Docker restart: always), exit 1 just means "start again". The server then crash-loops with no visible signal, because stderr goes to a log file that headless deployments do not watch.
openviking-server doctor can validate the config exactly the way boot does, so a pointer that would actually help already exists. The boot error never mentions it.
Minimal reproduction
Environment: OpenViking 0.4.12 server on macOS, managed by launchd with KeepAlive enabled. I verified the same code paths on main at commit c486088 (2026-09-01).
- Add a top-level
claude_codesection to~/.openviking/ov.conf. Any unknown top-level key works. - Start the server with auto-restart enabled.
- Observe: one
Unknown config field ...line per boot attempt on stderr, exit 1, immediate restart, forever.
The claude_code choice is not invented. The bundled ov-memory-doctor skill lists claude_code, codex, and server.url as "plugin-only keys in ov.conf that make the server refuse to start" (examples/claude-code-memory-plugin/skills/ov-memory-doctor/SKILL.md:34, and the troubleshooting table below it). The shipped examples/ov.conf.example shows server, bot, and parsers as top-level sections (lines 2, 252, 272), so a reader who has never seen the allowlist reasonably concludes that tool sections live at the top level of ov.conf.
Evidence (production)
I run OpenViking headless on macOS under launchd. In August an ov.conf edit introduced a top-level claude_code section. The server exited on every boot and launchd restarted it continuously for 22 days before I traced the failure through stale memory captures.
The stderr log held that same single line 91,574 times, once per boot attempt. Nothing else in the output named a file or a next step. During those 22 days the server was down, so session capture, recall, and scheduled ingestion all failed against it.
Root cause on main (commit c486088)
openviking_cli/utils/config/config_utils.py:19-38(raise_unknown_config_fields) builds the error from the field name and the model class name only.suggest_closest_fieldhelps only on near-misses; a section likeclaude_codehas no close match among the valid fields, so the message is bare.openviking/server/config.py:426-464(load_server_config) raises the parseValueErrorwithout wrapping in the resolved config path. The same function'sFileNotFoundErrorbranch (lines 446-452) shows the pattern already exists in this codebase: it names both default paths, theOPENVIKING_CONFIG_FILEoverride, and a docs URL.openviking/server/bootstrap.py:218-221catches(FileNotFoundError, ValueError), printsstr(e)to stderr, and callssys.exit(1). That print is the entire operator-facing output for a bad config.openviking_cli/utils/config/open_viking_config.py:455-458is where the strictness lives: the top-level allowlist is the model fields plusserver,bot,parsers, and everything else raises.openviking_cli/doctor.py:110-127already validates ov.conf throughOpenVikingConfig.from_dict(the fix for #2373) and reports unknown fields with a remediation line. The boot path just never points at it.docs/en/guides/03-deployment.md:109recommendsRestart=alwaysfor systemd deployments, with no note about validating the config first or about how a config error behaves under restart.
Proposed fix
Keep strict validation. Change only the boot failure output:
- In
bootstrap.py:218-221, print the resolved config path next to the error (theresolve_config_pathcall sits a few lines above in the same try block), plus two lines:Run 'openviking-server doctor' to validate the config.andSupported fields: examples/ov.conf.example. - Wrap the parse
ValueErrorinload_server_configwith the resolved path, the same way theFileNotFoundErrorbranch already does. - Optional: exit with
78(EX_CONFIGfrom sysexits) instead of1, so supervisors can distinguish config errors from crashes, for exampleOnFailure=in systemd instead of treating both cases as restartable crashes.
I run OpenViking in production and can test a patch against main within a day.
Issue Origin: Observed or reproduced in a real environment (production OpenViking 0.4.12 under launchd with KeepAlive; code paths re-verified against main at c486088 on 2026-09-01).
I'd like to work on this.
My plan is to keep the fix narrowly scoped to diagnostics only:
- include the resolved
ov.confpath when configuration parsing fails; - preserve the original parse error;
- add an actionable hint to run
openviking-server doctor; - point users to
examples/ov.conf.examplefor supported fields; - add a focused regression test for the malformed-config error path.