siyuan-note/siyuan · error

The cloud sync directory name (Bucket) cannot be empty, cont

Error message

The cloud sync directory name (Bucket) cannot be empty, contain spaces or special symbols, and has a maximum length of 63 characters

What it means

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.

Source

Thrown at kernel/model/sync.go:666

	syncAutoRequests     = syncRequestState{}
	syncManualRequests   = syncRequestState{}
	syncExitRequests     = syncRequestState{}
	syncUploadRequests   = syncRequestState{}
	syncDownloadRequests = syncRequestState{}
)

func CreateCloudSyncDir(name string) (err error) {
	switch Conf.Sync.Provider {
	case conf.ProviderSiYuan, conf.ProviderLocal:
		break
	default:
		err = errors.New(Conf.Language(131))
		return
	}

	name = util.RemoveInvalid(name)
	if !cloud.IsValidCloudDirName(name) {
		return errors.New(Conf.Language(37))
	}

	repo, err := newRepository()
	if err != nil {
		return
	}

	err = repo.CreateCloudRepo(name)
	if err != nil {
		err = errors.New(formatRepoErrorMsg(err))
		return
	}
	return
}

func RemoveCloudSyncDir(name string) (err error) {
	switch Conf.Sync.Provider {
	case conf.ProviderSiYuan, conf.ProviderLocal:

View on GitHub (pinned to afa823b6b4)

Solutions

  1. Use 1-63 characters of ASCII letters, digits, hyphen and underscore only
  2. Enter an ASCII name without spaces, then retry

Example fix

// before
model.CreateCloudSyncDir("我的 同步目录/")
// after
model.CreateCloudSyncDir("main-backup")
Defensive patterns

Strategy: validation

Validate before calling

func validCloudDirName(name string) bool {
	if name == "" || len(name) > 63 {
		return false
	}
	for _, r := range name {
		switch {
		case r >= 'a' && r <= 'z', r >= '0' && r <= '9', r == '-', r == '_':
		default:
			return false
		}
	}
	return true
}

if !validCloudDirName(name) {
	return errors.New("name must be 1-63 chars of letters/digits/hyphen/underscore")
}
model.CreateCloudSyncDir(name)

Prevention

When it happens

Trigger: 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.

Common situations: Pasting names like 'My Backup 目录' or names with slashes; an IME inserting full-width characters.

Related errors


AI-assisted analysis of siyuan-note/siyuan@afa823b6b4 (2026-08-18). Data as JSON: /api/errors/ff2870d92048ff45. Report an issue: GitHub.