Skip to content

Conversation

toydestroyer
Copy link
Contributor

Puma 7 is no longer compatible with Solid Queue due to the change in hook names (#633).

This PR is my attempt to fix it and support both new and old hook names.

Need advice on tests: should I just add Puma 7 to Appraisal, or should it be a matrix that tests all possible combinations of Puma and Rails versions?

Reference: https://github.com/puma/puma/releases/tag/v7.0.0

@tannakartikey
Copy link
Contributor

I just wanted to note that those webhooks are deprecated, but will still work with a warning. They are not completely removed.

Ref: https://github.com/puma/puma/pull/3438/files#diff-122c03b9c96f060a9cc29b5ed3446467e1909b0054b4f5cfd95ee41cfff832e7R449

@toydestroyer
Copy link
Contributor Author

@tannakartikey hm, that's weird, I'm currently getting this error using puma 7.0.0 and solid_queue 1.2.1:

=> Booting Puma
=> Rails 8.0.2.1 application starting in development 
=> Run `bin/rails server --help` for more startup options
Exiting
/Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/solid_queue-1.2.1/lib/puma/plugin/solid_queue.rb:14:in 'start': undefined method 'on_booted' for an instance of Puma::Events (NoMethodError)

    launcher.events.on_booted do
                   ^^^^^^^^^^
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/puma-7.0.0/lib/puma/plugin.rb:24:in 'block in Puma::PluginLoader#fire_starts'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/puma-7.0.0/lib/puma/plugin.rb:22:in 'Array#each'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/puma-7.0.0/lib/puma/plugin.rb:22:in 'Puma::PluginLoader#fire_starts'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/puma-7.0.0/lib/puma/launcher.rb:196:in 'Puma::Launcher#run'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/puma-7.0.0/lib/rack/handler/puma.rb:79:in 'Puma::RackHandler#run'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/rackup-2.2.1/lib/rackup/server.rb:341:in 'Rackup::Server#start'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/railties-8.0.2.1/lib/rails/commands/server/server_command.rb:38:in 'Rails::Server#start'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/railties-8.0.2.1/lib/rails/commands/server/server_command.rb:145:in 'block in Rails::Command::ServerCommand#perform'
	from <internal:kernel>:91:in 'Kernel#tap'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/railties-8.0.2.1/lib/rails/commands/server/server_command.rb:136:in 'Rails::Command::ServerCommand#perform'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/thor-1.4.0/lib/thor/command.rb:28:in 'Thor::Command#run'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/thor-1.4.0/lib/thor/invocation.rb:127:in 'Thor::Invocation#invoke_command'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/railties-8.0.2.1/lib/rails/command/base.rb:178:in 'Rails::Command::Base#invoke_command'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/thor-1.4.0/lib/thor.rb:538:in 'Thor.dispatch'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/railties-8.0.2.1/lib/rails/command/base.rb:73:in 'Rails::Command::Base.perform'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/railties-8.0.2.1/lib/rails/command.rb:65:in 'block in Rails::Command.invoke'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/railties-8.0.2.1/lib/rails/command.rb:143:in 'Rails::Command.with_argv'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/railties-8.0.2.1/lib/rails/command.rb:63:in 'Rails::Command.invoke'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/railties-8.0.2.1/lib/rails/commands.rb:18:in '<main>'
	from /Users/toydestroyer/.rvm/rubies/ruby-3.4.5/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
	from /Users/toydestroyer/.rvm/rubies/ruby-3.4.5/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
	from /Users/toydestroyer/.rvm/gems/ruby-3.4.5/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require'
	from bin/rails:6:in '<main>'

Let me look again at what exactly is causing it 🤔

@julienanne
Copy link

Same here,
In production kamal deploy :

/usr/local/bundle/ruby/3.4.0/gems/solid_queue-1.2.1/lib/puma/plugin/solid_queue.rb:14:in 'start': undefined method 'on_booted' for an instance of Puma::Events (NoMethodError)

launcher.events.on_booted do
                ^^^^^^^^^^
from /usr/local/bundle/ruby/3.4.0/gems/puma-7.0.0/lib/puma/plugin.rb:24:in'block in Puma::PluginLoader#fire_starts'

My app don't use SolidQueue for the moment so I set to false in config/deploy.yml : SOLID_QUEUE_IN_PUMA: false but not help but no error in development mode launch with bin/dev.

My app don't use SolidQueue for the moment so I Comment the SOLID_QUEUE_IN_PUMA env variable (set it to false is not the right way to disable SolidQueue puma plugin) in config/deploy.yml (think to also comment the clear: entry if you have no more clear environment variables) and that's ok.

I also tried your code from this PR on my local app with some modification to run the solidQueue puma plugin and all seems good from my point of view.

Thanks for your work and reactivity ;)

@tannakartikey
Copy link
Contributor

@toydestroyer I think it is a breaking change after all!

@tannakartikey tannakartikey mentioned this pull request Sep 4, 2025
7 tasks
@FrancescoK
Copy link

Same issue here, making deployments fail.

@tannakartikey
Copy link
Contributor

The backward compatibility has been merged into Puma

@schneems
Copy link
Member

schneems commented Sep 5, 2025

The fix in puma is released in 7.0.1

@toydestroyer
Copy link
Contributor Author

Thanks @tannakartikey and @schneems for the quick fix and release 🙏

I’ll leave it to @rosa to decide what to do with this PR. I’m happy to finalize it to remove deprecation notices. Or maybe Puma 6 support will be dropped in the next major Solid Queue version, so there’s no need for such code duplication?

capotej added a commit to capotej/abbey that referenced this pull request Sep 7, 2025
@julienanne
Copy link

Thanks @tannakartikey and @schneems
Upgrade Puma and reset my kamal deploy configuration => deploy fixed all green thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants