{"record":{"id":"d749495fc76555f0","repo":"NationalSecurityAgency/ghidra","slug":"original-configuration-file-not-present","errorCode":null,"errorMessage":"Original configuration file not present: {}","messagePattern":"Original configuration file not present: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimControlLaunchable.java","lineNumber":1293,"sourceCode":"\t\tint requestedLocalAuth = localAuthentication;\n\t\tint requestedHostAuth = hostAuthentication;\n\t\tint requestedPort = port;\n\t\tport = -1;\n\t\trecoverConfigurationParameters(configFile, hbaFile);\n\t\tif (isServerRunning()) {\n\t\t\tthrow new IOException(\"Cannot modify settings on running server\");\n\t\t}\n\t\tif ((!authConfigPresent || (requestedHostAuth == hostAuthentication &&\n\t\t\trequestedLocalAuth == localAuthentication)) &&\n\t\t\t(requestedPort == -1 || requestedPort == port)) {\n\t\t\tSystem.out.println(\"No changes to make\");\n\t\t\treturn;\n\t\t}\n\n\t\tFile serverConfigFile = Application.getModuleDataFile(\"serverconfig.xml\").getFile(false);\n\t\tFile configCopy = new File(dataDirectory, POSTGRES_CONFIGFILE + \".orig\");\n\t\tif (!configCopy.exists()) {\n\t\t\tthrow new IOException(\n\t\t\t\t\"Original configuration file not present: \" + configCopy.getAbsolutePath());\n\t\t}\n\t\tFile hbaCopy = new File(dataDirectory, POSTGRES_CONNECTFILE + \".orig\");\n\t\tif (!hbaCopy.exists()) {\n\t\t\tthrow new IOException(\n\t\t\t\t\"Original connection file not present: \" + hbaCopy.getAbsolutePath());\n\t\t}\n\t\tif (requestedPort != -1 && requestedPort != port) {\n\t\t\tport = requestedPort;\n\t\t\tSystem.out.println(\"Server will now listen on port \" + Integer.toString(port));\n\t\t}\n\t\tboolean newRemotePki = false;\t\t// Are we newly enabling remote pki\n\t\tboolean newLocalPki = false;\t\t// Are we newly enabling local pki\n\n\t\tif (authConfigPresent && requestedLocalAuth != localAuthentication) {\n\t\t\tlocalAuthentication = requestedLocalAuth;\n\t\t\tSystem.out.print(\"New local authentication: \");\n\t\t\tif (localAuthentication == AUTHENTICATION_PASSWORD) {","sourceCodeStart":1275,"sourceCodeEnd":1311,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimControlLaunchable.java#L1275-L1311","documentation":"Thrown by changeAuthCommand() when '<datadir>/postgresql.conf.orig' does not exist. BSim creates a '.orig' backup of the original PostgreSQL config during 'bsim_ctl start' so that changeauth can restore/merge from the pristine file. The IOException indicates the backup is missing, so the safe reconfiguration workflow cannot proceed.","triggerScenarios":"Running changeauth on a data directory whose postgresql.conf.orig backup was deleted, or that was initialized by a method other than 'bsim_ctl start' (e.g., manual initdb).","commonSituations":"Manual cleanup that removed .orig files; directory created by an older/alternate BSim version; filesystem backup that excluded .orig files.","solutions":["Ensure the directory was created via 'bsim_ctl start', which generates the .orig backups.","If the original postgresql.conf is still pristine, manually copy it: cp <datadir>/postgresql.conf <datadir>/postgresql.conf.orig.","If the original is lost, reinitialize the data directory with 'bsim_ctl start' from scratch."],"exampleFix":"# before (backup missing)\nbsim_ctl changeauth /opt/bsim/data --auth password\n# after (restore the backup from the still-pristine config)\ncp /opt/bsim/data/postgresql.conf /opt/bsim/data/postgresql.conf.orig\nbsim_ctl changeauth /opt/bsim/data --auth password","handlingStrategy":"try-catch","validationCode":"File orig = new File(dataDirectory, \"postgresql.conf.orig\");\nif (!orig.exists()) {\n    throw new IllegalStateException(\"Missing config backup; directory may need reinitialization via 'bsim_ctl start'\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    bsimControl.run(new String[]{\"changeauth\", dataDir, \"--auth\", \"password\"});\n} catch (IOException e) {\n    if (e.getMessage().contains(\"configuration file not present\")) {\n        // restore the .orig backup or reinitialize the data directory\n    } else {\n        throw e;\n    }\n}","preventionTips":["Only initialize BSim data directories via 'bsim_ctl start' so .orig backups are created.","Do not delete .orig files during directory cleanup.","Include .orig files in filesystem backups of the data directory."],"tags":["bsim","postgres","cli","configuration"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}