NationalSecurityAgency/ghidra · error · FunctionComparisonException

Couldn't open remote program: {} for {}.

Error message

Couldn't open remote program: {} for {}.

What it means

BSimSearchResultsProvider.getMatchFunction() attempts to open the remote program referenced by the BSim match result via getCachedRemoteProgram(). If that returns null it throws FunctionComparisonException. The remote program (the matched executable on the BSim/Ghidra server) could not be opened or downloaded.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/gui/search/results/BSimSearchResultsProvider.java:533

			throws FunctionComparisonException {
		// Determine the original function (local program's function; left side)
		Address originalEntryPoint = resultRow.getAddress();
		FunctionManager originalFunctionManager = program.getFunctionManager();
		Function originalFunction = originalFunctionManager.getFunctionAt(originalEntryPoint);
		if (originalFunction == null) {
			throw new FunctionComparisonException("Couldn't get local function " +
				resultRow.getOriginalFunctionDescription().getFunctionName() + " at " +
				originalEntryPoint.toString() + ".");
		}
		return originalFunction;
	}

	private Function getMatchFunction(BSimMatchResult resultRow, Set<Program> opened)
			throws FunctionComparisonException {
		// Determine the match function (remote program's function; right side)
		Program matchProgram = getCachedRemoteProgram(resultRow.getExecutableURLString(), opened);
		if (matchProgram == null) {
			throw new FunctionComparisonException(
				"Couldn't open remote program: " + resultRow.getExecutableURLString() + " for " +
					resultRow.getSimilarFunctionName() + ".");
		}
		FunctionDescription matchFunctionDescription = resultRow.getMatchFunctionDescription();
		long matchOffset = matchFunctionDescription.getAddress();
		Address matchEntryPoint =
			matchProgram.getAddressFactory().getDefaultAddressSpace().getAddress(matchOffset);
		FunctionManager matchFunctionManager = matchProgram.getFunctionManager();
		Function matchFunction = matchFunctionManager.getFunctionAt(matchEntryPoint);
		if (matchFunction == null) {
			throw new FunctionComparisonException("Couldn't get remote function " +
				matchFunctionDescription.getFunctionName() + " at " + matchEntryPoint + ".");
		}
		return matchFunction;
	}

	private class BSimMatchesTableActionContext extends DefaultActionContext {

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Verify network connectivity to the Ghidra server hosting the remote program.
  2. Check that the remote program still exists at the URL stored in the BSim match (browse the server repository).
  3. Verify authentication credentials and permissions for the remote repository.
  4. If the server was migrated, re-ingest executables so BSim stores current URLs.
  5. Retry after confirming server availability — transient network failures may resolve.
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-check remote program accessibility
Program test = getCachedRemoteProgram(urlString, new HashSet<>());
if (test == null) {
    // warn user: remote program unavailable, skip comparison for this match
}

Try / catch

try {
    getMatchFunction(resultRow, opened);
} catch (FunctionComparisonException e) {
    if (e.getMessage().startsWith("Couldn't open remote program")) {
        // log URL, notify user of connectivity/permissions issue, skip match
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Calling getMatchFunction(resultRow, opened) where getCachedRemoteProgram(resultRow.getExecutableURLString(), opened) returns null. The remote program URL string could not be resolved to an openable Program.

Common situations: The remote Ghidra server is unreachable or the program was removed from the server; authentication/permissions prevent downloading the remote program; network issues (timeout, firewall) during program fetch; the executable URL stored in BSim is stale (server reorganized repos); the remote program file is corrupted on the server.

Related errors


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