{"record":{"id":"41ad737bb13813af","repo":"plandex-ai/plandex","slug":"error-getting-update-request-v","errorCode":null,"errorMessage":"error getting update request: %v","messagePattern":"error getting update request: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/lib/context_update.go","lineNumber":232,"sourceCode":"\t\treturn UpdateContextResult{}, err\n\t}\n\n\tterm.StopSpinner()\n\n\tfmt.Println(\"✅ \" + updateRes.Msg)\n\n\treturn updateRes, nil\n}\n\nfunc UpdateContext(params UpdateContextParams) (UpdateContextResult, error) {\n\tvar err error\n\treqFn := params.ReqFn\n\tif reqFn == nil {\n\t\treturn UpdateContextResult{}, fmt.Errorf(\"no update request function provided\")\n\t}\n\treq, err := reqFn()\n\tif err != nil {\n\t\treturn UpdateContextResult{}, fmt.Errorf(\"error getting update request: %v\", err)\n\t}\n\tvar hasConflicts bool\n\tvar msg string\n\n\tcontextsById := map[string]*shared.Context{}\n\tfor _, context := range params.Contexts {\n\t\tcontextsById[context.Id] = context\n\t}\n\tdeleteIds := map[string]bool{}\n\tfor _, context := range params.OutdatedRes.RemovedContexts {\n\t\tdeleteIds[context.Id] = true\n\t}\n\n\tfilesToLoad := map[string]string{}\n\tfor id := range req {\n\t\tcontext := contextsById[id]\n\t\tif context.ContextType == shared.ContextFileType {\n\t\t\tfilesToLoad[context.FilePath] = context.Body","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/lib/context_update.go#L214-L250","documentation":"UpdateContext invokes params.ReqFn() to build the update request; if that closure returns an error, the whole update aborts with this wrapper. The ReqFn closure typically reads local files/urls/maps, so any error during that gathering phase surfaces here.","triggerScenarios":"Calling UpdateContext where reqFn() fails — underlying file reads fail (file deleted/permission), URL fetch fails, or a map-generation (tree/map tokenization) step errors inside the closure.","commonSituations":"Files changed or disappeared between the outdated check and the update; network failure fetching a URL-based context; token-counting service failure for large files.","solutions":["Inspect the wrapped %v error for the specific file/URL that failed","Re-run the outdated check (plandex context) to refresh state before updating","Restore or remove the missing/unreadable file, then update context again","For URL contexts, verify network access and that the URL still resolves"],"exampleFix":"// before: assuming reqFn always succeeds\nres, err := lib.UpdateContext(params)\n// after: retry once after re-checking outdated state\nres, err := lib.UpdateContext(params)\nif err != nil && strings.Contains(err.Error(), \"error getting update request\") {\n    outdated, _, _ := lib.CheckOutdatedContext(contexts, paths)\n    params.ReqFn = outdated.ReqFn\n    res, err = lib.UpdateContext(params)\n}","handlingStrategy":"retry","validationCode":"// ensure reqFn dependencies (files/urls) are available before calling\nif err := allContextFilesReadable(contexts); err != nil { return err }","typeGuard":null,"tryCatchPattern":"res, err := lib.UpdateContext(params)\nif err != nil && strings.Contains(err.Error(), \"error getting update request\") {\n    // rebuild the request fn from a fresh outdated check, then retry once\n    outdated, _ := lib.CheckOutdatedContext(contexts, paths)\n    if outdated != nil && outdated.ReqFn != nil {\n        params.ReqFn = outdated.ReqFn\n        res, err = lib.UpdateContext(params)\n    }\n}","preventionTips":["Re-check outdated state immediately before updating","Don't modify/delete context files between check and update","Verify network access for URL-based contexts","Log the inner reqFn error for diagnosis"],"tags":["go","callback","filesystem","network"],"backgroundTag":"callback-failed","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}