{"record":{"id":"a634c7977a305b6a","repo":"siyuan-note/siyuan","slug":"unsupported-export-path","errorCode":null,"errorMessage":"unsupported export path","messagePattern":"unsupported export path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/encrypted_export.go","lineNumber":225,"sourceCode":"\t\t\t}\n\t\t\tif _, dekErr := GetDEKIfUnlocked(boxID); dekErr != nil {\n\t\t\t\treturn nil, dekErr\n\t\t\t}\n\t\t\tlease, err = registerMobileExportLease(boxID, artifact, filepath.Base(fileName), \"\")\n\t\t\tif err == nil {\n\t\t\t\trelease = false\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tartifact := filepath.Join(util.TempDir, \"export\", fileName)\n\t\tif !gulu.File.IsSubPath(filepath.Join(util.TempDir, \"export\"), artifact) {\n\t\t\treturn nil, errors.New(\"export path is outside export directory\")\n\t\t}\n\t\treturn registerMobileExportLease(\"\", artifact, filepath.Base(fileName), \"\")\n\t}\n\n\tif !strings.HasPrefix(exportPath, \"assets/\") {\n\t\treturn nil, errors.New(\"unsupported export path\")\n\t}\n\trelativePath, boxID, parseErr := assetPathAndBox(exportPath, \"\")\n\tif parseErr != nil {\n\t\treturn nil, parseErr\n\t}\n\tif boxID == \"\" || !IsEncryptedBox(boxID) {\n\t\tartifact, resolveErr := GetAssetAbsPath(relativePath)\n\t\tif resolveErr != nil {\n\t\t\treturn nil, resolveErr\n\t\t}\n\t\tif ensureErr := EnsureAssetLocal(artifact); ensureErr != nil {\n\t\t\treturn nil, ensureErr\n\t\t}\n\t\treturn registerMobileExportLease(\"\", artifact, filepath.Base(artifact), \"\")\n\t}\n\tif !IsBoxUnlocked(boxID) {\n\t\treturn nil, errors.New(Conf.Language(314))\n\t}","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/encrypted_export.go#L207-L243","documentation":"AcquireExportArtifactLease only supports acquiring a mobile export lease for paths that begin with \"assets/\" (or managed export paths / temp-dir export file names handled earlier in the function). Any other exportPath form — notebooks, documents, arbitrary paths — is rejected with this error because the lease mechanism only knows how to resolve and materialize asset artifacts. The check runs after managed-path and temp-export-file handling, so it is the final gate for path kinds.","triggerScenarios":"Calling AcquireExportArtifactLease (directly or via materializeExportArtifact / AcquireMobileExportLease) with an exportPath that is not a managed encrypted export name, not a bare file name under temp/export, and does not start with \"assets/\" — e.g. passing a document ID, a notebook path like \"20210808180117-czj9bvb/20210915210115-0b2ldga\", or an absolute path.","commonSituations":"Plugin or client code assumes the lease API accepts any exportable block and passes a doc/notebook path; a caller passes an already-resolved absolute path instead of the \"assets/...\" form; older API payloads that used different path conventions are replayed against the new lease endpoint.","solutions":["Ensure the exportPath argument is an asset reference of the form \"assets/<file>\" (optionally scoped to an encrypted box) before calling AcquireExportArtifactLease.","If you intend to export a document or notebook, use the dedicated document/notebook export APIs instead of the asset lease API.","For a plain temp-export artifact, pass only the base file name (which is resolved under temp/export) rather than a full path."],"exampleFix":"// before\nlease, err := model.AcquireExportArtifactLease(\"20210808180117-czj9bvb/20210915210115-0b2ldga.sy\")\n// after\nlease, err := model.AcquireExportArtifactLease(\"assets/foo.png\")","handlingStrategy":"validation","validationCode":"if !strings.HasPrefix(exportPath, \"assets/\") {\n    return fmt.Errorf(\"lease requires an assets/ path, got %q\", exportPath)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only pass asset paths (\"assets/...\") to the export lease API","Route document/notebook exports to their dedicated APIs","Pass bare file names for temp-export artifacts, never full paths"],"tags":["export","validation","go-kernel"],"backgroundTag":"unsupported-operation","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}