{"record":{"id":"22330f4aa7020ee8","repo":"langchain-ai/deepagents","slug":"target-exc","errorCode":null,"errorMessage":"{target}: {exc}","messagePattern":"\\{target\\}: \\{exc\\}","errorType":"exception","errorClass":"FleetImportError","httpStatus":null,"severity":"error","filePath":"libs/talon/deepagents_talon/fleet_import.py","lineNumber":161,"sourceCode":"        with zipfile.ZipFile(source) as archive:\n            entries = _validated_entries(archive)\n            if \"AGENTS.md\" not in entries:\n                msg = \"AGENTS.md: missing required root prompt\"\n                raise FleetImportError(msg)\n            with tempfile.TemporaryDirectory(prefix=\"deepagents-talon-import-\") as raw:\n                staging = Path(raw)\n                _materialize_staging(archive, entries, staging)\n                summaries = _mcp_summaries(staging, source)\n                notes = _format_setup_notes(source.name, summaries)\n                mcp_config = _format_mcp_config(summaries)\n                config_ignored = (staging / \"config.json\").is_file()\n                _refresh_target(staging, target, home, notes, mcp_config)\n    except zipfile.BadZipFile as exc:\n        msg = f\"{source}: invalid zip file\"\n        raise FleetImportError(msg) from exc\n    except OSError as exc:\n        msg = f\"{target}: {exc}\"\n        raise FleetImportError(msg) from exc\n\n    return FleetImportResult(\n        target_dir=target,\n        root_prompt_count=1,\n        subagent_prompt_count=len(_subagent_prompt_paths(home)),\n        config_ignored=config_ignored,\n        mcp_notes=notes,\n        interrupt_tools=tuple(\n            sorted({tool for summary in summaries for tool in summary.interrupt_tools})\n        ),\n    )\n\n\ndef format_import_stdout(result: FleetImportResult) -> str:\n    \"\"\"Render a concise user-facing import summary.\n\n    Args:\n        result: Completed import summary.","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/talon/deepagents_talon/fleet_import.py#L143-L179","documentation":"FleetImportError raised by `import_fleet_zip` when an OSError occurs during archive validation, staging, or refreshing the target directory. The message is `f\"{target}: {exc}\"`, so it names the destination and embeds the OS-level reason (permission denied, disk full, read-only filesystem, etc.).","triggerScenarios":"Calling `import_fleet_zip` where the target/home path is not writable, the parent directory is missing, the filesystem is full, or an existing target file is read-only — any OSError raised inside the try block at libs/talon/deepagents_talon/fleet_import.py:159.","commonSituations":"Running without write permission on the install target; importing into a container path mounted read-only; disk quota exceeded mid-extraction; target owned by another user.","solutions":["Check and fix permissions on the target directory (`ls -ld`, `chmod`/`chown` or run with appropriate rights).","Verify the target's parent directory exists and the filesystem has free space (`df -h`).","Ensure the target is not on a read-only mount before importing."],"exampleFix":"// before\nimport_fleet_zip(zip_path, Path(\"/system/readonly/assistant\"))\n// after\nPath(\"/system/readonly/assistant\").parent.mkdir(parents=True, exist_ok=True)\nimport_fleet_zip(zip_path, Path(\"/home/user/.deepagents\"))","handlingStrategy":"try-catch","validationCode":"target = Path(target_dir)\nif not target.parent.exists() or not os.access(target.parent, os.W_OK):\n    raise RuntimeError(f\"cannot write to {target.parent}\")\nimport shutil\nif shutil.disk_usage(target.parent).free < 50_000_000:\n    raise RuntimeError(\"insufficient disk space\")","typeGuard":null,"tryCatchPattern":"from deepagents_talon.fleet_import import import_fleet_zip, FleetImportError\ntry:\n    result = import_fleet_zip(source, target)\nexcept FleetImportError as exc:\n    if isinstance(exc.__cause__, OSError):\n        raise SystemExit(f\"fix filesystem issue for {target}: {exc.__cause__}\") from exc\n    raise","preventionTips":["Check write permissions on the target directory before importing.","Ensure the target filesystem is writable and has free space.","Create the target's parent directory (`mkdir -p`) ahead of the import."],"tags":["import","filesystem","permissions","io"],"backgroundTag":"permission-denied","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}