siyuan-note/siyuan · error

Conf.Language(376)

Error message

Conf.Language(376)

What it means

checkAssetDownloadAccess enforces that on-demand asset downloading is only available to a signed-in user with sync enabled and an active subscription. When sync is off, no user is logged in, or the provider is SiYuan without a subscription, it returns localized message 376: "The asset has not been downloaded and cannot be retrieved right now".

Source

Thrown at kernel/model/asset_download.go:100

// validateAssetDownloadSourceScope 在公布新的账号身份前保留未完成的资源与历史恢复来源。
func validateAssetDownloadSourceScope(scope string) error {
	exists, err := assetDownloadStateExists()
	if err != nil || !exists {
		return err
	}
	if Conf.Repo == nil || len(Conf.Repo.Key) == 0 {
		return errors.New(Conf.Language(377))
	}
	stored, err := dejavu.ReadAssetDownloadScope(assetDownloadStatePath(), Conf.Repo.Key)
	if err != nil || stored == scope {
		return err
	}
	return requireCompleteAssetDownloads()
}

func checkAssetDownloadAccess() error {
	if Conf.Sync == nil || !Conf.Sync.Enabled || Conf.GetUser() == nil {
		return errors.New(Conf.Language(376))
	}
	switch Conf.Sync.Provider {
	case conf.ProviderSiYuan:
		if !IsSubscriber() {
			return errors.New(Conf.Language(376))
		}
	case conf.ProviderS3, conf.ProviderWebDAV, conf.ProviderLocal:
		if !IsPaidUser() {
			return errors.New(Conf.Language(376))
		}
	}
	return nil
}

func dataRelativeAssetPath(absPath string) (string, error) {
	if !filepath.IsAbs(absPath) {
		return "", fmt.Errorf("asset path must be absolute")
	}

View on GitHub (pinned to 8641553a1f)

Solutions

  1. Enable sync in Settings - About/Cloud and log into the cloud account
  2. Renew the SiYuan subscription (or switch the sync provider to S3/WebDAV/local, which only require a paid one-time unlock)
  3. Download the missing asset via full sync ("Download all" asset download mode) instead of on-demand fetch
  4. Retry the operation once the account/subscription is active

Example fix

// before: sync disabled, on-demand asset fetch fails with 376
curl -X POST http://127.0.0.1:6806/api/asset/ensureAssetLocal -d '{...}'
// after: enable sync and login first
curl -X POST http://127.0.0.1:6806/api/sync/setSyncEnable -d '{"enabled":true}'
curl -X POST http://127.0.0.1:6806/api/asset/ensureAssetLocal -d '{...}'
Defensive patterns

Strategy: try-catch

Validate before calling

const user = await fetchPost('/api/setting/getCloudUser');
const canFetch = user.data && user.data.user && user.data.user.isSubscribe;

Try / catch

try { await ensureAssetLocal(asset); } catch (e) { if (isLang376(e)) { await performSync(); /* or prompt subscription renewal */ } else throw e; }

Prevention

When it happens

Trigger: EnsureAssetLocal/EnsureAssetPrefixLocal fetching a not-yet-downloaded asset, ensureAllSyncAssets, SetSyncAssetDownloadMode, or openRepoFileWithAssets, while Conf.Sync is disabled/nil, Conf.GetUser() is nil, or Provider is SiYuan and IsSubscriber() is false.

Common situations: Clicking a link to a cloud-only asset after logging out or after the subscription expired; sync disabled in settings while opening documents referencing un-synced assets; free account using the SiYuan cloud provider.

Related errors


AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11). Data as JSON: /api/errors/cc29431096adcfb3. Report an issue: GitHub.