{"record":{"id":"00dca7cfad337107","repo":"siyuan-note/siyuan","slug":"conf-language-131","errorCode":null,"errorMessage":"Conf.Language(131)","messagePattern":"Conf\\.Language\\(131\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/sync.go","lineNumber":534,"sourceCode":"\t\t\tcache.RemoveDocIAL(tree.Path)\n\t\t\treturn rootID, true\n\t\t}()\n\t\tif indexed {\n\t\t\tupsertRootIDs = append(upsertRootIDs, rootID)\n\t\t}\n\t}\n\n\tif 1 > len(upsertRootIDs) {\n\t\tupsertRootIDs = []string{}\n\t}\n\treturn\n}\n\nfunc SetCloudSyncDir(name string) error {\n\trelease := lockAssetSourceChange()\n\tdefer release()\n\tif conf.ProviderS3 == Conf.Sync.Provider {\n\t\treturn errors.New(Conf.Language(131))\n\t}\n\tif !cloud.IsValidCloudDirName(name) {\n\t\treturn errors.New(Conf.Language(37))\n\t}\n\n\tif Conf.Sync.CloudName == name {\n\t\treturn nil\n\t}\n\tif err := requireCompleteAssetDownloads(); err != nil {\n\t\treturn err\n\t}\n\n\tConf.Sync.CloudName = name\n\tConf.Save()\n\trefreshLANSyncManager()\n\treturn nil\n}\n","sourceCodeStart":516,"sourceCodeEnd":552,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/sync.go#L516-L552","documentation":"SetCloudSyncDir sets the cloud sync directory (bucket) name. When the active sync provider is S3, changing the classic cloud sync directory is not supported — it returns the localized message for key 131: 'This operation is not supported, please go to the cloud storage provider management console to operate'. With S3, directories are managed as S3 buckets in the provider's console, not through this API.","triggerScenarios":"Calling /api/sync/setCloudSyncDir (or the UI equivalent) while Conf.Sync.Provider == conf.ProviderS3; test TestS3DirectorySelectionIsRejected exercises exactly this path.","commonSituations":"User switched provider to S3 and later tries to select a cloud sync directory; scripted tooling calling setCloudSyncDir without checking the current provider; frontend state stale after provider change.","solutions":["Switch the sync provider away from S3 (e.g. to the official SiYuan cloud) before calling SetCloudSyncDir","If using S3, change the bucket directly in your S3 provider's management console and update the S3 config via the S3 settings API (SetSyncProviderS3)","Update caller logic to branch on Conf.Sync.Provider before invoking this API"],"exampleFix":"// before\nmodel.SetCloudSyncDir(\"my-dir\")\n// after\nif conf.ProviderS3 != conf.Conf.Sync.Provider {\n    model.SetCloudSyncDir(\"my-dir\")\n}","handlingStrategy":"validation","validationCode":"if (window.siyuan.config.sync.provider === 3 /* S3 */) {\n  alert(\"Manage S3 buckets in your provider's console\");\n  return;\n}","typeGuard":"function isClassicCloud(p int) bool { return p != conf.ProviderS3 }","tryCatchPattern":null,"preventionTips":["Branch on Conf.Sync.Provider before calling SetCloudSyncDir","For S3, change buckets via the S3 provider console and the S3 settings API","Keep frontend provider state in sync with config to avoid stale calls"],"tags":["go","sync","s3","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}