NationalSecurityAgency/ghidra · error · IOException
Original configuration file not present: {}
Error message
Original configuration file not present: {} What it means
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.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimControlLaunchable.java:1293
int requestedLocalAuth = localAuthentication;
int requestedHostAuth = hostAuthentication;
int requestedPort = port;
port = -1;
recoverConfigurationParameters(configFile, hbaFile);
if (isServerRunning()) {
throw new IOException("Cannot modify settings on running server");
}
if ((!authConfigPresent || (requestedHostAuth == hostAuthentication &&
requestedLocalAuth == localAuthentication)) &&
(requestedPort == -1 || requestedPort == port)) {
System.out.println("No changes to make");
return;
}
File serverConfigFile = Application.getModuleDataFile("serverconfig.xml").getFile(false);
File configCopy = new File(dataDirectory, POSTGRES_CONFIGFILE + ".orig");
if (!configCopy.exists()) {
throw new IOException(
"Original configuration file not present: " + configCopy.getAbsolutePath());
}
File hbaCopy = new File(dataDirectory, POSTGRES_CONNECTFILE + ".orig");
if (!hbaCopy.exists()) {
throw new IOException(
"Original connection file not present: " + hbaCopy.getAbsolutePath());
}
if (requestedPort != -1 && requestedPort != port) {
port = requestedPort;
System.out.println("Server will now listen on port " + Integer.toString(port));
}
boolean newRemotePki = false; // Are we newly enabling remote pki
boolean newLocalPki = false; // Are we newly enabling local pki
if (authConfigPresent && requestedLocalAuth != localAuthentication) {
localAuthentication = requestedLocalAuth;
System.out.print("New local authentication: ");
if (localAuthentication == AUTHENTICATION_PASSWORD) {View on GitHub (pinned to d5f144c24d)
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.
Example fix
# before (backup missing) bsim_ctl changeauth /opt/bsim/data --auth password # after (restore the backup from the still-pristine config) cp /opt/bsim/data/postgresql.conf /opt/bsim/data/postgresql.conf.orig bsim_ctl changeauth /opt/bsim/data --auth password
Defensive patterns
Strategy: try-catch
Validate before calling
File orig = new File(dataDirectory, "postgresql.conf.orig");
if (!orig.exists()) {
throw new IllegalStateException("Missing config backup; directory may need reinitialization via 'bsim_ctl start'");
} Try / catch
try {
bsimControl.run(new String[]{"changeauth", dataDir, "--auth", "password"});
} catch (IOException e) {
if (e.getMessage().contains("configuration file not present")) {
// restore the .orig backup or reinitialize the data directory
} else {
throw e;
}
} Prevention
- 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.
When it happens
Trigger: 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).
Common situations: Manual cleanup that removed .orig files; directory created by an older/alternate BSim version; filesystem backup that excluded .orig files.
Related errors
- Data directory not initialized: run "bsim_ctl start" first
- Cannot modify settings on running server
- Original connection file not present: {}
- PKI authentication requested, but certificate authority file
- {} is not a valid certification authority
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/d749495fc76555f0.
Report an issue: GitHub.