siyuan-note/siyuan · error

Invalid dir path [%s]

Error message

Invalid dir path [%s]

What it means

SetSyncProviderLocal reports 'endpoint [x] is in workspace' wrapped in i18n key 77 when util.IsAbsPathInWorkspace(absPath) is true or the endpoint equals the workspace directory itself. Using the workspace (or a folder inside it) as the sync target would make the sync directory contain the very data being synced, so the setting is refused before Conf is saved.

Source

Thrown at kernel/model/sync.go:625

	local.Endpoint = util.NormalizeLocalPath(local.Endpoint)

	absPath, err := filepath.Abs(local.Endpoint)
	if nil != err {
		msg := fmt.Sprintf("get endpoint [%s] abs path failed: %s", local.Endpoint, err)
		logging.LogError(msg)
		err = fmt.Errorf(Conf.Language(77), msg)
		return
	}
	if !gulu.File.IsExist(absPath) {
		msg := fmt.Sprintf("endpoint [%s] not exist", local.Endpoint)
		logging.LogError(msg)
		err = fmt.Errorf(Conf.Language(77), msg)
		return
	}
	if util.IsAbsPathInWorkspace(absPath) || filepath.Clean(absPath) == filepath.Clean(util.WorkspaceDir) {
		msg := fmt.Sprintf("endpoint [%s] is in workspace", local.Endpoint)
		logging.LogError(msg)
		err = fmt.Errorf(Conf.Language(77), msg)
		return
	}

	if gulu.File.IsSubPath(absPath, util.WorkspaceDir) {
		msg := fmt.Sprintf("endpoint [%s] is parent of workspace", local.Endpoint)
		logging.LogError(msg)
		err = fmt.Errorf(Conf.Language(77), msg)
		return
	}

	local.Timeout = util.NormalizeTimeout(local.Timeout)
	local.ConcurrentReqs = util.NormalizeConcurrentReqs(local.ConcurrentReqs, conf.ProviderLocal)

	Conf.Sync.Local = local
	Conf.Save()
	refreshLANSyncManager()
	return
}

View on GitHub (pinned to afa823b6b4)

Solutions

  1. Choose a directory outside the workspace, for example a sibling folder like ~/SiYuanSync
  2. Create a dedicated top-level folder on the same volume and use it as the endpoint

Example fix

// before
local.Endpoint = "/home/user/SiYuan" // the workspace itself
// after
local.Endpoint = "/home/user/SiYuanSync"
Defensive patterns

Strategy: validation

Validate before calling

abs, _ := filepath.Abs(util.NormalizeLocalPath(local.Endpoint))
if util.IsAbsPathInWorkspace(abs) || filepath.Clean(abs) == filepath.Clean(util.WorkspaceDir) {
	return errors.New("endpoint must be outside the workspace")
}
model.SetSyncProviderLocal(local)

Prevention

When it happens

Trigger: SetSyncProviderLocal with an endpoint that resolves under the workspace directory, or exactly to the workspace directory.

Common situations: Pointing sync at ~/SiYuan to 'keep everything together'; selecting the workspace folder through the directory picker.

Related errors


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