{"record":{"id":"927c4af05983d6d0","repo":"NationalSecurityAgency/ghidra","slug":"error-927c4a","errorCode":null,"errorMessage":"{}","messagePattern":"\\{\\}","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BulkSignatures.java","lineNumber":117,"sourceCode":"\t/**\n\t *\n\t * \n\t * @param async true if database commits should be synchronous\n\t * @return  the {@link DatabaseInformation} object returned from a successful connect\n\t * @throws IOException if there's a problem creating the connection\n\t */\n\tprivate DatabaseInformation establishQueryServerConnection(boolean async) throws IOException {\n\n\t\tif (querydb != null) {\n\t\t\treturn querydb.getInfo();\n\t\t}\n\n\t\tcheckBSimServerOperation();\n\n\t\tquerydb = BSimClientFactory.buildClient(bsimServerInfo, async);\n\n\t\tif (!querydb.initialize()) {\n\t\t\tthrow new IOException(querydb.getLastError().message);\n\t\t}\n\n\t\tDatabaseInformation info = querydb.getInfo();\n\t\tif (info == null) {\n\t\t\tBSimError lastError = querydb.getLastError();\n\t\t\tif (lastError != null && lastError.category == ErrorCategory.Nodatabase) {\n\t\t\t\tthrow new IOException(lastError.message);\n\t\t\t}\n\t\t\tthrow new IOException(\"Unknown error connection to: \" + bsimServerInfo.toString());\n\t\t}\n\n\t\tMsg.debug(this, \"Connected to \" + info.databasename);\n\t\treturn info;\n\t}\n\n\t/**\n\t * This will be automatically invoked when BulkSignatures is out of scope, if using\n\t * try-with-resources to create it. When this happens we need to clean up the ","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BulkSignatures.java#L99-L135","documentation":"Thrown during establishQueryServerConnection when querydb.initialize() returns false. A false return means the underlying FunctionDatabase client could not establish its connection/handshake, so BulkSignatures wraps the client's BSimError message in an IOException and rethrows. The '{}' is the raw server/client error text from querydb.getLastError().message (e.g. authentication, connection refused, initialization failure).","triggerScenarios":"Any server operation after a bad connect: wrong host/port, TLS/cert mismatch, auth failure during the initialize handshake, incompatible BSim protocol version, or the server being down. initialize() returning false is the precondition.","commonSituations":"BSim URL points to a stopped or wrong server; PostgreSQL/Elasticsearch backend down; credentials invalid or auth token expired; firewall/proxy blocking the gRPC/HTTP path; client and server built from divergent Ghidra versions speaking different protocols.","solutions":["Check the literal message from the exception to see the underlying category (Connection/Authentication/Initialization).","Verify the BSim server is running and reachable (port open, correct host).","Re-supply/refresh credentials or the auth token if the message indicates authentication.","Confirm client and server run compatible Ghidra versions."],"exampleFix":"// before\nBulkSignatures bsim = new BulkSignatures(serverInfo);\nbsim.prewarm();  // initialize() failed -> IOException\n\n// after\n// first validate connectivity in a controlled block, inspect getLastError, fix URL/creds, then retry","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    bsim.prewarm(); // or any server op\n} catch (IOException e) {\n    // e.getMessage() is querydb.getLastError().message; inspect for Connection/Auth/Init\n    log.error(\"BSim connection init failed: {}\", e.getMessage());\n}","preventionTips":["Verify the BSim server URL, host, and port are correct and reachable before issuing commands.","Confirm credentials/auth tokens are valid and not expired.","Keep client and server Ghidra versions aligned to avoid protocol mismatches.","Health-check the backend (PostgreSQL/Elastic) before connecting."],"tags":["bsim","network","connection","authentication","ioexception"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}