{"record":{"id":"3852dde45fc8a636","repo":"plandex-ai/plandex","slug":"failed-to-check-context-outdated-v","errorCode":null,"errorMessage":"failed to check context outdated: %v","messagePattern":"failed to check context outdated: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/lib/context_update.go","lineNumber":920,"sourceCode":"\n\t\t\t\t\ttokenDiffsById[ctx.Id] = numTokens - ctx.NumTokens\n\n\t\t\t\t\tnumUrls++\n\t\t\t\t\tupdatedContexts = append(updatedContexts, ctx)\n\t\t\t\t\treqFns[ctx.Id] = func() (*shared.UpdateContextParams, error) {\n\t\t\t\t\t\treturn &shared.UpdateContextParams{\n\t\t\t\t\t\t\tBody: string(body),\n\t\t\t\t\t\t}, nil\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}(context)\n\t\t}\n\t}\n\n\twg.Wait()\n\n\tif len(errs) > 0 {\n\t\treturn nil, fmt.Errorf(\"failed to check context outdated: %v\", errs)\n\t}\n\n\t// Identify contexts to remove\n\tvar removedContexts []*shared.Context\n\tfor id := range deleteIds {\n\t\tremovedContexts = append(removedContexts, contextsById[id])\n\t}\n\n\t// If nothing changed\n\tif len(reqFns) == 0 && len(removedContexts) == 0 {\n\t\treturn &types.ContextOutdatedResult{\n\t\t\tMsg: \"Context is up to date\",\n\t\t}, nil\n\t}\n\n\treqFn := func() (map[string]*shared.UpdateContextParams, error) {\n\t\treq := map[string]*shared.UpdateContextParams{}\n\t\tvar mu sync.Mutex","sourceCodeStart":902,"sourceCodeEnd":938,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/lib/context_update.go#L902-L938","documentation":"Aggregate error returned by checkOutdatedAndMaybeUpdateContext when any per-context goroutine appended to errs: after wg.Wait(), all collected errors are joined into one 'failed to check context outdated' error. It means the staleness check did not fully complete; at least one context (file, tree, map, or URL) could not be refreshed.","triggerScenarios":"Any goroutine in the parallel refresh appends to errs (any of errors 170–178); the first collected error is formatted into this aggregate by CheckOutdatedContext.","commonSituations":"Mixed failure batches: a deleted file raced the scan plus an unreachable URL; running on a checkout with permission problems; transient network outage during a refresh that includes URL contexts.","solutions":["Read the embedded %v list — it names each failing context and the underlying cause; fix each individually (see the specific errors).","Re-run the refresh after fixing; partial results are not applied when errs is non-empty.","Remove problem contexts (stale paths, dead URLs) so the batch can complete.","Run with correct permissions on the project directory to eliminate wholesale stat/read failures."],"exampleFix":"// before\nerrs: [failed to fetch the URL http://dead.example: dial tcp: no such host]\n// after\n# remove the dead URL context, then re-run\n<cli> context remove <url-context-id>","handlingStrategy":"try-catch","validationCode":"// pre-flight: verify each context target before batch refresh\nfor _, c := range contexts {\n    switch c.ContextType {\n    case \"file\": checkStat(c.FilePath)\n    case \"url\": checkHTTPHead(c.Url)\n    }\n}","typeGuard":null,"tryCatchPattern":"result, err := CheckOutdatedContext(ctx)\nif err != nil {\n    var agg []error\n    fmt.Sscanf(err.Error(), \"failed to check context outdated: %v\", &agg)\n    for _, e := range agg {\n        log.Printf(\"context refresh sub-failure: %v\", e) // fix each, then retry\n    }\n}","preventionTips":["Read the embedded error list — it enumerates every failing context","Pre-flight stat/HTTP checks before batch refreshes","Remove dead contexts promptly to keep refresh batches clean","Run refreshes with adequate permissions and stable network"],"tags":["aggregated","context-refresh","concurrency"],"backgroundTag":"context-refresh-failed","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}