{"record":{"id":"912495555e48dee0","repo":"bytedance/deer-flow","slug":"mem0-base-url-must-use-https-because-it-carries","errorCode":null,"errorMessage":"mem0 base_url must use https:// because it carries the API key; set allow_insecure_http: true only for trusted local development","messagePattern":"mem0 base_url must use https:// because it carries the API key; set allow_insecure_http: true only for trusted local development","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"backend/packages/harness/deerflow/agents/memory/backends/mem0/config.py","lineNumber":116,"sourceCode":"        if config.read_policy not in _READ_POLICIES:\n            raise ValueError(f\"mem0 failure_policy.read must be one of {sorted(_READ_POLICIES)}\")\n        if config.write_policy not in _WRITE_POLICIES:\n            raise ValueError(f\"mem0 failure_policy.write must be one of {sorted(_WRITE_POLICIES)}\")\n        if not 1 <= config.top_k <= 1000:\n            raise ValueError(\"mem0 top_k must be in [1, 1000]\")\n        if not 0.0 <= config.score_threshold <= 1.0:\n            raise ValueError(\"mem0 score_threshold must be in [0, 1]\")\n        if config.max_injection_chars <= 0:\n            raise ValueError(\"mem0 max_injection_chars must be positive\")\n        if config.timeout_seconds <= 0:\n            raise ValueError(\"mem0 timeout_seconds must be positive\")\n        if not config.api_key_env.strip():\n            raise ValueError(\"mem0 api_key_env must be a non-empty env var name\")\n        parsed_base_url = urlsplit(config.base_url)\n        if parsed_base_url.scheme not in {\"http\", \"https\"} or not parsed_base_url.netloc:\n            raise ValueError(\"mem0 base_url must be an absolute http:// or https:// URL\")\n        if parsed_base_url.scheme == \"http\" and not config.allow_insecure_http:\n            raise ValueError(\"mem0 base_url must use https:// because it carries the API key; set allow_insecure_http: true only for trusted local development\")\n        return config\n\n    def resolve_api_key(self) -> str:\n        \"\"\"Read the API key from the configured environment variable.\"\"\"\n        key = os.environ.get(self.api_key_env, \"\").strip()\n        if not key:\n            raise ValueError(f\"mem0 API key missing: environment variable {self.api_key_env} is unset or empty\")\n        return key\n","sourceCodeStart":98,"sourceCodeEnd":125,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/packages/harness/deerflow/agents/memory/backends/mem0/config.py#L98-L125","documentation":"Error \"mem0 base_url must use https:// because it carries the API key; set allow_insecure_http: true only for trusted local development\" thrown in bytedance/deer-flow.","triggerScenarios":"Thrown at backend/packages/harness/deerflow/agents/memory/backends/mem0/config.py:116 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Switch mem0 base_url to https:// so the API key is encrypted in transit.","For trusted local development only, set allow_insecure_http: true in the mem0 backend_config."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}