{"record":{"id":"5ec9e82d64ec99c0","repo":"infiniflow/ragflow","slug":"tenki-is-required-for-the-tenki-sandbox-provider","errorCode":null,"errorMessage":"tenki is required for the Tenki sandbox provider. Install it with `pip install tenki` (or `uv pip install tenki`).","messagePattern":"tenki is required for the Tenki sandbox provider\\. Install it with `pip install tenki` \\(or `uv pip install tenki`\\)\\.","errorType":"exception","errorClass":"SandboxProviderConfigError","httpStatus":null,"severity":"error","filePath":"agent/sandbox/providers/tenki.py","lineNumber":520,"sourceCode":"\n    @staticmethod\n    def _normalize_language(language: str) -> str:\n        lang_lower = (language or \"python\").lower()\n        if lang_lower in {\"python\", \"python3\"}:\n            return \"python\"\n        if lang_lower in {\"javascript\", \"nodejs\"}:\n            return \"nodejs\"\n        return lang_lower\n\n\ndef _get_tenki_module():\n    try:\n        import tenki_sandbox\n    except ImportError as exc:\n        # tenki is an optional dependency: it requires protobuf>=6.31,\n        # which conflicts with RAGFlow's pinned gRPC stack, so it is not a core\n        # dependency. Install it into the runtime to enable this provider.\n        raise SandboxProviderConfigError(\"tenki is required for the Tenki sandbox provider. Install it with `pip install tenki` (or `uv pip install tenki`).\") from exc\n    return tenki_sandbox\n","sourceCodeStart":502,"sourceCodeEnd":522,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/agent/sandbox/providers/tenki.py#L502-L522","documentation":"Raised by the Tenki sandbox provider when it cannot import the optional Python package `tenki` (imported as `tenki_sandbox`). RAGFlow deliberately keeps tenki out of core dependencies because it requires protobuf>=6.31, which conflicts with RAGFlow's pinned gRPC stack, so the provider only works when the operator installs it manually into the runtime.","triggerScenarios":"Selecting the Tenki provider for code execution (agent sandbox config) in an environment where `import tenki_sandbox` raises ImportError — e.g. fresh RAGFlow install, slim Docker image, or a venv where tenki was never added.","commonSituations":"Enabling the Tenki sandbox provider after seeing it listed in the UI without reading the optional-dependency note; upgrading RAGFlow into a new virtualenv that drops manually installed packages; dependency resolver removing tenki because of the protobuf/gRPC conflict.","solutions":["Install the package into the active runtime: `pip install tenki` (or `uv pip install tenki` if using uv).","If pip refuses due to the protobuf pin conflict, install tenki into a separate venv/container or relax the protobuf pin after verifying gRPC compatibility.","Restart the RAGFlow backend (API server / sandbox worker) so the new import is visible to the provider process.","If you did not intend to use Tenki, switch the sandbox provider config back to another provider (e.g. the default code executor)."],"exampleFix":"# before\nsandbox_conf = {\"provider\": \"tenki\"}  # ImportError -> SandboxProviderConfigError at runtime\n\n# after (install first: uv pip install tenki)\nsandbox_conf = {\"provider\": \"tenki\"}  # import tenki_sandbox now succeeds","handlingStrategy":"validation","validationCode":"import importlib.util\n\ndef tenki_available() -> bool:\n    return importlib.util.find_spec(\"tenki_sandbox\") is not None\n\n# before enabling the provider\nif not tenki_available():\n    raise SystemExit(\"Install tenki first: uv pip install tenki\")","typeGuard":"import importlib.util\n\ndef tenki_available() -> bool:\n    \"\"\"True when the optional tenki_sandbox module is importable.\"\"\"\n    return importlib.util.find_spec(\"tenki_sandbox\") is not None","tryCatchPattern":"try:\n    provider.initialize(conf)\nexcept SandboxProviderConfigError as e:\n    if \"tenki is required\" in str(e):\n        # report install instructions, do not retry\n        raise SystemExit(str(e)) from e\n    raise","preventionTips":["Bake `tenki` into the deployment image/requirements when the Tenki provider is part of your config.","Check importlib.util.find_spec('tenki_sandbox') during startup preflight before selecting the provider.","Remember the protobuf>=6.31 constraint conflicts with RAGFlow's pinned gRPC stack — test dependency resolution after installing."],"tags":["dependency","optional-dependency","sandbox","protobuf","configuration"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}