{"record":{"id":"571d99763707d376","repo":"gastownhall/beads","slug":"server-doltserver-start-resolve-proxy-root-ident","errorCode":null,"errorMessage":"server: DoltServer.Start: resolve proxy root identity: %w","messagePattern":"server: DoltServer\\.Start: resolve proxy root identity: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/dbproxy/server/doltserver.go","lineNumber":285,"sourceCode":"\n\ts.pid = cmd.Process.Pid\n\tbirth, err := procid.Capture(s.pid)\n\tif err != nil {\n\t\t_ = cmd.Process.Kill()\n\t\t_, _ = cmd.Process.Wait()\n\t\ts.eg, s.egCtx, s.cancel, s.pid = nil, nil, nil, 0\n\t\tcancel()\n\t\tlock.Unlock()\n\t\treturn fmt.Errorf(\"server: DoltServer.Start: capture child birth identity: %w\", err)\n\t}\n\trootID, err := identity.RootID(s.rootDir)\n\tif err != nil {\n\t\t_ = cmd.Process.Kill()\n\t\t_, _ = cmd.Process.Wait()\n\t\ts.eg, s.egCtx, s.cancel, s.pid = nil, nil, nil, 0\n\t\tcancel()\n\t\tlock.Unlock()\n\t\treturn fmt.Errorf(\"server: DoltServer.Start: resolve proxy root identity: %w\", err)\n\t}\n\n\tif err := pidfile.Write(s.rootDir, PIDFileName, pidfile.PidFile{\n\t\tPid:    s.pid,\n\t\tPort:   s.config.Port(),\n\t\tSchema: pidfile.SchemaV2,\n\t\tKind:   pidfile.KindDoltBackend,\n\t\tBirth:  string(birth),\n\t\tRootID: rootID,\n\t}); err != nil {\n\t\t_ = cmd.Process.Kill()\n\t\t_, _ = cmd.Process.Wait()\n\t\ts.eg, s.egCtx, s.cancel, s.pid = nil, nil, nil, 0\n\t\tcancel()\n\t\tlock.Unlock()\n\t\treturn fmt.Errorf(\"server: DoltServer.Start: write pidfile: %w\", err)\n\t}\n","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/dbproxy/server/doltserver.go#L267-L303","documentation":"Start() could not resolve the proxy root identity for the server's root directory via identity.RootID. This identity is embedded in the pidfile so other processes can verify they are talking to a server managing the same data root. The child process is killed and start state rolled back.","triggerScenarios":"identity.RootID(s.rootDir) fails after the child spawned — typically because rootDir is not a valid/initialized dolt repository or the identity metadata files are missing/corrupt/unreadable.","commonSituations":"Pointing the server at a directory that was deleted or re-created between init and start; corruption of the dolt repo metadata; permission changes on the data dir; mixing versions whose identity format differs.","solutions":["Verify rootDir is an initialized dolt repo (contains .dolt); if not, delete the stale dir and let beads re-initialize.","Check permissions on rootDir and its metadata files.","If identity metadata is corrupt, restore from backup or re-init the repository.","Confirm the same rootDir is used consistently by all processes accessing this storage."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// rootDir must exist and contain dolt metadata before Start.\nif _, err := os.Stat(filepath.Join(rootDir, \".dolt\")); err != nil {\n    return fmt.Errorf(\"rootDir %s is not an initialized dolt repository: %w\", rootDir, err)\n}\nif !isDirWritable(rootDir) {\n    return fmt.Errorf(\"rootDir %s is not writable\", rootDir)\n}","typeGuard":null,"tryCatchPattern":"if err := srv.Start(ctx); err != nil {\n    if strings.Contains(err.Error(), \"resolve proxy root identity\") {\n        return fmt.Errorf(\"storage root %s identity unreadable/corrupt: %w\", rootDir, err)\n    }\n    return err\n}","preventionTips":["Never delete or recreate rootDir while a server manages it.","Keep data dirs on stable local storage; avoid concurrent modification by other tools.","Use the same beads/dolt version across all processes sharing a data dir.","Back up rootDir before version migrations."],"tags":["identity","repository-state","process-management"],"backgroundTag":"corrupt-repository-metadata","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}