{"record":{"id":"91ab3145fa7f7e3a","repo":"bytedance/deer-flow","slug":"openviking-startup-policy-must-be-fail-fast-or","errorCode":null,"errorMessage":"OpenViking startup_policy must be 'fail_fast' or 'warn'","messagePattern":"OpenViking startup_policy must be 'fail_fast' or 'warn'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"backend/packages/harness/deerflow/agents/memory/backends/openviking/config.py","lineNumber":137,"sourceCode":"            raise ValueError(f\"OpenViking USER API key is missing; set {self.api_key_env}\")\n        if not is_safe_peer_id(self.default_peer_id):\n            raise ValueError(\"OpenViking default_peer_id must start with a lowercase letter or digit and contain at most 64 lowercase letters, digits, '_' or '-'\")\n        if self.default_peer_id.startswith(GENERATED_PEER_PREFIX):\n            raise ValueError(f\"OpenViking default_peer_id must not start with the reserved prefix {GENERATED_PEER_PREFIX!r}\")\n        if not isfinite(self.timeout_seconds) or self.timeout_seconds <= 0:\n            raise ValueError(\"OpenViking timeout_seconds must be a finite value > 0\")\n        if not 1 <= self.search_top_k <= 100:\n            raise ValueError(\"OpenViking retrieval.top_k must be between 1 and 100\")\n        if self.score_threshold is not None and (not isfinite(self.score_threshold) or not 0 <= self.score_threshold <= 1):\n            raise ValueError(\"OpenViking retrieval.score_threshold must be a finite value between 0 and 1\")\n        if not 256 <= self.max_injection_chars <= 100_000:\n            raise ValueError(\"OpenViking retrieval.max_injection_chars must be between 256 and 100000\")\n        if self.content_mode not in {\"auto\", \"abstract\", \"overview\", \"read\"}:\n            raise ValueError(\"OpenViking retrieval.content_mode must be auto, abstract, overview, or read\")\n        if not self.injection_query:\n            raise ValueError(\"OpenViking retrieval.injection_query must not be empty\")\n        if self.startup_policy not in {\"fail_fast\", \"warn\"}:\n            raise ValueError(\"OpenViking startup_policy must be 'fail_fast' or 'warn'\")\n        if self.read_failure_policy not in {\"fail_open\", \"raise\"}:\n            raise ValueError(\"OpenViking failure_policy.read must be 'fail_open' or 'raise'\")\n        if self.write_failure_policy not in {\"log_and_drop\", \"raise\"}:\n            raise ValueError(\"OpenViking failure_policy.write must be 'log_and_drop' or 'raise'\")\n        if not 16 <= self.max_seen_message_ids <= 10_000:\n            raise ValueError(\"OpenViking max_seen_message_ids must be between 16 and 10000\")\n\n\ndef is_safe_peer_id(value: str) -> bool:\n    \"\"\"Return whether *value* is valid for an OpenViking actor peer.\"\"\"\n\n    return _SAFE_PEER_RE.fullmatch(value) is not None\n\n\ndef _mapping(value: Any, name: str) -> dict[str, Any]:\n    if value is None:\n        return {}\n    if not isinstance(value, dict):","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/packages/harness/deerflow/agents/memory/backends/openviking/config.py#L119-L155","documentation":"OpenVikingConfig._validate() rejects any memory.backend_config.startup_policy value outside {'fail_fast','warn'}. startup_policy controls whether an unhealthy OpenViking service at boot aborts Gateway startup (fail_fast, the default) or logs a warning and runs degraded (warn). The raw config string is lowercased before the check, so only exact spellings after lowercasing pass.","triggerScenarios":"Setting memory.backend_config.startup_policy to anything other than 'fail_fast' or 'warn' in config.yaml (e.g. 'fail-fast', 'strict', 'ignore', 'FAIL_FAST ' with stray characters is fine after strip/lower only if spelled right). Raised from OpenVikingConfig.from_backend_config -> _validate() during OpenVikingMemoryManager.model_post_init, i.e. at manager construction/Gateway startup.","commonSituations":"Copying a policy name from another backend (e.g. honcho's 'fail_closed' vocabulary), typo 'fail-fast' with a hyphen, or carrying over an old config value after migrating to the OpenViking backend.","solutions":["Set memory.backend_config.startup_policy: fail_fast (default, abort startup when OpenViking is unhealthy) or warn (degraded mode) in config.yaml","Remove the startup_policy key entirely to accept the fail_fast default","Restart the Gateway after editing config.yaml so the manager is reconstructed"],"exampleFix":"# before (config.yaml)\nmemory:\n  manager_class: openviking\n  backend_config:\n    startup_policy: fail-fast   # typo: hyphen not allowed\n\n# after\nmemory:\n  manager_class: openviking\n  backend_config:\n    startup_policy: fail_fast","handlingStrategy":"validation","validationCode":"from deerflow.agents.memory.backends.openviking.config import OpenVikingConfig\nallowed = {\"fail_fast\", \"warn\"}\nval = str(raw_backend_config.get(\"startup_policy\", \"fail_fast\")).strip().lower()\nassert val in allowed, f\"startup_policy must be one of {sorted(allowed)}, got {val!r}\"\ncfg = OpenVikingConfig.from_backend_config(raw_backend_config)  # full validation","typeGuard":"def is_valid_startup_policy(value: object) -> bool:\n    return isinstance(value, str) and value.strip().lower() in {\"fail_fast\", \"warn\"}","tryCatchPattern":"try:\n    OpenVikingMemoryManager.from_config(backend_config)\nexcept ValueError as exc:\n    raise SystemExit(f\"Invalid OpenViking memory config: {exc}\") from exc","preventionTips":["Validate config.yaml with OpenVikingConfig.from_backend_config in a preflight step before Gateway startup","Keep a lint/check step that enumerates allowed startup_policy values in deployment pipelines","Prefer omitting startup_policy to run the documented default (fail_fast)"],"tags":["openviking","config","validation","startup"],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}