plandex-ai/plandex · error
failed to store description: %v
Error message
failed to store description: %v
What it means
Raised in the storeOnFinished path when db.StoreDescription(description) fails after the assistant description was generated. Unlike the assistant-message failure, storeDesc is false (the description is what failed to store) and onError is additionally given convoMessageId and commitMsg so partial state can still be reconciled. The error is returned, aborting remaining finalization.
Source
Thrown at app/server/model/plan/tell_stream_store.go:176
description = &db.ConvoMessageDescription{
OrgId: currentOrgId,
PlanId: planId,
ConvoMessageId: assistantMsg.Id,
SummarizedToMessageId: summarizedToMessageId,
BuildPathsInvalidated: map[string]bool{},
WroteFiles: false,
}
} else {
description = generatedDescription
description.ConvoMessageId = assistantMsg.Id
}
log.Println("[storeOnFinished] Storing description")
err = db.StoreDescription(description)
if err != nil {
state.onError(onErrorParams{
streamErr: fmt.Errorf("failed to store description: %v", err),
storeDesc: false,
convoMessageId: assistantMsg.Id,
commitMsg: convoCommitMsg,
})
return err
}
log.Println("[storeOnFinished] Description stored")
// store subtasks
err = db.StorePlanSubtasks(currentOrgId, planId, state.subtasks)
if err != nil {
log.Printf("Error storing plan subtasks: %v\n", err)
state.onError(onErrorParams{
streamErr: fmt.Errorf("failed to store plan subtasks: %v", err),
storeDesc: false,
convoMessageId: assistantMsg.Id,
commitMsg: convoCommitMsg,
})View on GitHub (pinned to e2d772072e)
Solutions
- Read the wrapped %v cause and fix the underlying db issue (release lock, free disk, run migrations).
- Retry StoreDescription for the specific assistantMsg.Id / convoCommitMsg once the database is available.
- Check for and close other processes holding the conversation database.
- Repair or recreate a corrupt database from backup if corruption errors appear.
- If constraints reject the description, sanitize/truncate the description before storing.
Example fix
// before
err = db.StoreDescription(description)
if err != nil {
state.onError(onErrorParams{streamErr: fmt.Errorf("failed to store description: %v", err), storeDesc: false, convoMessageId: assistantMsg.Id, commitMsg: convoCommitMsg})
return err
}
// after: truncate oversized descriptions before storing
if len(description) > maxDescriptionLen {
description = description[:maxDescriptionLen]
}
err = db.StoreDescription(description)
if err != nil {
state.onError(onErrorParams{streamErr: fmt.Errorf("failed to store description: %v", err), storeDesc: false, convoMessageId: assistantMsg.Id, commitMsg: convoCommitMsg})
return err
} Defensive patterns
Strategy: try-catch
Validate before calling
func canStoreDescription(db *DB, description string) error {
if db == nil || db.Closed() { return fmt.Errorf("db not open") }
if len(description) > maxDescriptionLen { return fmt.Errorf("description too large: %d", len(description)) }
return db.Ping()
} Try / catch
if err := db.StoreDescription(description); err != nil {
state.onError(onErrorParams{streamErr: fmt.Errorf("failed to store description: %v", err), storeDesc: false, convoMessageId: assistantMsg.Id, commitMsg: convoCommitMsg})
return fmt.Errorf("store description for %s: %w", assistantMsg.Id, err)
} Prevention
- Run migrations before session finalization writes descriptions
- Free/monitor disk space for the conversation storage volume
- Sanitize and truncate description text to schema limits
- Retry StoreDescription for the saved convoMessageId instead of losing the description
When it happens
Trigger: StoreDescription hits a database error: locked SQLite file, disk full, constraint violation on the description row (e.g. duplicate or oversized description text), or corrupt/unmigrated schema.
Common situations: Two app instances contending for the same conversation DB lock; disk quota exhausted after a long session; description text containing characters/size the schema rejects; upgrading the app without running migrations.
Related errors
- failed to store assistant message: %v
- error storing convo message description: %v
- error getting active model stream: %v
- error storing model stream: %v
- error storing description: %v
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/613086a527c635b2.
Report an issue: GitHub.