siyuan-note/siyuan · error
Conf.Language(131)
Error message
Conf.Language(131)
What it means
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.
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
Example fix
// before
model.SetCloudSyncDir("my-dir")
// after
if conf.ProviderS3 != conf.Conf.Sync.Provider {
model.SetCloudSyncDir("my-dir")
} Defensive patterns
Strategy: validation
Validate before calling
if (window.siyuan.config.sync.provider === 3 /* S3 */) {
alert("Manage S3 buckets in your provider's console");
return;
} Type guard
function isClassicCloud(p int) bool { return p != conf.ProviderS3 } Prevention
- 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
When it happens
Trigger: Calling /api/sync/setCloudSyncDir (or the UI equivalent) while Conf.Sync.Provider == conf.ProviderS3; test TestS3DirectorySelectionIsRejected exercises exactly this path.
Common situations: 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.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19).
Data as JSON: /api/errors/00dca7cfad337107.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/model/sync.go:534
cache.RemoveDocIAL(tree.Path)
return rootID, true
}()
if indexed {
upsertRootIDs = append(upsertRootIDs, rootID)
}
}
if 1 > len(upsertRootIDs) {
upsertRootIDs = []string{}
}
return
}
func SetCloudSyncDir(name string) error {
release := lockAssetSourceChange()
defer release()
if conf.ProviderS3 == Conf.Sync.Provider {
return errors.New(Conf.Language(131))
}
if !cloud.IsValidCloudDirName(name) {
return errors.New(Conf.Language(37))
}
if Conf.Sync.CloudName == name {
return nil
}
if err := requireCompleteAssetDownloads(); err != nil {
return err
}
Conf.Sync.CloudName = name
Conf.Save()
refreshLANSyncManager()
return nil
}
View on GitHub (pinned to 9f775e8a12)