{"record":{"id":"62a64025f968491b","repo":"NationalSecurityAgency/ghidra","slug":"no-desctable-rows-matching-id","errorCode":null,"errorMessage":"No desctable rows matching id","messagePattern":"No desctable rows matching id","errorType":"exception","errorClass":"SQLException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/tables/DescriptionTable.java","lineNumber":115,"sourceCode":"\n\t/**\n\t * Given the row id of the function within desctable, extract the FunctionDescription object\n\t * @param descManager is the container which will hold the object\n\t * @param rowId is the row id of the function within desctable\n\t * @return the FunctionDescription\n\t * @throws SQLException if there is a problem creating or executing the query\n\t * @throws LSHException if there is a problem parsing the result set\n\t */\n\tpublic FunctionDescription querySingleDescriptionId(DescriptionManager descManager, long rowId)\n\t\tthrows SQLException, LSHException {\n\t\tPreparedStatement s = selectByRowIdStatement.prepareIfNeeded(\n\t\t\t() -> db.prepareStatement(\"SELECT ALL * FROM desctable WHERE id = ?\"));\n\t\ts.setLong(1, rowId);\n\t\ttry (ResultSet rs = s.executeQuery()) {\n\t\t\tFunctionDescription fres;\n\t\t\tfres = extractSingleDescriptionRow(rs, descManager);\n\t\t\tif (fres == null) {\n\t\t\t\tthrow new SQLException(\"No desctable rows matching id\");\n\t\t\t}\n\t\t\treturn fres;\n\t\t}\n\t}\n\n\t/**\n\t * Process a result set (expected to contain a single row) from desctable,\n\t * building the FunctionDescription object described by the row\n\t * @param resultSet is the result set\n\t * @param descManager is the container that will hold the resulting FunctionDescription\n\t * @return the new FunctionDescription\n\t * @throws SQLException if there is a problem creating or executing the query\n\t * @throws LSHException if there is a problem creating the executable record\n\t */\n\tprivate FunctionDescription extractSingleDescriptionRow(ResultSet resultSet,\n\t\tDescriptionManager descManager) throws SQLException, LSHException {\n\t\tboolean finished = false;\n\t\tDescriptionRow currow = null;","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/tables/DescriptionTable.java#L97-L133","documentation":"Thrown by DescriptionTable.querySingleDescriptionId when a SELECT on desctable for a specific row id returns no rows (extractSingleDescriptionRow yields null). The requested function-description row id does not exist in the desctable, indicating a stale or invalid id was passed — likely an id from a different/older database or a referential integrity break.","triggerScenarios":"Calling querySingleDescriptionId(descManager, rowId) with a rowId that has no matching row in desctable. Occurs when an id obtained from one database is used against another, when the row was deleted, or when a corrupted/partial database is missing rows. The function id stored in a vector or callgraph entry points to a non-existent desctable row.","commonSituations":"Cross-database id references (ids are only valid within their origin database). Database corruption or partial restore losing desctable rows. Concurrent delete removing the row between id capture and lookup. Using ids from a database that was rebuilt/recreated (sequence reset).","solutions":["Verify the rowId was obtained from the same database instance you are querying.","Check referential integrity of the database (desctable vs. vector/callgraph tables) using a consistency check.","If the database was rebuilt, re-resolve functions by metadata instead of by stale id.","Recover from a known-good backup if rows are missing due to corruption."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Confirm a desctable row exists before/around the lookup.\n// Cheap guard: only use ids from the same database session.\nif (!descTable.rowExists(rowId)) {  // if such a helper exists\n    throw new IllegalArgumentException(\"No desctable row for id \" + rowId);\n}","typeGuard":null,"tryCatchPattern":"try {\n    return descTable.querySingleDescriptionId(descMgr, rowId);\n} catch (SQLException e) {\n    if (e.getMessage().contains(\"No desctable rows\")) {\n        // resolve by metadata instead of stale id\n        return resolveByNameAndExe(descMgr, name, exe);\n    }\n    throw e;\n}","preventionTips":["Only use row ids obtained from the same live database.","Run referential-integrity checks after migrations or restores.","Prefer resolving by metadata (name+exe) when id freshness is uncertain."],"tags":["bsim","database","missing-row","referential-integrity","sql-exception"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}