{"record":{"id":"aad44aec51823045","repo":"NationalSecurityAgency/ghidra","slug":"prewarm-failed","errorCode":null,"errorMessage":"Prewarm failed: {}","messagePattern":"Prewarm failed: (.+?)","errorType":"exception","errorClass":"LSHException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BulkSignatures.java","lineNumber":656,"sourceCode":"\t\t}\n\t\telse {\n\t\t\tMsg.info(this, \"Successfully rebuilt index \" + dbDetail);\n\t\t}\n\t}\n\n\t/**\n\t * Performs a prewarm command on the BSim database.\n\t * \n\t * @throws IOException if there's an error establishing the database connection\n\t * @throws LSHException if there's an error issuing the query\n\t */\n\tpublic void prewarm() throws IOException, LSHException {\n\t\tDatabaseInformation info = establishQueryServerConnection(false);\n\t\tPrewarmRequest request = new PrewarmRequest();\n\t\tResponsePrewarm response = request.execute(querydb);\n\t\tif (response == null) {\n\t\t\tBSimError lastError = querydb.getLastError();\n\t\t\tthrow new LSHException(\"Prewarm failed: \" + lastError.message);\n\t\t}\n\t\tString dbDetail = \"for database \" + info.databasename + \" (\" + bsimServerInfo + \")\";\n\t\tif (!response.operationSupported) {\n\t\t\tMsg.error(this, \"Prewarm operation not supported \" + dbDetail);\n\t\t}\n\t\telse {\n\t\t\tMsg.info(this, \"Successfully prewarmed \" + Integer.toString(response.blockCount) +\n\t\t\t\t\" blocks of main index \" + dbDetail);\n\t\t}\n\t}\n\n\t/**\n\t * Returns a list of all executable records meeting a set of search criteria.\n\t * \n\t * @param limit the maximum number of results to return\n\t * @param md5Filter MD5 filter\n\t * @param exeNameFilter executable name filter\n\t * @param archFilter architecture filter","sourceCodeStart":638,"sourceCodeEnd":674,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BulkSignatures.java#L638-L674","documentation":"Thrown in prewarm when ResponsePrewarm response is null, i.e. the server rejected the PrewarmRequest. BulkSignatures wraps the server's BSimError into 'Prewarm failed: <message>' (LSHException). A non-null response with operationSupported=false is logged as an error rather than thrown, so this throw specifically indicates a null protocol-level response.","triggerScenarios":"Prewarming a backend that rejects the request: unsupported storage engine returning null, connection failure, or no index/main table to prewarm.","commonSituations":"Prewarm is only meaningful for certain backends (e.g. PostgreSQL with an index); calling it on H2 or an unindexed DB can yield null; transient connection loss.","solutions":["Read the message to distinguish unsupported vs. transient failure.","Only call prewarm on backends that support it and after an index exists.","Retry on transient connection failures.","Check server logs if the cause is unclear."],"exampleFix":"// before\nbsim.prewarm();  // unsupported backend -> LSHException\n\n// after\n// only prewarm on a supported, populated backend","handlingStrategy":"try-catch","validationCode":"// only prewarm on supported, populated backends after an index exists","typeGuard":null,"tryCatchPattern":"try {\n    bsim.prewarm();\n} catch (LSHException e) {\n    // message: \"Prewarm failed: <server>\"; if unsupported, skip; if transient, retry\n}","preventionTips":["Only prewarm backends that support it (e.g. PostgreSQL with an index).","Ensure an index exists before prewarming.","Retry once on transient failures."],"tags":["bsim","prewarm","index","lshexception"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}