{"record":{"id":"49f67576cb561f7a","repo":"gastownhall/beads","slug":"commit-w","errorCode":null,"errorMessage":"commit: %w","messagePattern":"commit: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/import.go","lineNumber":360,"sourceCode":"\t\timportResult, err := importIssuesCore(ctx, \"\", store, issues, opts)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"import failed: %w\", err)\n\t\t}\n\t\tapplyImportOutcome(&result, importResult)\n\t}\n\n\tif result.Created > 0 || result.Memories > 0 {\n\t\tcommitMsg := fmt.Sprintf(\"bd import: %d issues\", result.Created)\n\t\tif result.Memories > 0 {\n\t\t\tcommitMsg += fmt.Sprintf(\", %d memories\", result.Memories)\n\t\t}\n\t\tcommitMsg += fmt.Sprintf(\" from %s\", filepath.Base(source))\n\t\tif err := store.Commit(ctx, commitMsg); err != nil {\n\t\t\t// An import can be a working-set no-op: re-importing an\n\t\t\t// identical snapshot, or equal-timestamp rows whose guarded\n\t\t\t// upsert kept every local column (bd-hj85c).\n\t\t\tif !strings.Contains(err.Error(), \"nothing to commit\") {\n\t\t\t\treturn fmt.Errorf(\"commit: %w\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Sync issue_prefix from config.yaml to the database if stale (be-llaf).\n\t// store.Commit skips the config table (GH#2455), so we use CommitWithConfig\n\t// for this intentional config update after the issues commit completes.\n\t// config.yaml is authoritative here and existing issue IDs are intentionally\n\t// left unchanged: this deliberately bypasses the `bd config set issue_prefix`\n\t// guard for the import/migration flow and is not a rename.\n\tif yamlPrefix := config.GetString(\"issue-prefix\"); yamlPrefix != \"\" {\n\t\tif dbPrefix, _ := store.GetConfig(ctx, \"issue_prefix\"); dbPrefix != yamlPrefix {\n\t\t\tif setErr := store.SetConfig(ctx, \"issue_prefix\", yamlPrefix); setErr == nil {\n\t\t\t\t_ = store.CommitWithConfig(ctx, \"bd import: sync issue_prefix from config.yaml\")\n\t\t\t}\n\t\t}\n\t}\n","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/import.go#L342-L378","documentation":"After writing records, classic import commits the transaction via store.Commit; any commit error that is not the benign 'nothing to commit' no-op is surfaced as `commit: <cause>`. This is the final durability step of the import.","triggerScenarios":"`bd import` created/updated records but store.Commit failed: database locked by a concurrent process, storage driver error, disk full, or a non-'nothing to commit' failure inside the Dolt-backed commit.","commonSituations":"Another bd session mid-write during import; read-only database mount; insufficient disk space; driver-level commit aborts on large imports.","solutions":["Read the wrapped error after `commit:` for the storage-level cause","Ensure no concurrent bd process is writing, then re-run the import","Free disk space / restore write permissions on the database and its directory","Run `bd doctor` and, if the repo uses remote sync, `bd dolt pull` before retrying"],"exampleFix":"// before\n$ bd import data.jsonl\ncommit: database is locked\n// after\n$ bd doctor                       # confirm no locks\n$ bd import data.jsonl            # retry import cleanly","handlingStrategy":"retry","validationCode":"bd doctor   # no locks, writable DB, healthy driver\n[ -w .beads/ ] || echo 'database dir not writable'","typeGuard":null,"tryCatchPattern":"for i in 1 2 3; do\n  bd import data.jsonl && break\n  grep -q 'commit:' <(bd import data.jsonl 2>&1) && sleep $((i*i))\ndone","preventionTips":["Serialize imports; never run two bd writers concurrently","Keep the database volume writable with adequate free space","Run bd doctor after any commit failure before retrying","For synced repos, bd dolt pull before large imports to reduce conflict risk"],"tags":["storage","commit","cli"],"backgroundTag":"commit-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}