NationalSecurityAgency/ghidra · info · CancelledSQLException

Password entry was cancelled

Error message

Password entry was cancelled

What it means

Thrown by BSimDBConnectTaskManager.getConnection() as a CancelledSQLException when the modal connection task completed without establishing a connection and the user cancelled it (isCancelled flag is true). This occurs because password entry is performed through a modal Swing dialog; cancelling it sets the flag and no connection is returned.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimDBConnectTaskManager.java:76

		// Use task to establish initial connection
		DBConnectTask connectTask = new DBConnectTask(connectionSupplier);
		try {
			//@formatter:off
            TaskBuilder.withTask(connectTask)
                .setTitle("BSim DB Connection...")
                .setCanCancel(false)
                .setHasProgress(false)
                .launchModal();
            //@formatter:on    

			synchronized (BSimDBConnectTaskManager.this) {
				Connection c = connectTask.getConnection();
				if (c != null) {
					return c;
				}

				if (isCancelled) {
					throw new CancelledSQLException("Password entry was cancelled");
				}
				if (exc instanceof SQLException e) {
					throw e;
				}
				if (exc instanceof RuntimeException e) {
					throw e;
				}
				throw new RuntimeException(exc);
			}
		}
		finally {
			synchronized (BSimDBConnectTaskManager.this) {
				if (--count == 0) {
					clear();
				}
			}
		}
	}

View on GitHub (pinned to d5f144c24d)

Solutions

  1. This is informational — re-attempt the connection and provide the password.
  2. In headless/automated contexts, supply credentials programmatically so no modal dialog is required.
  3. If cancellation is expected, catch CancelledSQLException and treat it as a user-initiated abort.

Example fix

// before
Connection c = connectTaskManager.getConnection(supplier); // user cancels dialog -> CancelledSQLException
// after
try {
    Connection c = connectTaskManager.getConnection(supplier);
} catch (CancelledSQLException e) {
    // user cancelled; abort gracefully
    return;
}
Defensive patterns

Strategy: try-catch

Try / catch

try {
    Connection c = connectTaskManager.getConnection(supplier);
} catch (CancelledSQLException e) {
    // user-initiated cancellation; abort the operation gracefully
    return;
}

Prevention

When it happens

Trigger: The BSim database connection password dialog is shown (initial connection or re-auth) and the user clicks Cancel/escapes the dialog, leaving connectTask with a null connection.

Common situations: User dismisses the password prompt intentionally; dialog is cancelled by an unrelated windowing event; automated test that does not provide a password.

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/3cd191a3daafa91e. Report an issue: GitHub.