{"record":{"id":"a226884026ed388c","repo":"siyuan-note/siyuan","slug":"conf-language-77-msg-get-endpoint-s-abs-path-failed","errorCode":null,"errorMessage":"Conf.Language(77), msg: get endpoint [%s] abs path failed","messagePattern":"Conf\\.Language\\(77\\), msg: get endpoint \\[(.+?)\\] abs path failed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/sync.go","lineNumber":700,"sourceCode":"\t}\n\n\tConf.Sync.WebDAV = webdav\n\tConf.Save()\n\trefreshLANSyncManager()\n\treturn\n}\n\nfunc SetSyncProviderLocal(local *conf.Local) (err error) {\n\trelease := lockAssetSourceChange()\n\tdefer release()\n\tlocal.Endpoint = strings.TrimSpace(local.Endpoint)\n\tlocal.Endpoint = util.NormalizeLocalPath(local.Endpoint)\n\n\tabsPath, err := filepath.Abs(local.Endpoint)\n\tif nil != err {\n\t\tmsg := fmt.Sprintf(\"get endpoint [%s] abs path failed: %s\", local.Endpoint, err)\n\t\tlogging.LogError(msg)\n\t\terr = fmt.Errorf(Conf.Language(77), msg)\n\t\treturn\n\t}\n\tif !gulu.File.IsExist(absPath) {\n\t\tmsg := fmt.Sprintf(\"endpoint [%s] not exist\", local.Endpoint)\n\t\tlogging.LogError(msg)\n\t\terr = fmt.Errorf(Conf.Language(77), msg)\n\t\treturn\n\t}\n\tif util.IsAbsPathInWorkspace(absPath) || filepath.Clean(absPath) == filepath.Clean(util.WorkspaceDir) {\n\t\tmsg := fmt.Sprintf(\"endpoint [%s] is in workspace\", local.Endpoint)\n\t\tlogging.LogError(msg)\n\t\terr = fmt.Errorf(Conf.Language(77), msg)\n\t\treturn\n\t}\n\n\tif gulu.File.IsSubPath(absPath, util.WorkspaceDir) {\n\t\tmsg := fmt.Sprintf(\"endpoint [%s] is parent of workspace\", local.Endpoint)\n\t\tlogging.LogError(msg)","sourceCodeStart":682,"sourceCodeEnd":718,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/sync.go#L682-L718","documentation":"SetSyncProviderLocal converts the configured local sync folder to an absolute path with filepath.Abs; if that fails it logs \"get endpoint [%s] abs path failed\" and wraps the log message in Conf.Language(77), the generic \"sync config failed\" user-facing error. filepath.Abs essentially only fails when Getwd fails (relative path with an unusable working directory), so this is a rare environment-level failure.","triggerScenarios":"Calling SetSyncProviderLocal (via the setSyncProviderLocalContract API) with a relative endpoint path while the kernel process's current working directory cannot be resolved (Getwd error, e.g. cwd deleted or permission-restricted), making filepath.Abs fail.","commonSituations":"Kernel launched from a directory that was removed or is no longer accessible; running the kernel as a service with a broken cwd; sandboxed/containerized environments restricting Getwd; endpoint supplied as a bare relative folder name instead of an absolute path in such an environment.","solutions":["Restart the kernel from a valid working directory so Getwd succeeds","Pass an absolute path (e.g. /home/user/siyuan-sync) as the local endpoint instead of a relative one","Check that the process's cwd exists and is readable (ls -d /proc/<pid>/cwd on Linux)","Ensure the endpoint points to an existing directory — the very next check also rejects non-existent paths with the same Language(77) error"],"exampleFix":"// before\nlocal.Endpoint = \"siyuan-sync\"  // relative path, cwd unusable\n// after\nlocal.Endpoint = \"/home/user/siyuan-sync\"","handlingStrategy":"validation","validationCode":"if !filepath.IsAbs(endpoint) {\n\tabs, err := filepath.Abs(endpoint)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot resolve endpoint %q to an absolute path: %v\", endpoint, err)\n\t}\n\tendpoint = abs\n}\nif !gulu.File.IsExist(endpoint) {\n\treturn fmt.Errorf(\"endpoint %q does not exist\", endpoint)\n}","typeGuard":null,"tryCatchPattern":"if err := model.SetSyncProviderLocal(cfg); err != nil {\n\tlog.Printf(\"local sync provider rejected: %v\", err)\n\t// fall back to a verified absolute, existing directory path\n}","preventionTips":["Always supply an absolute, existing directory as the local sync endpoint","Ensure the kernel process starts with a valid working directory","Create the target folder before configuring it as a sync endpoint","Avoid placing the sync folder inside the workspace — a separate check rejects that too"],"tags":["local-sync","filepath","filesystem","sync"],"backgroundTag":"invalid-config-value","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}