{"record":{"id":"ff2870d92048ff45","repo":"siyuan-note/siyuan","slug":"the-cloud-sync-directory-name-bucket-cannot-be-e","errorCode":null,"errorMessage":"The cloud sync directory name (Bucket) cannot be empty, contain spaces or special symbols, and has a maximum length of 63 characters","messagePattern":"The cloud sync directory name \\(Bucket\\) cannot be empty, contain spaces or special symbols, and has a maximum length of 63 characters","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/afa823b6b4e4f183511e0bc0a3be93caa94c7c97/kernel/model/sync.go#L648-L684","documentation":"CreateCloudSyncDir validates the name with cloud.IsValidCloudDirName after util.RemoveInvalid has stripped some characters; failure returns i18n key 37 ('The cloud sync directory name (Bucket) cannot be empty, contain spaces or special symbols, and has a maximum length of 63 characters'). The name must be a bucket-style identifier.","triggerScenarios":"Passing a name that is empty, contains spaces or special symbols (including full-width punctuation like the ideographic space or full-width slash), or is longer than 63 characters.","commonSituations":"Pasting names like 'My Backup 目录' or names with slashes; an IME inserting full-width characters.","solutions":["Use 1-63 characters of ASCII letters, digits, hyphen and underscore only","Enter an ASCII name without spaces, then retry"],"exampleFix":"// before\nmodel.CreateCloudSyncDir(\"我的 同步目录/\")\n// after\nmodel.CreateCloudSyncDir(\"main-backup\")","handlingStrategy":"validation","validationCode":"func validCloudDirName(name string) bool {\n\tif name == \"\" || len(name) > 63 {\n\t\treturn false\n\t}\n\tfor _, r := range name {\n\t\tswitch {\n\t\tcase r >= 'a' && r <= 'z', r >= '0' && r <= '9', r == '-', r == '_':\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nif !validCloudDirName(name) {\n\treturn errors.New(\"name must be 1-63 chars of letters/digits/hyphen/underscore\")\n}\nmodel.CreateCloudSyncDir(name)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restrict bucket-name inputs to lowercase letters, digits, hyphen and underscore","Reject full-width punctuation and spaces client-side before submitting"],"tags":["sync","bucket-name","validation"],"backgroundTag":"invalid-bucket-name","analyzedSha":"afa823b6b4e4f183511e0bc0a3be93caa94c7c97","analyzedAt":"2026-08-18T17:04:10.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}