{"record":{"id":"c68e3e6d99c5de00","repo":"infiniflow/ragflow","slug":"no-sandbox-provider-configured-please-configure-s","errorCode":null,"errorMessage":"No sandbox provider configured. Please configure sandbox settings in the admin panel.","messagePattern":"No sandbox provider configured\\. Please configure sandbox settings in the admin panel\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"agent/sandbox/client.py","lineNumber":178,"sourceCode":"\n    This is the main entry point for agent components to execute code.\n\n    Args:\n        code: Source code to execute\n        language: Programming language (python, nodejs, javascript)\n        timeout: Maximum execution time in seconds\n        arguments: Optional arguments dict to pass to main() function\n\n    Returns:\n        ExecutionResult containing stdout, stderr, exit_code, and metadata\n\n    Raises:\n        RuntimeError: If no provider is configured or execution fails\n    \"\"\"\n    provider_manager = get_provider_manager()\n\n    if not provider_manager.is_configured():\n        raise RuntimeError(\"No sandbox provider configured. Please configure sandbox settings in the admin panel.\")\n\n    provider = provider_manager.get_provider()\n    provider_name = provider_manager.get_provider_name() or getattr(provider, \"__class__\", type(provider)).__name__\n\n    logger.info(\n        \"CodeExec using sandbox provider '%s' (language=%s, timeout=%ss)\",\n        provider_name,\n        language,\n        timeout,\n    )\n\n    # Create a sandbox instance\n    instance = provider.create_instance(template=language)\n\n    try:\n        # Execute the code\n        result = provider.execute_code(instance_id=instance.instance_id, code=code, language=language, timeout=timeout, arguments=arguments)\n","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/agent/sandbox/client.py#L160-L196","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Configure a sandbox provider in the admin panel (Sandbox settings) — 'local' is the simplest for single-node installs.","Check logs for 'Unknown provider type' or 'Failed to initialize sandbox provider' to find why initialization was skipped, then fix that first.","Verify the provider_type string matches a supported provider exactly (e.g. 'local', 'ssh', 'tenki', 'ucloud_agent_sandbox')."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from agent.sandbox.client import get_provider_manager\n\npm = get_provider_manager()\nif not pm.is_configured():\n    # show setup guidance instead of attempting execution\n    raise RuntimeError('Configure a sandbox provider (e.g. local) in the admin panel')","typeGuard":"def sandbox_ready() -> bool:\n    from agent.sandbox.client import get_provider_manager\n    return get_provider_manager().is_configured()","tryCatchPattern":"try:\n    result = execute_code(...)\nexcept RuntimeError as e:\n    if 'No sandbox provider configured' in str(e):\n        # prompt admin to configure sandbox, disable code components, or degrade gracefully\n        ...","preventionTips":["Configure the sandbox provider during initial deployment (local provider for single-node).","Health-check sandbox configuration in startup diagnostics so the failure is visible before users hit it.","Remember that an unknown provider_type or failed non-raising initialize also ends in this state — check init logs first."],"tags":["sandbox","configuration","code-execution","runtime"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}