{"record":{"id":"cc29431096adcfb3","repo":"siyuan-note/siyuan","slug":"conf-language-376","errorCode":null,"errorMessage":"Conf.Language(376)","messagePattern":"Conf\\.Language\\(376\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/asset_download.go","lineNumber":100,"sourceCode":"// validateAssetDownloadSourceScope 在公布新的账号身份前保留未完成的资源与历史恢复来源。\nfunc validateAssetDownloadSourceScope(scope string) error {\n\texists, err := assetDownloadStateExists()\n\tif err != nil || !exists {\n\t\treturn err\n\t}\n\tif Conf.Repo == nil || len(Conf.Repo.Key) == 0 {\n\t\treturn errors.New(Conf.Language(377))\n\t}\n\tstored, err := dejavu.ReadAssetDownloadScope(assetDownloadStatePath(), Conf.Repo.Key)\n\tif err != nil || stored == scope {\n\t\treturn err\n\t}\n\treturn requireCompleteAssetDownloads()\n}\n\nfunc checkAssetDownloadAccess() error {\n\tif Conf.Sync == nil || !Conf.Sync.Enabled || Conf.GetUser() == nil {\n\t\treturn errors.New(Conf.Language(376))\n\t}\n\tswitch Conf.Sync.Provider {\n\tcase conf.ProviderSiYuan:\n\t\tif !IsSubscriber() {\n\t\t\treturn errors.New(Conf.Language(376))\n\t\t}\n\tcase conf.ProviderS3, conf.ProviderWebDAV, conf.ProviderLocal:\n\t\tif !IsPaidUser() {\n\t\t\treturn errors.New(Conf.Language(376))\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc dataRelativeAssetPath(absPath string) (string, error) {\n\tif !filepath.IsAbs(absPath) {\n\t\treturn \"\", fmt.Errorf(\"asset path must be absolute\")\n\t}","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/asset_download.go#L82-L118","documentation":"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\".","triggerScenarios":"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.","commonSituations":"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.","solutions":["Enable sync in Settings - About/Cloud and log into the cloud account","Renew the SiYuan subscription (or switch the sync provider to S3/WebDAV/local, which only require a paid one-time unlock)","Download the missing asset via full sync (\"Download all\" asset download mode) instead of on-demand fetch","Retry the operation once the account/subscription is active"],"exampleFix":"// before: sync disabled, on-demand asset fetch fails with 376\ncurl -X POST http://127.0.0.1:6806/api/asset/ensureAssetLocal -d '{...}'\n// after: enable sync and login first\ncurl -X POST http://127.0.0.1:6806/api/sync/setSyncEnable -d '{\"enabled\":true}'\ncurl -X POST http://127.0.0.1:6806/api/asset/ensureAssetLocal -d '{...}'","handlingStrategy":"try-catch","validationCode":"const user = await fetchPost('/api/setting/getCloudUser');\nconst canFetch = user.data && user.data.user && user.data.user.isSubscribe;","typeGuard":null,"tryCatchPattern":"try { await ensureAssetLocal(asset); } catch (e) { if (isLang376(e)) { await performSync(); /* or prompt subscription renewal */ } else throw e; }","preventionTips":["Keep sync enabled and stay logged in before fetching cloud-only assets","Maintain an active SiYuan subscription when using the SiYuan cloud provider","Prefer full sync over on-demand asset fetch when account state is uncertain","Check subscription status in the UI before bulk asset operations"],"tags":["sync","assets","subscription","authentication"],"backgroundTag":"authentication-required","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}