{"record":{"id":"c2edbd8ff30cee6a","repo":"langchain-ai/deepagents","slug":"error-could-not-read-the-skill-trust-store-exc","errorCode":null,"errorMessage":"Error: Could not read the skill trust store: {exc}","messagePattern":"Error: Could not read the skill trust store: (.+?)","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/skills/commands.py","lineNumber":908,"sourceCode":"        revoke_skill_dir_trust,\n    )\n\n    command = getattr(args, \"trust_command\", None)\n    output_format = getattr(args, \"output_format\", \"text\")\n    checkmark = get_glyphs().checkmark\n\n    if command in {\"list\", \"ls\"}:\n        # Read strictly so an unreadable store surfaces as an error instead of\n        # falsely reporting \"No trusted skill directories\" — the whole point of\n        # the audit command is to show what is trusted so it can be revoked.\n        try:\n            entries = list_trusted_skill_dir_entries(strict=True)\n        except (OSError, ValueError) as exc:\n            console.print(\n                f\"[bold red]Error:[/bold red] Could not read the skill trust \"\n                f\"store: {escape(str(exc))}\"\n            )\n            raise SystemExit(1) from exc\n        if output_format == \"json\":\n            from deepagents_code.output import write_json\n\n            write_json(\n                \"skills trust list\",\n                [\n                    {\"dir\": path, \"trusted_at\": trusted_at}\n                    for path, trusted_at in entries\n                ],\n            )\n            return\n        if not entries:\n            console.print()\n            console.print(\"[yellow]No trusted skill directories.[/yellow]\")\n            console.print(\n                \"[dim]Directories are trusted when you approve a skill that \"\n                \"resolves outside the standard skill roots.[/dim]\",\n                style=theme.MUTED,","sourceCodeStart":890,"sourceCodeEnd":926,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/skills/commands.py#L890-L926","documentation":"The `skills trust list` subcommand reads the on-disk skill trust store via `list_trusted_skill_dir_entries(strict=True)`. If that raises `OSError` (unreadable/corrupt file, bad permissions) or `ValueError` (malformed store), `_trust` prints `Error: Could not read the skill trust store: <exc>` and exits with status 1. Strict mode is used so a corrupt store is reported rather than silently treated as empty.","triggerScenarios":"`skills trust list` (or its `ls` alias) when the trust store file cannot be read: file missing permissions, I/O error, JSON that is not an object, or unrecognized schema version (ValueError from `_load_store` in strict mode).","commonSituations":"Trust store corrupted by manual editing or a partial write; schema written by a newer build; store file permissions broken after copying a profile directory between machines or users.","solutions":["Read the exception detail to determine if it is a permission problem or malformed content","Fix file permissions on the trust store file if the error is EACCES","If the store is malformed or from a newer build, back it up and delete it, then re-trust directories with `skills trust add`","Verify you are not running an older build against a store written by a newer version"],"exampleFix":"// before\n$ dcode skills trust list\n# Error: Could not read the skill trust store: Skill trust store ... has an unrecognized schema version ...\n// after (after backing it up)\n$ mv ~/.deepagents/skills/trust.json ~/.deepagents/skills/trust.json.bak\n$ dcode skills trust add ~/my-skills","handlingStrategy":"try-catch","validationCode":"import json\nfrom pathlib import Path\n\ndef trust_store_readable(store: Path) -> bool:\n    try:\n        return isinstance(json.loads(store.read_text(encoding='utf-8')), dict)\n    except (OSError, ValueError):\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    entries = list_trusted_skill_dir_entries(strict=True)\nexcept (OSError, ValueError) as exc:\n    print(f'could not read trust store: {exc}')\n    raise SystemExit(1) from exc","preventionTips":["Do not hand-edit the trust store file","Use `skills trust add/revoke` instead of writing JSON directly","Keep file permissions on the profile directory consistent","Back up the store before manual maintenance"],"tags":["cli","trust-store","json"],"backgroundTag":"corrupt-state-file","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}