{"record":{"id":"9830026feecca37f","repo":"langchain-ai/deepagents","slug":"managedconfigerror-provider-status","errorCode":null,"errorMessage":"ManagedConfigError(provider.status)","messagePattern":"ManagedConfigError\\(provider\\.status\\)","errorType":"exception","errorClass":"ManagedConfigError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/mcp_disabled.py","lineNumber":286,"sourceCode":"\n\ndef _raise_for_managed_provider(\n    provider: RankedProviderValue[list[str]],\n) -> None:\n    \"\"\"Apply the deny-list callsite's fail-closed health policy.\n\n    Raises:\n        ManagedConfigError: If the provider is unhealthy or its value is invalid.\n    \"\"\"\n    from deepagents_code.configuration.service import ManagedConfigError\n    from deepagents_code.configuration.types import (\n        Invalid,\n        ProviderHealth,\n        ProviderStatus,\n    )\n\n    if not provider.status.usable:\n        raise ManagedConfigError(provider.status)\n    if isinstance(provider.result, Invalid):\n        raise ManagedConfigError(\n            ProviderStatus(\n                provider.status.name,\n                provider.status.path,\n                ProviderHealth.CORRUPT,\n                provider.result.reason,\n            )\n        )\n\n\ndef _disabled_entries(data: dict[str, Any]) -> set[str]:\n    \"\"\"Return disabled names from the current config shape with legacy fallback.\"\"\"\n    section = data.get(_SECTION)\n    if isinstance(section, dict):\n        entries = _coerce_entries(section.get(_KEY))\n        if entries is not None:\n            return entries","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/mcp_disabled.py#L268-L304","documentation":"_raise_for_managed_provider converts an unusable ranked provider status into a ManagedConfigError. When a provider's status is not usable (e.g. the backing config file is unreadable or missing), the library raises ManagedConfigError carrying the original ProviderStatus so callers can see which config source failed and why.","triggerScenarios":"Calling get_disabled_servers when one of the ranked config providers reports status.usable == False — e.g. the config file at the provider's path cannot be loaded/parsed at all.","commonSituations":"A global or project config file has bad permissions, is locked by another process, or the file path no longer exists; a corrupt config file fails to load.","solutions":["Inspect the ManagedConfigError's embedded ProviderStatus (name, path, health) to find the failing config file.","Fix the file at that path: restore read permissions, restore the missing file, or delete/recreate it.","If the file is disposable (e.g. a cache of disabled servers), remove it and re-run; the library will recreate defaults.","Re-run `dcode mcp` commands to confirm resolution succeeds."],"exampleFix":"# before\nls -l ~/.config/dcode/config.toml  # -rw------- root:root, running as non-root\n# after\nsudo chown $USER ~/.config/dcode/config.toml && chmod 600 ~/.config/dcode/config.toml","handlingStrategy":"try-catch","validationCode":"from pathlib import Path\np = Path(config_path)\nif not p.exists() or not p.is_file():\n    print(f\"config missing/unusable: {p}\")\nelse:\n    p.read_text()  # raises PermissionError early if unreadable","typeGuard":null,"tryCatchPattern":"try:\n    disabled = get_disabled_servers()\nexcept ManagedConfigError as exc:\n    status = exc.status\n    print(f\"config source {status.name} at {status.path} unusable: {status.health}\")","preventionTips":["Check config file permissions after system/user changes","Don't point dcode at files owned by another user or a root-run service","Back up configs before editing; recreate cache-like files rather than repairing them"],"tags":["mcp","config","provider-health","managed-config"],"backgroundTag":"config-provider-unusable","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}