{"record":{"id":"9cefb57c479f151d","repo":"NationalSecurityAgency/ghidra","slug":"could-not-install-new-category","errorCode":null,"errorMessage":"Could not install new category: {}","messagePattern":"Could not install new category: (.+?)","errorType":"exception","errorClass":"LSHException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BulkSignatures.java","lineNumber":816,"sourceCode":"\t * object, establish the database connection, and perform the query.\n\t * \n\t * @param categoryName the category name to insert\n\t * @param isDate true if this is a date category\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 installCategory(String categoryName, boolean isDate)\n\t\t\tthrows LSHException, IOException {\n\t\tDatabaseInformation info = establishQueryServerConnection(false);\n\n\t\tInstallCategoryRequest req = new InstallCategoryRequest();\n\t\treq.type_name = dequoteString(categoryName);\n\t\treq.isdatecolumn = isDate;\n\n\t\tResponseInfo resp = req.execute(querydb);\n\t\tif (resp == null) {\n\t\t\tBSimError lastError = querydb.getLastError();\n\t\t\tthrow new LSHException(\"Could not install new category: \" + lastError.message);\n\t\t}\n\t\tinfo = resp.info;\n\n\t\tStringBuilder buf = new StringBuilder();\n\t\tbuf.append(\"BSim Database \");\n\t\tbuf.append(info.databasename);\n\t\tbuf.append(\" now contains:\\n\");\n\t\tformatCategories(info.execats, buf);\n\t\tif (info.dateColumnName != null) {\n\t\t\tbuf.append(\" Date column: \");\n\t\t\tbuf.append(info.dateColumnName);\n\t\t\tbuf.append(\"\\n\");\n\t\t}\n\n\t\t// TODO: Should this output differ for command-line vs workbench? debug only?\n\t\tMsg.info(this, buf.toString());\n\t}\n","sourceCodeStart":798,"sourceCodeEnd":834,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BulkSignatures.java#L798-L834","documentation":"Thrown in installCategory when ResponseInfo resp is null after InstallCategoryRequest.execute(querydb). The server rejected adding the new category column and BulkSignatures wraps its BSimError as 'Could not install new category: <message>' (LSHException).","triggerScenarios":"Installing a category whose name already exists, an invalid/duplicate name after dequoting, a backend that rejects the column add, or a permissions/transport failure.","commonSituations":"Re-running installCategory with a name already present; name with reserved characters; insufficient privileges; transient error.","solutions":["Read the message to confirm duplicate-name vs. other causes.","Choose a unique category name and verify after dequoting.","Ensure admin privileges for schema changes.","Retry on transient failures."],"exampleFix":"// before\nbsim.installCategory(\"existing\", false);  // duplicate -> LSHException\n\n// after\n// pick a new category name, or check current categories first","handlingStrategy":"try-catch","validationCode":"// check current categories to avoid duplicate-name install\n// pick a unique category name before calling installCategory","typeGuard":null,"tryCatchPattern":"try {\n    bsim.installCategory(categoryName, isDate);\n} catch (LSHException e) {\n    // message: \"Could not install new category: <server>\"; if duplicate, pick a new name\n}","preventionTips":["Avoid duplicate category names; list existing categories first.","Ensure admin privileges for schema changes.","Retry on transient failures."],"tags":["bsim","category","schema","lshexception"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}