{"record":{"id":"7482efc1c3a97624","repo":"gastownhall/beads","slug":"check-blocker-status-w","errorCode":null,"errorMessage":"check blocker status: %w","messagePattern":"check blocker status: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/issueops/dependency_queries.go","lineNumber":968,"sourceCode":"\t\t\tedges = append(edges, e)\n\t\t}\n\t\t_ = rows.Close()\n\t\tif err := rows.Err(); err != nil {\n\t\t\treturn false, nil, fmt.Errorf(\"blocker edge rows from %s: %w\", depTable, err)\n\t\t}\n\t}\n\n\tif len(edges) == 0 {\n\t\treturn true, nil, nil\n\t}\n\n\tblockerIDs := make([]string, 0, len(edges))\n\tfor _, e := range edges {\n\t\tblockerIDs = append(blockerIDs, e.dependsOnID)\n\t}\n\tstatusByID, err := loadStatusByIDInTx(ctx, tx, blockerIDs)\n\tif err != nil {\n\t\treturn false, nil, fmt.Errorf(\"check blocker status: %w\", err)\n\t}\n\tvar blockers []string\n\tfor _, e := range edges {\n\t\tstatus, ok := statusByID[e.dependsOnID]\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tif status == types.StatusClosed || status == types.StatusPinned {\n\t\t\tcontinue\n\t\t}\n\t\tif e.depType != \"blocks\" {\n\t\t\tblockers = append(blockers, e.dependsOnID+\" (\"+e.depType+\")\")\n\t\t} else {\n\t\t\tblockers = append(blockers, e.dependsOnID)\n\t\t}\n\t}\n\n\treturn true, blockers, nil","sourceCodeStart":950,"sourceCodeEnd":986,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/issueops/dependency_queries.go#L950-L986","documentation":"Wraps a failure from loadStatusByIDInTx when fetching statuses of blocker issues inside IsBlockedInTx. Edges were collected successfully, but resolving each blocker's status (to decide if the issue is genuinely still blocked) failed, so the blocked answer cannot be computed.","triggerScenarios":"The batch status lookup for the collected blockerIDs fails due to issues-table query errors: schema problems, lock contention, driver failures, or a very large ID batch exceeding driver limits.","commonSituations":"Missing/migrated issues table; deadlock or lock timeout under concurrent writes; extremely long IN lists on constrained drivers.","solutions":["Inspect the wrapped error from loadStatusByIDInTx","Verify the issues table schema (id, status columns) is current","Retry on lock/deadlock errors after the conflicting transaction finishes","If IN-clause size is the problem, ensure ids are batched (buildSQLInClause chunking) or update storage version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"_ = db.QueryRow(\"SELECT COUNT(*) FROM issues\").Scan(&n) // issues table must be readable","typeGuard":null,"tryCatchPattern":"if err := issueops.IsBlocked(ctx, id); err != nil {\n\tif strings.Contains(err.Error(), \"check blocker status\") {\n\t\t// inspect issues-table health; retry after locks clear\n\t}\n\treturn err\n}","preventionTips":["Run migrations to keep issues-table schema current","Serialize heavy write workloads to avoid lock timeouts","Upgrade beads if very large ID batches hit driver limits"],"tags":["go","sql","storage","status-lookup"],"backgroundTag":"sql-query-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}