infiniflow/ragflow · critical · RuntimeError

No sandbox provider configured. Please configure sandbox set

Error message

No sandbox provider configured. Please configure sandbox settings in the admin panel.

What it means

RuntimeError from the code-execution entry point in agent/sandbox/client.py: before creating a sandbox it calls get_provider_manager().is_configured(), and with no provider successfully configured (or a non-raising provider failed to initialize, see error 177) it refuses to run any code.

Source

Thrown at agent/sandbox/client.py:178

    This is the main entry point for agent components to execute code.

    Args:
        code: Source code to execute
        language: Programming language (python, nodejs, javascript)
        timeout: Maximum execution time in seconds
        arguments: Optional arguments dict to pass to main() function

    Returns:
        ExecutionResult containing stdout, stderr, exit_code, and metadata

    Raises:
        RuntimeError: If no provider is configured or execution fails
    """
    provider_manager = get_provider_manager()

    if not provider_manager.is_configured():
        raise RuntimeError("No sandbox provider configured. Please configure sandbox settings in the admin panel.")

    provider = provider_manager.get_provider()
    provider_name = provider_manager.get_provider_name() or getattr(provider, "__class__", type(provider)).__name__

    logger.info(
        "CodeExec using sandbox provider '%s' (language=%s, timeout=%ss)",
        provider_name,
        language,
        timeout,
    )

    # Create a sandbox instance
    instance = provider.create_instance(template=language)

    try:
        # Execute the code
        result = provider.execute_code(instance_id=instance.instance_id, code=code, language=language, timeout=timeout, arguments=arguments)

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Configure a sandbox provider in the admin panel (Sandbox settings) — 'local' is the simplest for single-node installs.
  2. Check logs for 'Unknown provider type' or 'Failed to initialize sandbox provider' to find why initialization was skipped, then fix that first.
  3. Verify the provider_type string matches a supported provider exactly (e.g. 'local', 'ssh', 'tenki', 'ucloud_agent_sandbox').
Defensive patterns

Strategy: validation

Validate before calling

from agent.sandbox.client import get_provider_manager

pm = get_provider_manager()
if not pm.is_configured():
    # show setup guidance instead of attempting execution
    raise RuntimeError('Configure a sandbox provider (e.g. local) in the admin panel')

Type guard

def sandbox_ready() -> bool:
    from agent.sandbox.client import get_provider_manager
    return get_provider_manager().is_configured()

Try / catch

try:
    result = execute_code(...)
except RuntimeError as e:
    if 'No sandbox provider configured' in str(e):
        # prompt admin to configure sandbox, disable code components, or degrade gracefully
        ...

Prevention

When it happens

Trigger: Running a Code component (or any feature that executes code, e.g. CodeExec) on a fresh install where sandbox settings were never set; a previous initialize() failed for a non-raising provider type so the manager stayed unconfigured; settings were cleared or the provider_type was unknown (unknown type logs 'Unknown provider type' and returns).

Common situations: New deployment where the admin never visited sandbox settings; switching provider_type to a name not in provider_classes; a config reload wiping sandbox settings; the code component worked before an upgrade changed the settings schema.

Related errors


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