{"record":{"id":"df7cd43bdaeaa0f0","repo":"NationalSecurityAgency/ghidra","slug":"no-saved-offers-to-launch","errorCode":null,"errorMessage":"No saved offers to launch {}","messagePattern":"No saved offers to launch (.+?)","errorType":"exception","errorClass":"NoSuchElementException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/flatapi/FlatDebuggerRmiAPI.java","lineNumber":87,"sourceCode":"\t * Get saved offers for launching the current program, ordered by most-recently-saved\n\t * \n\t * @return the offers\n\t */\n\tdefault List<TraceRmiLaunchOffer> getSavedLaunchOffers() {\n\t\treturn getSavedLaunchOffers(getCurrentProgram());\n\t}\n\n\t/**\n\t * Get the most-recently-saved launch offer for the given program\n\t * \n\t * @param program the program, or null for no image\n\t * @return the offer\n\t * @throws NoSuchElementException if no offer's configuration has been saved\n\t */\n\tdefault TraceRmiLaunchOffer requireLastLaunchOffer(Program program) {\n\t\tList<TraceRmiLaunchOffer> offers = getSavedLaunchOffers(program);\n\t\tif (offers.isEmpty()) {\n\t\t\tthrow new NoSuchElementException(\"No saved offers to launch \" + program);\n\t\t}\n\t\treturn offers.get(0);\n\t}\n\n\t/**\n\t * Get the most-recently-saved launch offer for the current program\n\t * \n\t * @return the offer\n\t * @throws NoSuchElementException if no offer's configuration has been saved\n\t */\n\tdefault TraceRmiLaunchOffer requireLastLaunchOffer() {\n\t\treturn requireLastLaunchOffer(getCurrentProgram());\n\t}\n\n\t/**\n\t * Launch the given offer with the default, saved, and/or overridden arguments\n\t * \n\t * <p>","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/flatapi/FlatDebuggerRmiAPI.java#L69-L105","documentation":"NoSuchElementException thrown by FlatDebuggerRmiAPI.requireLastLaunchOffer(program). It asks the TraceRmi launcher service for previously-saved launch offers via getSavedLaunchOffers(program); if that list is empty it means no launch configuration has ever been saved for this program, so there is no 'last offer' to retrieve. The message interpolates the program (which may be null, printing 'null'). It is a programmatic guard, not a runtime/IO fault.","triggerScenarios":"Calling requireLastLaunchOffer(program) or the no-arg requireLastLaunchOffer() (which passes getCurrentProgram()) before any TraceRmiLaunchOffer configuration has been saved for that program. Happens in headless/scripts that jump straight to requireLastLaunchOffer() without first launching and saving arguments through the TraceRmi launcher service.","commonSituations":"First-time scripted debugging where the user has not yet launched the target once in the GUI and saved the image/args; scripts run against a freshly imported program that has no saved offers; calling the no-arg overload before a current program is active (program is null).","solutions":["Use getSavedLaunchOffers(program) and branch on isEmpty() instead of requireLastLaunchOffer(); enumerate/launch an offer or open the launcher configuration dialog to save one.","Ensure a launch offer has been saved first: launch the target once interactively in the Debugger GUI, configure Image/Args, and save the configuration before running the script.","Catch NoSuchElementException around the call and report a clear 'no saved launch configuration' message to the operator.","If using the no-arg overload, confirm getCurrentProgram() returns the intended program (non-null) first."],"exampleFix":"// before\nTraceRmiLaunchOffer offer = flatApi.requireLastLaunchOffer();\n\n// after\nList<TraceRmiLaunchOffer> offers = flatApi.getSavedLaunchOffers();\nif (offers.isEmpty()) {\n    throw new IllegalStateException(\"No saved launch configuration; launch and save one first\");\n}\nTraceRmiLaunchOffer offer = offers.get(0);","handlingStrategy":"validation","validationCode":"List<TraceRmiLaunchOffer> offers = flatApi.getSavedLaunchOffers(program);\nif (offers.isEmpty()) {\n    // configure/launch an offer or prompt the user to save one\n    return;\n}\nTraceRmiLaunchOffer offer = offers.get(0);","typeGuard":null,"tryCatchPattern":"try {\n    TraceRmiLaunchOffer offer = flatApi.requireLastLaunchOffer(program);\n} catch (NoSuchElementException e) {\n    // no saved launch configuration for this program; handle gracefully\n}","preventionTips":["Prefer getSavedLaunchOffers() + isEmpty() over the throwing requireLastLaunchOffer() in scripts.","Launch and save a configuration once interactively before running automated launch scripts.","Confirm getCurrentProgram() is non-null before using the no-arg overload."],"tags":["ghidra","debugger","trace-rmi","launch","validation"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}