{"record":{"id":"3b68595da816d8f3","repo":"siyuan-note/siyuan","slug":"marketplace-package-manifest-not-found","errorCode":null,"errorMessage":"marketplace package manifest not found","messagePattern":"marketplace package manifest not found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/bazaar/local.go","lineNumber":76,"sourceCode":"\t\tcleanup()\n\t\treturn\n\t}\n\n\tvar manifestPath string\n\tfor manifestName, packageType := range localPackageManifests {\n\t\tcandidate := filepath.Join(packagePath, manifestName)\n\t\tif info, statErr := os.Stat(candidate); statErr == nil && info.Mode().IsRegular() {\n\t\t\tif manifestPath != \"\" {\n\t\t\t\terr = errors.New(\"multiple marketplace package manifests found\")\n\t\t\t\tcleanup()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tpkgType = packageType\n\t\t\tmanifestPath = candidate\n\t\t}\n\t}\n\tif manifestPath == \"\" {\n\t\terr = errors.New(\"marketplace package manifest not found\")\n\t\tcleanup()\n\t\treturn\n\t}\n\n\tpkg, err = ParsePackageJSON(manifestPath)\n\tif err != nil || pkg == nil {\n\t\terr = errors.New(\"invalid marketplace package manifest\")\n\t\tcleanup()\n\t}\n\treturn\n}\n\nfunc extractLocalPackageArchive(archivePath, destination string) error {\n\treader, err := zip.OpenReader(archivePath)\n\tif err != nil {\n\t\treturn errors.New(\"invalid marketplace package archive\")\n\t}\n\tdefer reader.Close()","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/bazaar/local.go#L58-L94","documentation":"ExtractLocalPackage requires a recognized marketplace manifest (plugin.json, theme.json, icon.json, template.json, or widget.json) at the archive root or in its single top-level directory. When none of these regular files exists anywhere in the allowed root, it throws this error and cleans up the temp directory.","triggerScenarios":"Calling ExtractLocalPackage on a zip lacking any of the five manifest names, or where the manifest sits in a nested directory deeper than one level (localPackageRoot only descends one level).","commonSituations":"Packaging the wrong directory (source root without manifest); zipping a parent folder so the manifest ends up two levels deep; uploading a plain asset zip instead of a built package; typo like Plugin.json.","solutions":["Place a valid manifest (plugin.json/theme.json/icon.json/template.json/widget.json) at the archive root","Or keep exactly one top-level directory containing the manifest at its root","Ensure the manifest filename casing matches exactly","Re-zip from the directory that directly contains the manifest"],"exampleFix":"// before: archive(zip)/my-plugin/build/my-plugin/plugin.json (two levels)\n// after: archive(zip)/my-plugin/plugin.json","handlingStrategy":"validation","validationCode":"const manifests = [\"plugin.json\",\"theme.json\",\"icon.json\",\"template.json\",\"widget.json\"];\nconst hasManifest = manifests.some(f => fs.existsSync(path.join(pkgRoot, f)));\nif (!hasManifest) throw new Error(\"no marketplace manifest at archive root (or its single top-level dir)\");","typeGuard":null,"tryCatchPattern":"try { await installLocalPackage(zipPath); } catch (e) { if (String(e).includes(\"manifest not found\")) { /* guide user to add plugin.json */ } else throw e; }","preventionTips":["Zip from the directory that directly contains the manifest","Match manifest filename casing exactly","Verify with unzip -l that plugin.json appears at root or single top folder"],"tags":["bazaar","package","manifest","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}