{"record":{"id":"12c342bbd121647c","repo":"unslothai/unsloth","slug":"native-folder-grant-has-no-stable-identity","errorCode":null,"errorMessage":"Native folder grant has no stable identity.","messagePattern":"Native folder grant has no stable identity\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"studio/backend/routes/rag.py","lineNumber":293,"sourceCode":"\n    verify = verifier or verify_native_path_lease\n    try:\n        grant = verify(\n            native_path_lease,\n            operation = \"link-documents\",\n            expected_kind = \"document-folder\",\n            expected_path_type = \"directory\",\n        )\n        device_id = getattr(grant, \"device_id\", None)\n        file_id = getattr(grant, \"file_id\", None)\n        if device_id is None or file_id is None:\n            raise NativePathLeaseError(\"Native folder grant has no stable identity.\")\n        return (\n            folder_sync.validate_folder_path(str(grant.canonical_path)),\n            (device_id, file_id),\n        )\n    except NativePathLeaseError as exc:\n        raise HTTPException(status_code = 400, detail = str(exc)) from exc\n    except ValueError as exc:\n        raise HTTPException(status_code = 400, detail = str(exc)) from exc\n\n\ndef _folder_view(row: dict) -> dict:\n    status = (\n        \"syncing\"\n        if row[\"status\"] == \"syncing\"\n        else \"error\"\n        if row[\"status\"] in {\"error\", \"retired\"}\n        else \"idle\"\n    )\n    return {\n        \"id\": row[\"id\"],\n        \"displayName\": row[\"name\"],\n        \"scopeType\": row[\"scope_type\"],\n        \"scopeId\": row[\"scope_id\"],\n        \"status\": status,","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/routes/rag.py#L275-L311","documentation":"When linking a native folder, the verified lease grant must carry a stable identity (device_id and file_id — dev/inode pair) so later syncs can detect folder replacement. If either attribute is None on the grant, NativePathLeaseError('Native folder grant has no stable identity.') is raised and mapped to HTTP 400. This guards against network filesystems or FUSE mounts where stat identity is not stable.","triggerScenarios":"Requesting a linked-folder sync with a lease whose grant object lacks device_id/file_id — typically a path on NFS, SMB, or a FUSE/virtual filesystem that does not provide stable dev/inode values, or a lease issued by an older bridge version that omitted the fields.","commonSituations":"User tries to link a folder on a network share, cloud-drive mount (rclone, Dropbox daemon), or container volume with unstable inode semantics; desktop-bridge version skew where grants were created without identity fields.","solutions":["Choose a folder on the local physical filesystem (stable device/inode) rather than a network or FUSE mount.","Update the desktop bridge / lease issuer so grants include device_id and file_id.","If a network folder must be used, copy it to local storage and link the local copy."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import os\nst = os.stat(folder)\n# leases need stable dev/inode; network mounts often report 0 or per-mount values\nif st.st_dev == 0:\n    warn('folder identity unstable; choose a local filesystem folder')","typeGuard":null,"tryCatchPattern":"if (res.status === 400 && detail.includes('stable identity')) { suggestLocalFolder(); }","preventionTips":["Prefer local-disk folders for linking; avoid NFS/SMB/FUSE mounts.","Keep the desktop bridge updated so grants include device_id/file_id.","If network content must be linked, sync it to a local directory first."],"tags":["http-400","native-path-lease","linked-folder","filesystem","rag","studio-backend"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}