{"record":{"id":"613086a527c635b2","repo":"plandex-ai/plandex","slug":"failed-to-store-description-v","errorCode":null,"errorMessage":"failed to store description: %v","messagePattern":"failed to store description: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/server/model/plan/tell_stream_store.go","lineNumber":176,"sourceCode":"\t\t\tdescription = &db.ConvoMessageDescription{\n\t\t\t\tOrgId:                 currentOrgId,\n\t\t\t\tPlanId:                planId,\n\t\t\t\tConvoMessageId:        assistantMsg.Id,\n\t\t\t\tSummarizedToMessageId: summarizedToMessageId,\n\t\t\t\tBuildPathsInvalidated: map[string]bool{},\n\t\t\t\tWroteFiles:            false,\n\t\t\t}\n\t\t} else {\n\t\t\tdescription = generatedDescription\n\t\t\tdescription.ConvoMessageId = assistantMsg.Id\n\t\t}\n\n\t\tlog.Println(\"[storeOnFinished] Storing description\")\n\t\terr = db.StoreDescription(description)\n\n\t\tif err != nil {\n\t\t\tstate.onError(onErrorParams{\n\t\t\t\tstreamErr:      fmt.Errorf(\"failed to store description: %v\", err),\n\t\t\t\tstoreDesc:      false,\n\t\t\t\tconvoMessageId: assistantMsg.Id,\n\t\t\t\tcommitMsg:      convoCommitMsg,\n\t\t\t})\n\t\t\treturn err\n\t\t}\n\t\tlog.Println(\"[storeOnFinished] Description stored\")\n\n\t\t// store subtasks\n\t\terr = db.StorePlanSubtasks(currentOrgId, planId, state.subtasks)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Error storing plan subtasks: %v\\n\", err)\n\t\t\tstate.onError(onErrorParams{\n\t\t\t\tstreamErr:      fmt.Errorf(\"failed to store plan subtasks: %v\", err),\n\t\t\t\tstoreDesc:      false,\n\t\t\t\tconvoMessageId: assistantMsg.Id,\n\t\t\t\tcommitMsg:      convoCommitMsg,\n\t\t\t})","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/model/plan/tell_stream_store.go#L158-L194","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nerr = db.StoreDescription(description)\nif err != nil {\n    state.onError(onErrorParams{streamErr: fmt.Errorf(\"failed to store description: %v\", err), storeDesc: false, convoMessageId: assistantMsg.Id, commitMsg: convoCommitMsg})\n    return err\n}\n// after: truncate oversized descriptions before storing\nif len(description) > maxDescriptionLen {\n    description = description[:maxDescriptionLen]\n}\nerr = db.StoreDescription(description)\nif err != nil {\n    state.onError(onErrorParams{streamErr: fmt.Errorf(\"failed to store description: %v\", err), storeDesc: false, convoMessageId: assistantMsg.Id, commitMsg: convoCommitMsg})\n    return err\n}","handlingStrategy":"try-catch","validationCode":"func canStoreDescription(db *DB, description string) error {\n    if db == nil || db.Closed() { return fmt.Errorf(\"db not open\") }\n    if len(description) > maxDescriptionLen { return fmt.Errorf(\"description too large: %d\", len(description)) }\n    return db.Ping()\n}","typeGuard":null,"tryCatchPattern":"if err := db.StoreDescription(description); err != nil {\n    state.onError(onErrorParams{streamErr: fmt.Errorf(\"failed to store description: %v\", err), storeDesc: false, convoMessageId: assistantMsg.Id, commitMsg: convoCommitMsg})\n    return fmt.Errorf(\"store description for %s: %w\", assistantMsg.Id, err)\n}","preventionTips":["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"],"tags":["database","persistence","storage"],"backgroundTag":"database-write-failed","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}