{"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/251596fc0de2f9528c00c224252fd073a99973f4/kernel/bazaar/local.go#L58-L94","documentation":"Returned by ExtractLocalPackage (kernel/bazaar/local.go:75-78) when no manifest file is found in the extracted package directory. After iterating all five manifest file names (plugin.json, theme.json, icon.json, template.json, widget.json), if none exists as a regular file, the package type is unknown and extraction is aborted with cleanup.","triggerScenarios":"Uploading a local marketplace package zip whose root directory (or its single top-level subdirectory) contains none of the five recognized manifest files.","commonSituations":"Package author forgot to include the manifest; manifest is in a nested subdirectory rather than the root; manifest filename is misspelled (e.g. plugins.json instead of plugin.json); zip structure nests files too deeply for localPackageRoot to find.","solutions":["Add the correct manifest file (plugin.json, theme.json, icon.json, template.json, or widget.json) to the package root","Ensure the manifest is at the archive root or inside the single top-level directory","Check the manifest filename spelling against localPackageManifests in kernel/bazaar/local.go:39-45","Flatten the zip structure if manifests are nested more than one level deep"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"func hasAnyManifest(packagePath string) bool {\n    manifests := []string{\"plugin.json\", \"theme.json\", \"icon.json\", \"template.json\", \"widget.json\"}\n    for _, m := range manifests {\n        if info, err := os.Stat(filepath.Join(packagePath, m)); err == nil && info.Mode().IsRegular() {\n            return true\n        }\n    }\n    return false\n}\n// Ensure hasAnyManifest returns true before calling ExtractLocalPackage","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify the manifest file exists at the package root or in the single top-level directory before zipping","Check the manifest filename spelling: plugin.json (not plugins.json), theme.json, icon.json, template.json, widget.json","Flatten nested directory structures so the manifest is discoverable by localPackageRoot"],"tags":["bazaar","marketplace","local-package","manifest","validation","go"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}