plandex-ai/plandex · error
error storing context: %v
Error message
error storing context: %v
What it means
After mutating the context in memory, the worker goroutine calls StoreContext(context, false) to persist it (create context dir, write context files, update caches/git). If StoreContext fails, the worker wraps and forwards the error. Typical inner causes are filesystem errors (mkdir/write failures, disk full, permissions) or errors in the map-cache/git steps inside StoreContext.
Source
Thrown at app/server/db/context_helpers_update.go:340
} else {
totalPlannerTokens += tokenDiff
}
mu.Unlock()
context.NumTokens = newNumTokens
} else {
context.Body = params.Body
hash := sha256.Sum256([]byte(context.Body))
context.Sha = hex.EncodeToString(hash[:])
}
// log.Println("storing context", id)
// log.Printf("context name: %s, sha: %s\n", context.Name, context.Sha)
err := StoreContext(context, false)
if err != nil {
errCh <- fmt.Errorf("error storing context: %v", err)
return
}
// log.Println("stored context", id)
// log.Println()
errCh <- nil
}(id, params)
}
for i := 0; i < len(*req); i++ {
err := <-errCh
if err != nil {
return nil, fmt.Errorf("error storing context: %v", err)
}
}
if planConfig.AutoLoadContext {View on GitHub (pinned to e2d772072e)
Solutions
- Check the inner %v error and server logs for the specific StoreContext failure
- Verify disk space, write permissions, and health of the plan data directory
- Look for git lock files (.git/index.lock) or conflicted state in the plan repo and clean them
- Retry the update once storage is healthy; a single failed context aborts the whole batch
Defensive patterns
Strategy: try-catch
Validate before calling
if err := checkStorageHealth(); err != nil {
return fmt.Errorf("storage unavailable, skipping update: %w", err)
} // check disk space and writability of the data dir before updating Try / catch
err := StoreContext(context, false)
if err != nil {
if isTransient(err) { // EINTR, temporary fs errors
time.Sleep(time.Second)
err = StoreContext(context, false)
}
return fmt.Errorf("error storing context: %v", err)
} Prevention
- Monitor disk space and inode usage on the server data volume
- Ensure the process user owns the plan context directories
- Clean stale git lock files after crashes
- Alert on StoreContext failures before they block batch updates
When it happens
Trigger: StoreContext fails for one context during UpdateContexts — e.g. os.MkdirAll fails on the plan context dir, write to disk fails, or a git operation inside StoreContext errors.
Common situations: Disk full or read-only filesystem on the server; permission problems on the data directory; concurrent writes corrupting state; git repo in a conflicted/locked state.
Related errors
- error getting git root: %s
- error getting files in git repo: %s
- error removing lock file: %v
- error loading accounts: %v
- no project root found
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/d53ade6ea3aa2435.
Report an issue: GitHub.