{"record":{"id":"8b194a35ad5fa0c5","repo":"NationalSecurityAgency/ghidra","slug":"no-progam-to-associate-with-trace-was-given","errorCode":null,"errorMessage":"No progam to associate with trace was given","messagePattern":"No progam to associate with trace was given","errorType":"exception","errorClass":"LoadException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-importers/src/main/java/ghidra/app/util/opinion/TenetLoader.java","lineNumber":269,"sourceCode":"\tpublic int getTierPriority() {\n\t\treturn 0;\n\t}\n\n\t@Override\n\tpublic LoadResults<? extends DomainObject> load(final ImporterSettings settings)\n\t\t\tthrows IOException, CancelledException, VersionException, LoadException {\n\t\tTrace trace;\n\t\tString programPath = null;\n\n\t\tfor (final Option option : settings.options()) {\n\t\t\tfinal String name = option.getName();\n\t\t\tif (name.equals(DOMAIN_FILE_OPTION_NAME)) {\n\t\t\t\tprogramPath = (String) option.getValue();\n\t\t\t}\n\t\t}\n\n\t\tif ((programPath == null) || programPath.isBlank()) {\n\t\t\tthrow new LoadException(\"No progam to associate with trace was given\");\n\t\t}\n\n\t\tMsg.info(this, \"Loading trace for %s\".formatted(programPath));\n\n\t\tfinal DomainFile df = settings.project().getProjectData().getFile(programPath);\n\t\tif (!df.getContentType().equals(ProgramContentHandler.PROGRAM_CONTENT_TYPE)) {\n\t\t\tthrow new LoadException(\"Selected file is not a program\");\n\t\t}\n\t\tProgram program = null;\n\n\t\ttry {\n\t\t\tprogram = (Program) df.getDomainObject(this, false, false, settings.monitor());\n\n\t\t\tfinal long start = System.currentTimeMillis();\n\n\t\t\ttrace = loadTrace(settings.provider(), settings.importName(), program,\n\t\t\t\tsettings.consumer(), settings.log(), settings.monitor());\n","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-importers/src/main/java/ghidra/app/util/opinion/TenetLoader.java#L251-L287","documentation":"LoadException thrown by TenetLoader when the DOMAIN_FILE_OPTION_NAME option is missing or blank. A Tenet trace is meaningless without a Program to associate it with, so the loader requires the user to name an existing program domain file. Note the message has a typo ('progam') in the source.","triggerScenarios":"load() is called with settings whose options do not include DOMAIN_FILE_OPTION_NAME, or include it with a null/blank value. The loader iterates settings.options() looking for that name and never finds a usable programPath.","commonSituations":"Importing a Tenet trace via a script/batch flow that forgot to set the domain-file option; the import dialog closed without selecting an associated program; option renamed/misspelled so the name check does not match.","solutions":["When invoking the loader, add an Option named DOMAIN_FILE_OPTION_NAME whose value is the project path of the target program.","In the GUI import flow, pick the program file in the loader's options panel before importing.","Confirm the option name constant used by the caller matches TenetLoader.DOMAIN_FILE_OPTION_NAME exactly."],"exampleFix":"// before\nLoadResults<Trace> res = loader.load(...); // options had no domain file\n\n// after\nList<Option> opts = new ArrayList<>(settings.options());\nopts.add(new Option(TenetLoader.DOMAIN_FILE_OPTION_NAME, \"/myproj/exe\"));\nsettings = settings.withOptions(opts);\nLoadResults<Trace> res = loader.load(...);","handlingStrategy":"validation","validationCode":"String programPath = options.stream()\n    .filter(o -> TenetLoader.DOMAIN_FILE_OPTION_NAME.equals(o.getName()))\n    .map(Option::getValue).map(String::valueOf).findFirst().orElse(null);\nif (programPath == null || programPath.isBlank()) {\n    throw new IllegalArgumentException(\"Set \" + TenetLoader.DOMAIN_FILE_OPTION_NAME);\n}","typeGuard":null,"tryCatchPattern":"try {\n    loader.load(settings);\n} catch (LoadException e) {\n    if (e.getMessage().contains(\"progam to associate\")) {\n        // prompt user to select the associated program\n    }\n}","preventionTips":["Always set DOMAIN_FILE_OPTION_NAME to a non-blank program path before importing a Tenet trace.","Reuse the loader's option name constant rather than a hardcoded string.","Validate options in scripts before invoking the loader."],"tags":["ghidra","import","loader","trace","tenet","validation"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}