Skip to content

Fix search_cache job cache generation by skipping multi arch payloads#21675

Merged
bwatters-r7 merged 1 commit into
rapid7:masterfrom
sjanusz-r7:skip-multi-payloads-from-cache-generation
Jul 15, 2026
Merged

Fix search_cache job cache generation by skipping multi arch payloads#21675
bwatters-r7 merged 1 commit into
rapid7:masterfrom
sjanusz-r7:skip-multi-payloads-from-cache-generation

Conversation

@sjanusz-r7

Copy link
Copy Markdown
Contributor

Description

This PR fixes the CI search_cache generation job.
Previous error:

Caught Error while updating linux/multi/meterpreter_reverse_tcp:
bad-config: Unsupported or unset architecture: nil
	/r7-source/lib/msf/core/module.rb:321:in `fail_with'
	/r7-source/modules/payloads/singles/linux/multi/meterpreter_reverse_tcp.rb:32:in `generate'

The payload above supports multiple architectures, so I think it doesn't make sense for it to have a single specific cache size. Also, from the shared specs:

context 'linux/multi/meterpreter_reverse_tcp' do
    it_should_behave_like **'payload is not cached'**,  <-- Look here
                          ancestor_reference_names: [
                            'singles/linux/multi/meterpreter_reverse_tcp'
                          ],
                          reference_name: 'linux/multi/meterpreter_reverse_tcp'

MultiArch payloads can potentially have wildly different cache sizes per-arch. We only have a singular CachedSize constant, so this seems like the right step.

Breaking Changes

None

Verification Steps

    • Run the steps:
docker build -t metasploitframework/metasploit-framework:latest .
./tools/automation/cache/update_module_cache.sh
    • Confirm it works without issues

Test Evidence

The tool works again.

[*] Processing tools/automation/cache/wait_for_cache.rc for ERB directives.
[*] resource (tools/automation/cache/wait_for_cache.rc)> Ruby Code (341 bytes)
resource (tools/automation/cache/wait_for_cache.rc)> exit
+ cp /home/msf/.msf4/store/modules_metadata.json db/modules_metadata_base.json
+ cp /home/msf/.msf4/logs/framework.log .
+ set +e
+ git diff --exit-code db/modules_metadata_base.json
diff --git a/db/modules_metadata_base.json b/db/modules_metadata_base.json
index e1536bb6ccd..59228970e94 100644
--- a/db/modules_metadata_base.json
+++ b/db/modules_metadata_base.json
@@ -66374,7 +66374,7 @@
     "autofilter_ports": null,
     "autofilter_services": null,
     "targets": null,
-    "mod_time": "2025-04-14 00:10:31 +0000",
+    "mod_time": "2026-07-11 13:26:13 +0000",
     "path": "/modules/encoders/x64/xor_dynamic.rb",
     "is_install_path": true,
     "ref_name": "x64/xor_dynamic",
@@ -67077,7 +67077,7 @@
     "autofilter_ports": null,
     "autofilter_services": null,
     "targets": null,
-    "mod_time": "2025-04-14 00:10:31 +0000",
+    "mod_time": "2026-07-11 13:26:13 +0000",
     "path": "/modules/encoders/x86/xor_dynamic.rb",
     "is_install_path": true,
     "ref_name": "x86/xor_dynamic",
@@ -211202,7 +211202,7 @@
       "MOF upload",
       "Command"
     ],
-    "mod_time": "2026-02-03 20:58:31 +0000",
+    "mod_time": "2026-06-24 14:29:47 +0000",
     "path": "/modules/exploits/windows/smb/psexec.rb",
     "is_install_path": true,
     "ref_name": "windows/smb/psexec",
@@ -292107,7 +292107,7 @@
     "autofilter_ports": null,
     "autofilter_services": null,
     "targets": null,
-    "mod_time": "2026-06-08 14:52:44 +0000",
+    "mod_time": "2026-07-15 11:03:05 +0000",
     "path": "/modules/payloads/singles/linux/multi/meterpreter_reverse_tcp.rb",
     "is_install_path": true,
     "ref_name": "linux/multi/meterpreter_reverse_tcp",
+ '[' '!' 1 ']'
real	11m 52.89s
user	11m 41.47s
sys	12m 11.95s

AI Usage Disclosure

I used AI to help debug the issue.

@sjanusz-r7

Copy link
Copy Markdown
Contributor Author

@bwatters-r7 Thoughts on skipping the MultiArch payloads and removing the cache size from the modified module?

@sjanusz-r7

Copy link
Copy Markdown
Contributor Author

I believe the failing Python Meterpreter tests are not related to this change.

@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Metasploit Kanban Jul 15, 2026
@bwatters-r7

Copy link
Copy Markdown
Contributor

Before:

[!] Caught Error while updating linux/multi/meterpreter_reverse_tcp:
bad-config: Unsupported or unset architecture: nil
	/r7-source/lib/msf/core/module.rb:321:in `fail_with'
	/r7-source/modules/payloads/singles/linux/multi/meterpreter_reverse_tcp.rb:32:in `generate'
	/r7-source/lib/msf/core/payload.rb:309:in `generate_complete'
	/r7-source/lib/msf/core/encoded_payload.rb:118:in `generate_raw'
	/r7-source/lib/msf/core/encoded_payload.rb:74:in `generate'
	/r7-source/lib/msf/core/encoded_payload.rb:24:in `create'
	/r7-source/lib/msf/base/simple/payload.rb:52:in `generate_simple'
	/r7-source/lib/msf/base/simple/payload.rb:139:in `generate_simple'
	/r7-source/lib/msf/util/payload_cached_size.rb:190:in `block in is_dynamic?'
	<internal:numeric>:237:in `times'
	/r7-source/lib/msf/util/payload_cached_size.rb:187:in `is_dynamic?'
	/r7-source/lib/msf/util/payload_cached_size.rb:172:in `compute_cached_size'
	/r7-source/lib/msf/util/payload_cached_size.rb:141:in `update_module_cached_size'
	tools/modules/update_payload_cached_sizes.rb:102:in `block in <main>'
	tools/modules/update_payload_cached_sizes.rb:80:in `each'
	tools/modules/update_payload_cached_sizes.rb:80:in `<main>'

@bwatters-r7

Copy link
Copy Markdown
Contributor

After

[*] Processing tools/automation/cache/wait_for_cache.rc for ERB directives.
[*] resource (tools/automation/cache/wait_for_cache.rc)> Ruby Code (341 bytes)
resource (tools/automation/cache/wait_for_cache.rc)> exit
+ cp /home/msf/.msf4/store/modules_metadata.json db/modules_metadata_base.json
+ cp /home/msf/.msf4/logs/framework.log .
+ set +e
+ git diff --exit-code db/modules_metadata_base.json
diff --git a/db/modules_metadata_base.json b/db/modules_metadata_base.json
index e1536bb6cc..59228970e9 100644
--- a/db/modules_metadata_base.json
+++ b/db/modules_metadata_base.json
@@ -66374,7 +66374,7 @@
     "autofilter_ports": null,
     "autofilter_services": null,
     "targets": null,
-    "mod_time": "2025-04-14 00:10:31 +0000",
+    "mod_time": "2026-07-11 13:26:13 +0000",
     "path": "/modules/encoders/x64/xor_dynamic.rb",
     "is_install_path": true,
     "ref_name": "x64/xor_dynamic",
@@ -67077,7 +67077,7 @@
     "autofilter_ports": null,
     "autofilter_services": null,
     "targets": null,
-    "mod_time": "2025-04-14 00:10:31 +0000",
+    "mod_time": "2026-07-11 13:26:13 +0000",
     "path": "/modules/encoders/x86/xor_dynamic.rb",
     "is_install_path": true,
     "ref_name": "x86/xor_dynamic",
@@ -211202,7 +211202,7 @@
       "MOF upload",
       "Command"
     ],
-    "mod_time": "2026-02-03 20:58:31 +0000",
+    "mod_time": "2026-06-24 14:29:47 +0000",
     "path": "/modules/exploits/windows/smb/psexec.rb",
     "is_install_path": true,
     "ref_name": "windows/smb/psexec",
@@ -292107,7 +292107,7 @@
     "autofilter_ports": null,
     "autofilter_services": null,
     "targets": null,
-    "mod_time": "2026-06-08 14:52:44 +0000",
+    "mod_time": "2026-07-15 11:03:05 +0000",
     "path": "/modules/payloads/singles/linux/multi/meterpreter_reverse_tcp.rb",
     "is_install_path": true,
     "ref_name": "linux/multi/meterpreter_reverse_tcp",
+ '[' '!' 1 ']'
real	4m 41.63s
user	7m 35.25s
sys	1m 44.62s
tmoose@bw-dev-2026:~/git/metasploit-framework ((HEAD detached at upstream/pr/21675))$ 


@bwatters-r7
bwatters-r7 merged commit 7e65f97 into rapid7:master Jul 15, 2026
53 of 54 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Metasploit Kanban Jul 15, 2026
@bwatters-r7 bwatters-r7 added the rn-fix release notes fix label Jul 15, 2026
@bwatters-r7 bwatters-r7 self-assigned this Jul 15, 2026
@bwatters-r7

Copy link
Copy Markdown
Contributor

Release Notes

Fix search_cache job cache generation by skipping multi arch payloads

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rn-fix release notes fix

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants