Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make swagger-blocks a default dependency #15179

Merged
merged 1 commit into from
May 10, 2021

Conversation

dwelch-r7
Copy link
Contributor

swagger-blocks is a necessary gem for running the metasploit web service, currently if you install without the development and test groups you don't get swagger-block installed and so the web service fails to start

Adding BUNDLE_WITHOUT: "development:test" to your bundle config should allow you to replicate the issue

Example stacktrace from before:

/usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require': cannot load such file -- swagger/blocks (LoadError)
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.5/lib/active_support/dependencies.rb:291:in `block in require'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.5/lib/active_support/dependencies.rb:257:in `load_dependency'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.5/lib/active_support/dependencies.rb:291:in `require'
        from /usr/share/metasploit-framework/lib/msf/core/web_services/metasploit_api_app.rb:3:in `<top (required)>'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:26:in `require'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:26:in `require'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.5/lib/active_support/dependencies.rb:291:in `block in require'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.5/lib/active_support/dependencies.rb:257:in `load_dependency'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.5/lib/active_support/dependencies.rb:291:in `require'
        from /usr/share/metasploit-framework/msf-ws.ru:16:in `block in <main>'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in `instance_eval'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in `initialize'
        from /usr/share/metasploit-framework/msf-ws.ru:1:in `new'
        from /usr/share/metasploit-framework/msf-ws.ru:1:in `<main>'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/thin-1.8.0/lib/rack/adapter/loader.rb:33:in `eval'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/thin-1.8.0/lib/rack/adapter/loader.rb:33:in `load'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/thin-1.8.0/lib/thin/controllers/controller.rb:182:in `load_rackup_config'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/thin-1.8.0/lib/thin/controllers/controller.rb:72:in `start'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/thin-1.8.0/lib/thin/runner.rb:203:in `run_command'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/thin-1.8.0/lib/thin/runner.rb:159:in `run!'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/gems/thin-1.8.0/bin/thin:6:in `<top (required)>'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/bin/thin:23:in `load'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/2.7.0/bin/thin:23:in `<main>'

Verification

  • bundle install without the development and test groups
  • Verify that webservice can start up via msfdb

@dwelch-r7 dwelch-r7 added the bug label May 10, 2021
@gwillcox-r7 gwillcox-r7 merged commit a0e609e into rapid7:master May 10, 2021
@gwillcox-r7 gwillcox-r7 added the rn-fix release notes fix label May 10, 2021
@gwillcox-r7
Copy link
Contributor

gwillcox-r7 commented May 10, 2021

Release Notes

The swagger-blocks dependency has been marked as a default dependency for all installs, preventing cases where if a user did not install the development and tests groups, they would be unable to start the web service.

@gwillcox-r7 gwillcox-r7 self-assigned this May 17, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug rn-fix release notes fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants