siyuan-note/siyuan · warning

bazaar is offline

Error message

bazaar is offline

What it means

Returned by getBazaarPackages (kernel/bazaar/bazaar.go:37-43) when getStageAndBazaar reports the bazaar as not online (result.Online == false) and there is no specific StageErr and no cached StageIndex. This is the fallback error when neither the stage index could be fetched nor a cache hit was available. The public GetBazaarPackages discards the error (returns only packages), but GetBazaarPackagesMap propagates it to callers.

Source

Thrown at kernel/bazaar/bazaar.go:41

	"github.com/88250/go-humanize"
	"github.com/araddon/dateparse"
	"github.com/siyuan-note/siyuan/kernel/util"
)

// GetBazaarPackages 返回指定类型的在线集市包列表(plugins 和 themes 类型需要传递 frontend 参数)。
func GetBazaarPackages(pkgType string, frontend string) (packages []*Package) {
	packages, _ = getBazaarPackages(pkgType, frontend, true)
	return
}

func getBazaarPackages(pkgType, frontend string, showError bool) (packages []*Package, err error) {
	result := getStageAndBazaar(pkgType, showError)
	if !result.Online || nil != result.StageErr || nil == result.StageIndex {
		if nil != result.StageErr {
			err = result.StageErr
		} else {
			err = errors.New("bazaar is offline")
		}
		return make([]*Package, 0), err
	}

	packages = make([]*Package, 0, len(result.StageIndex.Repos))
	for _, repo := range result.StageIndex.Repos {
		pkg := buildBazaarPackageWithMetadata(repo, result.BazaarStats, pkgType, frontend)
		if nil == pkg {
			continue
		}
		packages = append(packages, pkg)
	}
	return
}

// GetBazaarPackagesMap 返回按包名索引的在线集市包映射(plugins 和 themes 类型需要传递 frontend 参数)。
func GetBazaarPackagesMap(pkgType, frontend string) (packagesMap map[string]*Package, err error) {
	packages, err := getBazaarPackages(pkgType, frontend, false)

View on GitHub (pinned to 251596fc0d)

Solutions

  1. Verify network connectivity to the bazaar server endpoints
  2. Check proxy/DNS settings in SiYuan's network configuration
  3. Retry after restoring connectivity — a successful fetch populates the cache for offline use
  4. If air-gapped, pre-seed the cache or accept that the marketplace is unavailable
Defensive patterns

Strategy: retry

Try / catch

packages, err := bazaar.GetBazaarPackagesMap(pkgType, frontend)
if err != nil {
    if strings.Contains(err.Error(), "bazaar is offline") {
        // Optionally retry after a delay, or degrade to installed-packages-only mode
        log.Printf("bazaar offline: %v, showing installed packages only", err)
        packages = map[string]*bazaar.Package{}
    } else {
        return err
    }
}

Prevention

When it happens

Trigger: Calling GetBazaarPackagesMap (or any API that lists marketplace packages) when SiYuan cannot reach the bazaar stage/stats servers AND has no cached index from a previous successful fetch.

Common situations: First launch with no network; corporate firewall blocking the bazaar endpoints; DNS resolution failure for the bazaar domain; the bazaar server is temporarily down; air-gapped environment with no prior cache.

Related errors


AI-assisted analysis of siyuan-note/siyuan@251596fc0d (2026-08-12). Data as JSON: /api/errors/13e225075ea2c54b. Report an issue: GitHub.