{"record":{"id":"b00ccb9f91ebe88a","repo":"NationalSecurityAgency/ghidra","slug":"couldn-t-open-remote-program-for","errorCode":null,"errorMessage":"Couldn't open remote program: {} for {}.","messagePattern":"Couldn't open remote program: (.+?) for (.+?)\\.","errorType":"exception","errorClass":"FunctionComparisonException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/gui/search/results/BSimSearchResultsProvider.java","lineNumber":533,"sourceCode":"\t\t\tthrows FunctionComparisonException {\n\t\t// Determine the original function (local program's function; left side)\n\t\tAddress originalEntryPoint = resultRow.getAddress();\n\t\tFunctionManager originalFunctionManager = program.getFunctionManager();\n\t\tFunction originalFunction = originalFunctionManager.getFunctionAt(originalEntryPoint);\n\t\tif (originalFunction == null) {\n\t\t\tthrow new FunctionComparisonException(\"Couldn't get local function \" +\n\t\t\t\tresultRow.getOriginalFunctionDescription().getFunctionName() + \" at \" +\n\t\t\t\toriginalEntryPoint.toString() + \".\");\n\t\t}\n\t\treturn originalFunction;\n\t}\n\n\tprivate Function getMatchFunction(BSimMatchResult resultRow, Set<Program> opened)\n\t\t\tthrows FunctionComparisonException {\n\t\t// Determine the match function (remote program's function; right side)\n\t\tProgram matchProgram = getCachedRemoteProgram(resultRow.getExecutableURLString(), opened);\n\t\tif (matchProgram == null) {\n\t\t\tthrow new FunctionComparisonException(\n\t\t\t\t\"Couldn't open remote program: \" + resultRow.getExecutableURLString() + \" for \" +\n\t\t\t\t\tresultRow.getSimilarFunctionName() + \".\");\n\t\t}\n\t\tFunctionDescription matchFunctionDescription = resultRow.getMatchFunctionDescription();\n\t\tlong matchOffset = matchFunctionDescription.getAddress();\n\t\tAddress matchEntryPoint =\n\t\t\tmatchProgram.getAddressFactory().getDefaultAddressSpace().getAddress(matchOffset);\n\t\tFunctionManager matchFunctionManager = matchProgram.getFunctionManager();\n\t\tFunction matchFunction = matchFunctionManager.getFunctionAt(matchEntryPoint);\n\t\tif (matchFunction == null) {\n\t\t\tthrow new FunctionComparisonException(\"Couldn't get remote function \" +\n\t\t\t\tmatchFunctionDescription.getFunctionName() + \" at \" + matchEntryPoint + \".\");\n\t\t}\n\t\treturn matchFunction;\n\t}\n\n\tprivate class BSimMatchesTableActionContext extends DefaultActionContext {\n","sourceCodeStart":515,"sourceCodeEnd":551,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/gui/search/results/BSimSearchResultsProvider.java#L515-L551","documentation":"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.","triggerScenarios":"Calling getMatchFunction(resultRow, opened) where getCachedRemoteProgram(resultRow.getExecutableURLString(), opened) returns null. The remote program URL string could not be resolved to an openable Program.","commonSituations":"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.","solutions":["Verify network connectivity to the Ghidra server hosting the remote program.","Check that the remote program still exists at the URL stored in the BSim match (browse the server repository).","Verify authentication credentials and permissions for the remote repository.","If the server was migrated, re-ingest executables so BSim stores current URLs.","Retry after confirming server availability — transient network failures may resolve."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-check remote program accessibility\nProgram test = getCachedRemoteProgram(urlString, new HashSet<>());\nif (test == null) {\n    // warn user: remote program unavailable, skip comparison for this match\n}","typeGuard":null,"tryCatchPattern":"try {\n    getMatchFunction(resultRow, opened);\n} catch (FunctionComparisonException e) {\n    if (e.getMessage().startsWith(\"Couldn't open remote program\")) {\n        // log URL, notify user of connectivity/permissions issue, skip match\n    } else {\n        throw e;\n    }\n}","preventionTips":["Verify Ghidra server connectivity and credentials before initiating BSim comparisons.","Cache remote programs to reduce repeated fetch failures on transient network issues.","Present a clear error indicating the remote URL and likely cause (network vs. permissions).","Re-ingest executables after server migrations so BSim URLs stay current."],"tags":["bsim","remote-program","network","function-comparison","ghidra-server"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}