siyuan-note/siyuan · error
Conf.Language(77)
Error message
Conf.Language(77)
What it means
SetSyncProviderLocal configures the local filesystem as sync provider; the endpoint must resolve to an absolute path. If filepath.Abs fails on the normalized endpoint (typically because the path is malformed or the working directory is unusable), the kernel logs the detail and returns localized message 77 formatted with the diagnostic msg. The provider is not switched on failure.
Source
Thrown at kernel/model/sync.go:650
}
Conf.Sync.WebDAV = webdav
Conf.Save()
refreshLANSyncManager()
return
}
func SetSyncProviderLocal(local *conf.Local) (err error) {
release := lockAssetSourceChange()
defer release()
local.Endpoint = strings.TrimSpace(local.Endpoint)
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)View on GitHub (pinned to 8641553a1f)
Solutions
- Supply a valid, existing local directory path as local.Endpoint (e.g. D:\SiYuanSync or /home/user/siyuan-sync).
- Normalize the path first (forward slashes on Windows, no relative fragments) and confirm it is well-formed.
- Check kernel logs for the 'get endpoint ... abs path failed' line to see the underlying OS error.
Example fix
// before local.Endpoint = "D:\\sync?dir" // invalid Windows path chars // after local.Endpoint = "D:\\siyuan-sync" model.SetSyncProviderLocal(local)
Defensive patterns
Strategy: validation
Validate before calling
function canSetLocalEndpoint(endpoint) {
return typeof endpoint === "string" && endpoint.trim().length > 0 && !/[?*<>|]/.test(endpoint);
} Try / catch
if err := model.SetSyncProviderLocal(local); err != nil {
// Language(77): surface the formatted detail; check logs for 'abs path failed'
return err
} Prevention
- Ensure the endpoint is a well-formed path for the current OS
- Avoid reserved/illegal filename characters, especially on Windows
- Use absolute paths instead of relying on relative resolution
When it happens
Trigger: Calling /api/sync/setSyncProviderLocal with local.Endpoint that filepath.Abs cannot resolve — e.g. extremely long paths, paths with invalid characters on Windows, or an empty endpoint combined with a failed current-directory lookup.
Common situations: Passing an empty or whitespace-only endpoint whose normalization still yields something unresolvable; Windows paths with reserved characters ("?", "*", control chars); running in an environment where the process working directory was deleted.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- load tree failed: %s
- install local marketplace package failed: %w; rollback faile
- Invalid dir path [%s]
- read session file failed: %w
- create session dir failed: %w
AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11).
Data as JSON: /api/errors/49e8d711f38acf9d.
Report an issue: GitHub.