siyuan-note/siyuan · error
incomplete bazaar index metadata
Error message
incomplete bazaar index metadata
What it means
A schema-2-or-compatible index must contain a "packages" key alongside "meta". When meta is present and its schema is within the client's supported range, but the top-level object has no "packages" entry, the parser rejects the index as incomplete — the package listing is the core payload of the index.
Source
Thrown at kernel/bazaar/index.go:225
}
metaRaw, hasMeta := raw["meta"]
packagesRaw, hasPackages := raw["packages"]
if hasMeta {
if err = json.Unmarshal(metaRaw, &ret.meta); nil != err {
return nil, err
}
if 2 > ret.meta.Schema {
return nil, fmt.Errorf("invalid bazaar index schema: %d", ret.meta.Schema)
}
if "" == strings.TrimSpace(ret.meta.Generation) || 1 > ret.meta.PublishedAt {
return nil, errors.New("invalid bazaar index generation metadata")
}
if bazaarIndexSchema < ret.meta.Schema {
ret.meta.RatingsAvailable = false
} else {
if !hasPackages {
return nil, errors.New("incomplete bazaar index metadata")
}
if err = json.Unmarshal(packagesRaw, &ret.packages); nil != err {
return nil, err
}
if nil == ret.packages {
return nil, errors.New("invalid bazaar index packages")
}
for packageName, pkg := range ret.packages {
if !IsValidPackageName(packageName) || nil == pkg || !isValidBazaarRepo(pkg.Repo) || 0 > pkg.Downloads {
return nil, fmt.Errorf("invalid bazaar index package: %s", packageName)
}
if nil != pkg.Rating {
rating, valid := normalizePackageRating(pkg.Rating)
if !valid {
return nil, fmt.Errorf("invalid bazaar package rating: %s", packageName)
}
pkg.Rating = rating
}View on GitHub (pinned to 8641553a1f)
Solutions
- Regenerate and republish the index including both meta and a non-null packages object
- Add a server-side publish check that both top-level keys exist before upload
- If running a mirror/mock, copy a complete upstream index instead of a meta-only snippet
- Retry later — the client refresh loop will pick up a corrected index
Example fix
// before
{"meta": {"schema": 2, "generation": "g", "publishedAt": 1}}
// after
{"meta": {"schema": 2, "generation": "g", "publishedAt": 1}, "packages": {"some-plugin": {...}}} Defensive patterns
Strategy: validation
Validate before calling
// ensure both top-level keys exist before trusting/publishing an index
var keys map[string]json.RawMessage
json.Unmarshal(body, &keys)
if _, ok := keys["meta"]; !ok || !strings.Contains(string(keys["meta"]), "schema") || _, has := keys["packages"]; !has {
return errors.New("index must contain meta and packages")
} Try / catch
if err != nil && strings.Contains(err.Error(), "incomplete bazaar index metadata") {
// keep cached snapshot; the published index is missing a required section
} Prevention
- Publish meta and packages atomically — build the complete object then upload once
- Add a post-publish smoke test that fetches the index and asserts both keys
- For mirrors, copy whole upstream indexes rather than partial sections
When it happens
Trigger: parseBazaarIndex gets an object like {"meta": {...}} with schema 2..bazaarIndexSchema and no "packages" key; also triggered when "packages" is present without "meta" (the else-if branch at index.go:247 returns the same message).
Common situations: A partially written index uploaded by the publisher (meta updated, packages section dropped); a test fixture with meta only; an aggregation step on the server that failed to serialize the packages map.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- invalid frontend capability [%s]: %w
- invalid tool arguments: %w
- invalid capability arguments: %w
- invalid null bazaar index
- invalid bazaar index schema: %d
AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11).
Data as JSON: /api/errors/6f8e5a6853c2feff.
Report an issue: GitHub.