{"record":{"id":"7fee6d1d0c917bbe","repo":"siyuan-note/siyuan","slug":"conf-language-77-msg","errorCode":null,"errorMessage":"Conf.Language(77) {msg}","messagePattern":"Conf\\.Language\\(77\\) (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/sync.go","lineNumber":613,"sourceCode":"\twebdav.Password = strings.TrimSpace(webdav.Password)\n\twebdav.Timeout = util.NormalizeTimeout(webdav.Timeout)\n\twebdav.ConcurrentReqs = util.NormalizeConcurrentReqs(webdav.ConcurrentReqs, conf.ProviderWebDAV)\n\n\tConf.Sync.WebDAV = webdav\n\tConf.Save()\n\trefreshLANSyncManager()\n\treturn\n}\n\nfunc SetSyncProviderLocal(local *conf.Local) (err error) {\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":595,"sourceCodeEnd":631,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/sync.go#L595-L631","documentation":"SetSyncProviderLocal calls filepath.Abs on the local sync endpoint; if that fails it returns fmt.Errorf(Conf.Language(77), msg) = 'Invalid dir path [<msg>]'. filepath.Abs failure is rare and usually means the path cannot be made absolute because the working directory cannot be determined or the path is malformed on the OS.","triggerScenarios":"POST /api/sync/setSyncProviderLocal with a Local endpoint that filepath.Abs cannot resolve (e.g. contains NUL bytes, or the process CWD is unavailable). The msg describes 'get endpoint [X] abs path failed: <os err>'.","commonSituations":"Path pasted from another OS with illegal characters. Relative path while the process CWD was changed/unlinked. Corrupted input from a config import.","solutions":["Provide an absolute, OS-legal filesystem path as the Local endpoint.","Remove illegal characters (NUL, control chars) from the path string.","If the path is relative, resolve it yourself first and pass the absolute form."],"exampleFix":"// before\nlocal.Endpoint = \"~/sync dir\\\\u0000\" // -> error 77 (abs failed)\n// after\nabs, _ := filepath.Abs(\"~/sync dir\")\nlocal.Endpoint = abs","handlingStrategy":"validation","validationCode":"// Go caller: pre-resolve and reject\nabs, err := filepath.Abs(local.Endpoint)\nif err != nil { return fmt.Errorf(\"invalid local path %q: %w\", local.Endpoint, err) }","typeGuard":"// Go\nfunc resolvableAbsPath(p string) bool {\n    _, err := filepath.Abs(p)\n    return err == nil\n}","tryCatchPattern":null,"preventionTips":["Normalize to an absolute path on the client before sending.","Strip control characters from pasted paths.","Validate the path against the target OS rules."],"tags":["sync","local","filesystem","validation","i18n","kernel"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}