{"record":{"id":"3a9388ae6ed938fe","repo":"siyuan-note/siyuan","slug":"conf-language-37","errorCode":null,"errorMessage":"Conf.Language(37)","messagePattern":"Conf\\.Language\\(37\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/sync.go","lineNumber":666,"sourceCode":"\tsyncAutoRequests     = syncRequestState{}\n\tsyncManualRequests   = syncRequestState{}\n\tsyncExitRequests     = syncRequestState{}\n\tsyncUploadRequests   = syncRequestState{}\n\tsyncDownloadRequests = syncRequestState{}\n)\n\nfunc CreateCloudSyncDir(name string) (err error) {\n\tswitch Conf.Sync.Provider {\n\tcase conf.ProviderSiYuan, conf.ProviderLocal:\n\t\tbreak\n\tdefault:\n\t\terr = errors.New(Conf.Language(131))\n\t\treturn\n\t}\n\n\tname = util.RemoveInvalid(name)\n\tif !cloud.IsValidCloudDirName(name) {\n\t\treturn errors.New(Conf.Language(37))\n\t}\n\n\trepo, err := newRepository()\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = repo.CreateCloudRepo(name)\n\tif err != nil {\n\t\terr = errors.New(formatRepoErrorMsg(err))\n\t\treturn\n\t}\n\treturn\n}\n\nfunc RemoveCloudSyncDir(name string) (err error) {\n\tswitch Conf.Sync.Provider {\n\tcase conf.ProviderSiYuan, conf.ProviderLocal:","sourceCodeStart":648,"sourceCodeEnd":684,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/sync.go#L648-L684","documentation":"After stripping invalid characters (util.RemoveInvalid), CreateCloudSyncDir validates the name with cloud.IsValidCloudDirName; failure returns Conf.Language(37) = 'The cloud sync directory name (Bucket) cannot be empty, contain spaces or special symbols, and has a maximum length of 63 characters'. This enforces S3-compatible bucket naming so the same directory works across providers.","triggerScenarios":"POST /api/sync/createCloudSyncDir with a name that, even after RemoveInvalid, is empty, contains spaces/symbols, or exceeds 63 chars. Names with uppercase letters or leading/trailing hyphens may also fail the cloud naming rules.","commonSituations":"User types 'My Sync Dir' (spaces), 'sync_dir!' (symbol), a very long descriptive name, or leaves the field empty. Pasted names with Unicode punctuation.","solutions":["Use a short lowercase name with only letters, digits, and hyphens (e.g. 'work-sync').","Keep length at or under 63 characters.","Remove spaces and all punctuation; re-run the create call."],"exampleFix":"// before: name=\"My Sync Dir!\" -> error 37\n// after: name=\"my-sync-dir\"","handlingStrategy":"validation","validationCode":"// Go caller\nname = util.RemoveInvalid(name)\nif !cloud.IsValidCloudDirName(name) {\n    return errors.New(\"name must be non-empty, no spaces/symbols, <= 63 chars\")\n}","typeGuard":"// Go\nfunc validCloudDirName(name string) bool { return cloud.IsValidCloudDirName(util.RemoveInvalid(name)) }\n// regex equivalent (S3-like): ^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$","tryCatchPattern":null,"preventionTips":["Validate the name live in the UI field; show the S3-style rule.","Auto-slugify the typed name into a safe candidate.","Enforce the 63-char ceiling in the input maxlength."],"tags":["sync","cloud","validation","naming","i18n","kernel"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}