bytedance/deer-flow · error · ValueError

OpenViking startup_policy must be 'fail_fast' or 'warn'

Error message

OpenViking startup_policy must be 'fail_fast' or 'warn'

What it means

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.

Source

Thrown at backend/packages/harness/deerflow/agents/memory/backends/openviking/config.py:137

            raise ValueError(f"OpenViking USER API key is missing; set {self.api_key_env}")
        if not is_safe_peer_id(self.default_peer_id):
            raise ValueError("OpenViking default_peer_id must start with a lowercase letter or digit and contain at most 64 lowercase letters, digits, '_' or '-'")
        if self.default_peer_id.startswith(GENERATED_PEER_PREFIX):
            raise ValueError(f"OpenViking default_peer_id must not start with the reserved prefix {GENERATED_PEER_PREFIX!r}")
        if not isfinite(self.timeout_seconds) or self.timeout_seconds <= 0:
            raise ValueError("OpenViking timeout_seconds must be a finite value > 0")
        if not 1 <= self.search_top_k <= 100:
            raise ValueError("OpenViking retrieval.top_k must be between 1 and 100")
        if self.score_threshold is not None and (not isfinite(self.score_threshold) or not 0 <= self.score_threshold <= 1):
            raise ValueError("OpenViking retrieval.score_threshold must be a finite value between 0 and 1")
        if not 256 <= self.max_injection_chars <= 100_000:
            raise ValueError("OpenViking retrieval.max_injection_chars must be between 256 and 100000")
        if self.content_mode not in {"auto", "abstract", "overview", "read"}:
            raise ValueError("OpenViking retrieval.content_mode must be auto, abstract, overview, or read")
        if not self.injection_query:
            raise ValueError("OpenViking retrieval.injection_query must not be empty")
        if self.startup_policy not in {"fail_fast", "warn"}:
            raise ValueError("OpenViking startup_policy must be 'fail_fast' or 'warn'")
        if self.read_failure_policy not in {"fail_open", "raise"}:
            raise ValueError("OpenViking failure_policy.read must be 'fail_open' or 'raise'")
        if self.write_failure_policy not in {"log_and_drop", "raise"}:
            raise ValueError("OpenViking failure_policy.write must be 'log_and_drop' or 'raise'")
        if not 16 <= self.max_seen_message_ids <= 10_000:
            raise ValueError("OpenViking max_seen_message_ids must be between 16 and 10000")


def is_safe_peer_id(value: str) -> bool:
    """Return whether *value* is valid for an OpenViking actor peer."""

    return _SAFE_PEER_RE.fullmatch(value) is not None


def _mapping(value: Any, name: str) -> dict[str, Any]:
    if value is None:
        return {}
    if not isinstance(value, dict):

View on GitHub (pinned to 1dd6ba1acb)

Solutions

  1. Set memory.backend_config.startup_policy: fail_fast (default, abort startup when OpenViking is unhealthy) or warn (degraded mode) in config.yaml
  2. Remove the startup_policy key entirely to accept the fail_fast default
  3. Restart the Gateway after editing config.yaml so the manager is reconstructed

Example fix

# before (config.yaml)
memory:
  manager_class: openviking
  backend_config:
    startup_policy: fail-fast   # typo: hyphen not allowed

# after
memory:
  manager_class: openviking
  backend_config:
    startup_policy: fail_fast
Defensive patterns

Strategy: validation

Validate before calling

from deerflow.agents.memory.backends.openviking.config import OpenVikingConfig
allowed = {"fail_fast", "warn"}
val = str(raw_backend_config.get("startup_policy", "fail_fast")).strip().lower()
assert val in allowed, f"startup_policy must be one of {sorted(allowed)}, got {val!r}"
cfg = OpenVikingConfig.from_backend_config(raw_backend_config)  # full validation

Type guard

def is_valid_startup_policy(value: object) -> bool:
    return isinstance(value, str) and value.strip().lower() in {"fail_fast", "warn"}

Try / catch

try:
    OpenVikingMemoryManager.from_config(backend_config)
except ValueError as exc:
    raise SystemExit(f"Invalid OpenViking memory config: {exc}") from exc

Prevention

When it happens

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

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

Related errors


AI-assisted analysis of bytedance/deer-flow@1dd6ba1acb (2026-08-14). Data as JSON: /api/errors/91ab3145fa7f7e3a. Report an issue: GitHub.