{"record":{"id":"8f1f4979d4004a41","repo":"gastownhall/beads","slug":"fetch-from-s-s-w-8f1f49","errorCode":null,"errorMessage":"fetch from %s/%s: %w","messagePattern":"fetch from (.+?)/(.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/versioncontrolops/remotes.go","lineNumber":127,"sourceCode":"\treturn PullWithStrategy(ctx, db, remote, branch, user, \"\")\n}\n\n// PullWithStrategy is Pull with the #4992 part 2 operator escape hatch:\n// conflicts TryAutoResolveMergeConflicts declines are, when strategy is\n// non-empty, resolved with strategy (\"ours\" or \"theirs\") instead of aborting\n// the pull for the operator to resolve out-of-band. strategy == \"\" is exactly\n// Pull's behavior. See MergeAndSettleWithStrategy/SettleMerge for the\n// resolution logic.\nfunc PullWithStrategy(ctx context.Context, db DBConn, remote, branch, user, strategy string) error {\n\tif err := withRemoteEnvGuards(func() error {\n\t\tif user != \"\" {\n\t\t\t_, err := db.ExecContext(ctx, \"CALL DOLT_FETCH('--user', ?, ?, ?)\", user, remote, branch)\n\t\t\treturn err\n\t\t}\n\t\t_, err := db.ExecContext(ctx, \"CALL DOLT_FETCH(?, ?)\", remote, branch)\n\t\treturn err\n\t}); err != nil {\n\t\treturn fmt.Errorf(\"fetch from %s/%s: %w\", remote, branch, err)\n\t}\n\ttrackingRef := remote + \"/\" + branch\n\tif err := MergeAndSettleWithStrategy(ctx, db, trackingRef, strategy); err != nil {\n\t\treturn fmt.Errorf(\"merge %s: %w\", trackingRef, err)\n\t}\n\treturn nil\n}\n","sourceCodeStart":109,"sourceCodeEnd":135,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/versioncontrolops/remotes.go#L109-L135","documentation":"PullWithStrategy wraps a failed DOLT_FETCH step (CALL DOLT_FETCH([--user], remote, branch)) as \"fetch from <remote>/<branch>: <underlying>\". The library throws it because the pull is split into an explicit fetch (to avoid a Dolt embedded-mode panic on unconfigured upstream tracking, GH#3144) followed by a local merge; this error identifies the network/fetch half of that split. Any fetch failure — remote not found, auth failure, unreachable peer, unknown branch — surfaces here before merging is attempted.","triggerScenarios":"Calling Pull or PullWithStrategy when the remote is unconfigured or misspelled; the branch does not exist on the remote; --user is given but DOLT_REMOTE_PASSWORD is missing/wrong in the server env; the peer is unreachable over the network.","commonSituations":"First sync against a remote added with a different name; expired or rotated remote credentials; offline laptop / DNS failure; pulling a branch the peer deleted.","solutions":["Check the remote name against dolt_remotes (bd vc remote list) and confirm the branch exists on the remote.","Set DOLT_REMOTE_PASSWORD in the server environment or pass the correct user to authenticate.","Fix the wrapped network error (connectivity, DNS, TLS) and retry the pull.","If the branch was deleted upstream, create it on the remote or stop pulling it."],"exampleFix":"// before\nerr := versioncontrolops.Pull(ctx, db, \"orgin\", \"main\", \"\") // typo'd remote\n// after\nerr := versioncontrolops.Pull(ctx, db, \"origin\", \"main\", \"\") // after adding remote 'origin' and setting DOLT_REMOTE_PASSWORD","handlingStrategy":"retry","validationCode":"remotes, err := versioncontrolops.ListRemotes(ctx, db)\nif err != nil { return err }\nvalid := false\nfor _, r := range remotes {\n    if r.Name == remote { valid = true }\n}\nif !valid { return fmt.Errorf(\"remote %q not found; add it first\", remote) }\nif user != \"\" && os.Getenv(\"DOLT_REMOTE_PASSWORD\") == \"\" {\n    return fmt.Errorf(\"DOLT_REMOTE_PASSWORD must be set for user %q\", user)\n}","typeGuard":null,"tryCatchPattern":"err := versioncontrolops.Pull(ctx, db, remote, branch, user)\nif err != nil && strings.HasPrefix(err.Error(), \"fetch from \") {\n    if isTransientNetErr(err) {\n        time.Sleep(backoff)\n        err = versioncontrolops.Pull(ctx, db, remote, branch, user)\n    }\n    if err != nil { return fmt.Errorf(\"pull aborted at fetch step: %w\", err) }\n}","preventionTips":["Add remotes with a consistent, documented name (e.g. 'origin') and list them before scripted pulls.","Keep DOLT_REMOTE_PASSWORD set wherever the embedded Dolt server runs.","Do a standalone versioncontrolops.Fetch as a preflight in scripts to separate network problems from merge problems.","Retry pulls with exponential backoff only on network-class wrapped errors."],"tags":["git","dolt","fetch","remote","network"],"backgroundTag":"git-fetch-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}