infiniflow/ragflow · warning · Exception

500

500

Error message

OceanBase is not in use.

What it means

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.

Source

Thrown at api/utils/health_utils.py:108

    try:
        return {"status": "alive", "message": InfinityConnection().health()}
    except Exception as e:
        return {
            "status": "timeout",
            "message": f"error: {str(e)}",
        }


def get_oceanbase_status():
    """
    Get OceanBase health status and performance metrics.

    Returns:
        dict: OceanBase status with health information and performance metrics
    """
    doc_engine = os.getenv("DOC_ENGINE", "elasticsearch")
    if doc_engine != "oceanbase":
        raise Exception("OceanBase is not in use.")
    try:
        ob_conn = OBConnection()
        health_info = ob_conn.health()
        performance_metrics = ob_conn.get_performance_metrics()

        # Combine health and performance metrics
        status = "alive" if health_info.get("status") == "healthy" else "timeout"

        return {"status": status, "message": {"health": health_info, "performance": performance_metrics}}
    except Exception as e:
        return {
            "status": "timeout",
            "message": f"error: {str(e)}",
        }


def check_oceanbase_health() -> dict:
    """

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Probe the status endpoint matching your DOC_ENGINE instead of the OceanBase one.
  2. If you actually use OceanBase, set DOC_ENGINE=oceanbase (and configure the OB connection) in the service environment.
  3. Treat this error as a configuration sentinel in monitoring: mark the OceanBase check N/A when DOC_ENGINE differs.

Example fix

# before
status = get_oceanbase_status()  # raises on ES deployments

# after
if os.getenv('DOC_ENGINE') != 'oceanbase':
    ob_status = {'status': 'not-applicable'}
else:
    ob_status = get_oceanbase_status()
Defensive patterns

Strategy: type-guard

Validate before calling

if os.getenv('DOC_ENGINE') != 'oceanbase':
    ob_status = {'status': 'not-applicable'}
else:
    ob_status = get_oceanbase_status()

Type guard

def oceanbase_enabled() -> bool:
    return os.getenv('DOC_ENGINE', 'elasticsearch') == 'oceanbase'

Try / catch

try:
    status = get_oceanbase_status()
except Exception as e:
    if 'not in use' in str(e):
        status = {'status': 'not-applicable', 'message': str(e)}
    else:
        raise

Prevention

When it happens

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

Common situations: Monitoring/health-check tooling probing all engine-specific status endpoints uniformly regardless of configuration; dashboards copied from an OceanBase deployment to a standard one.

Related errors


AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15). Data as JSON: /api/errors/854ab7403d430c8b. Report an issue: GitHub.