siyuan-note/siyuan · error

Conf.Language(37)

Error message

Conf.Language(37)

What it means

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.

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 251596fc0d)

Solutions

  1. Use a short lowercase name with only letters, digits, and hyphens (e.g. 'work-sync').
  2. Keep length at or under 63 characters.
  3. Remove spaces and all punctuation; re-run the create call.

Example fix

// before: name="My Sync Dir!" -> error 37
// after: name="my-sync-dir"
Defensive patterns

Strategy: validation

Validate before calling

// Go caller
name = util.RemoveInvalid(name)
if !cloud.IsValidCloudDirName(name) {
    return errors.New("name must be non-empty, no spaces/symbols, <= 63 chars")
}

Type guard

// Go
func validCloudDirName(name string) bool { return cloud.IsValidCloudDirName(util.RemoveInvalid(name)) }
// regex equivalent (S3-like): ^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$

Prevention

When it happens

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

Common situations: User types 'My Sync Dir' (spaces), 'sync_dir!' (symbol), a very long descriptive name, or leaves the field empty. Pasted names with Unicode punctuation.

Related errors


AI-assisted analysis of siyuan-note/siyuan@251596fc0d (2026-08-12). Data as JSON: /api/errors/3a9388ae6ed938fe. Report an issue: GitHub.