{"record":{"id":"2a816c1bbf573fbb","repo":"666ghj/MiroFish","slug":"zep-api-key-must-be-supplied-through-the-process-e","errorCode":null,"errorMessage":"ZEP_API_KEY must be supplied through the process environment","messagePattern":"ZEP_API_KEY must be supplied through the process environment","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"backend/scripts/validate_zep_cloud_integration.py","lineNumber":228,"sourceCode":"            \"source_targets\": [{\"source\": \"Company\", \"target\": \"Company\"}],\n        },\n    ],\n}\n\n\ndef _uuid(value: Any) -> str:\n    return str(getattr(value, \"uuid_\", None) or getattr(value, \"uuid\", \"\"))\n\n\ndef _status_code(error: Exception) -> int | None:\n    direct = getattr(error, \"status_code\", None)\n    response = getattr(error, \"response\", None)\n    return direct or getattr(response, \"status_code\", None)\n\n\ndef _require_process_api_key() -> str:\n    if not _PROCESS_ZEP_API_KEY:\n        raise RuntimeError(\n            \"ZEP_API_KEY must be supplied through the process environment\"\n        )\n    return _PROCESS_ZEP_API_KEY\n\n\ndef _drain_updater_after_failure(\n    updater: Any,\n    *,\n    started: bool,\n    stop_attempted: bool,\n) -> tuple[bool, Exception | None]:\n    \"\"\"Make one safe drain attempt when the main flow did not call stop().\"\"\"\n\n    if not started:\n        return True, None\n    if stop_attempted:\n        return False, None\n    try:","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/666ghj/MiroFish/blob/b5b53acc57189a4a42e44a23e149dc655c98fe82/backend/scripts/validate_zep_cloud_integration.py#L210-L246","documentation":"Raised by _require_process_api_key in backend/scripts/validate_zep_cloud_integration.py when the module-level _PROCESS_ZEP_API_KEY is empty. The validator deliberately requires the key to come from the process environment captured at startup, so it validates the same configuration path production uses rather than accepting a late-supplied key. It is a RuntimeError raised before any Zep Cloud interaction.","triggerScenarios":"Running validate_zep_cloud_integration.py without ZEP_API_KEY exported in the launching shell — a .env the script does not load, a differently-named CI secret (e.g. ZEP_KEY), or setting the variable after the interpreter already started.","commonSituations":"Operator assumes the script reads .env like the backend; CI defines the secret under the wrong name; systemd/sudo scrubs the environment.","solutions":["Run inline: ZEP_API_KEY=... python scripts/validate_zep_cloud_integration.py.","Or export in the launching shell before starting the script — the capture happens at import/startup time.","In CI, register ZEP_API_KEY as the job's environment/secret variable."],"exampleFix":"# before\n$ python scripts/validate_zep_cloud_integration.py  # RuntimeError\n\n# after\n$ ZEP_API_KEY=zep_... python scripts/validate_zep_cloud_integration.py","handlingStrategy":"validation","validationCode":"import os\n\ndef process_zep_key_present() -> bool:\n    return bool(os.environ.get(\"ZEP_API_KEY\"))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Launch the validator with inline env: ZEP_API_KEY=... python scripts/validate_zep_cloud_integration.py.","Register ZEP_API_KEY as a CI secret variable under exactly that name.","The key is captured at process start — set it before launching, not after."],"tags":["configuration","authentication","environment","zep","validation-script","missing-api-key"],"backgroundTag":null,"analyzedSha":"b5b53acc57189a4a42e44a23e149dc655c98fe82","analyzedAt":"2026-08-14T22:29:33.146Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}