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

  1. Read the wrapped %v cause and fix the underlying db issue (release lock, free disk, run migrations).
  2. Retry StoreDescription for the specific assistantMsg.Id / convoCommitMsg once the database is available.
  3. Check for and close other processes holding the conversation database.
  4. Repair or recreate a corrupt database from backup if corruption errors appear.
  5. 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

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


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/613086a527c635b2. Report an issue: GitHub.