{"record":{"id":"854ab7403d430c8b","repo":"infiniflow/ragflow","slug":"500","errorCode":"500","errorMessage":"OceanBase is not in use.","messagePattern":"OceanBase is not in use\\.","errorType":"http","errorClass":"Exception","httpStatus":null,"severity":"warning","filePath":"api/utils/health_utils.py","lineNumber":108,"sourceCode":"    try:\n        return {\"status\": \"alive\", \"message\": InfinityConnection().health()}\n    except Exception as e:\n        return {\n            \"status\": \"timeout\",\n            \"message\": f\"error: {str(e)}\",\n        }\n\n\ndef get_oceanbase_status():\n    \"\"\"\n    Get OceanBase health status and performance metrics.\n\n    Returns:\n        dict: OceanBase status with health information and performance metrics\n    \"\"\"\n    doc_engine = os.getenv(\"DOC_ENGINE\", \"elasticsearch\")\n    if doc_engine != \"oceanbase\":\n        raise Exception(\"OceanBase is not in use.\")\n    try:\n        ob_conn = OBConnection()\n        health_info = ob_conn.health()\n        performance_metrics = ob_conn.get_performance_metrics()\n\n        # Combine health and performance metrics\n        status = \"alive\" if health_info.get(\"status\") == \"healthy\" else \"timeout\"\n\n        return {\"status\": status, \"message\": {\"health\": health_info, \"performance\": performance_metrics}}\n    except Exception as e:\n        return {\n            \"status\": \"timeout\",\n            \"message\": f\"error: {str(e)}\",\n        }\n\n\ndef check_oceanbase_health() -> dict:\n    \"\"\"","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/api/utils/health_utils.py#L90-L126","documentation":"Raised by get_oceanbase_status in the health-check utilities when DOC_ENGINE is not 'oceanbase'. The endpoint only makes sense for OceanBase-backed document storage; for any other engine (elasticsearch, infinity, opensearch) it raises a plain Exception, which the health route maps to HTTP 500.","triggerScenarios":"Calling GET /system/health (or the OceanBase status sub-check) on a deployment whose DOC_ENGINE env is elasticsearch/opensearch/infinity — i.e. the default configuration.","commonSituations":"Monitoring/health-check tooling probing all engine-specific status endpoints uniformly regardless of configuration; dashboards copied from an OceanBase deployment to a standard one.","solutions":["Probe the status endpoint matching your DOC_ENGINE instead of the OceanBase one.","If you actually use OceanBase, set DOC_ENGINE=oceanbase (and configure the OB connection) in the service environment.","Treat this error as a configuration sentinel in monitoring: mark the OceanBase check N/A when DOC_ENGINE differs."],"exampleFix":"# before\nstatus = get_oceanbase_status()  # raises on ES deployments\n\n# after\nif os.getenv('DOC_ENGINE') != 'oceanbase':\n    ob_status = {'status': 'not-applicable'}\nelse:\n    ob_status = get_oceanbase_status()","handlingStrategy":"type-guard","validationCode":"if os.getenv('DOC_ENGINE') != 'oceanbase':\n    ob_status = {'status': 'not-applicable'}\nelse:\n    ob_status = get_oceanbase_status()","typeGuard":"def oceanbase_enabled() -> bool:\n    return os.getenv('DOC_ENGINE', 'elasticsearch') == 'oceanbase'","tryCatchPattern":"try:\n    status = get_oceanbase_status()\nexcept Exception as e:\n    if 'not in use' in str(e):\n        status = {'status': 'not-applicable', 'message': str(e)}\n    else:\n        raise","preventionTips":["Probe only engine-specific health endpoints matching DOC_ENGINE.","Mark non-active engine checks as N/A in monitoring templates instead of alerting.","Set DOC_ENGINE=oceanbase and configure OB connection details if you actually run OceanBase."],"tags":["configuration","health-check","oceanbase","doc-engine","environment"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}