-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
hanami server
not taking into account activate_control_app
option supported by Puma config
#83
Comments
Thanks for the really detailed bug report, @jiggneshhgohel! Seeing the mention of the Guardfile at the top of your hanami-reloader's implementation of the So this makes me wonder if this is actually an issue with https://github.com/jc00ke/guard-puma (which you'll see used in your If you bypass running Out of interest, I took a quick look at the guard-puma and it does do a few different things in relation to the control server URL (e.g. https://github.com/jc00ke/guard-puma/blob/560e82ceaf6901cacf76f329260a200b2c5310a4/lib/guard/puma/runner.rb#L13-L15), so this does make me feel like the issue may reside there. Thank you for your help here! |
@timriley Thanks for your prompt response in comment #83 (comment). Regarding following in that comment
You are correct. The logs I shared are from a Hanami 2.0 application and it has hanami-reloader in the Gemfile. Regarding following
I did following changes my puma config file
and ran your suggested command
That shows that the port change was taken into account but the control-url was ignored. Regarding following
Thank you for your proactive behavior on that. I took a look at the guard-puma's options documentation at https://github.com/jc00ke/guard-puma/blob/main/README.md#options and following options took my attention:
So I opened
Now an immediate thing which I came to my mind while looking at it is that why the Now I updated following in Guardfile
TO
and then removed following from puma config (this change I made as mentioned at the start of this comment)
Note: Above changes are made with an assumption that the port configuration should be picked up from puma's config file and the puma's control-url from the Guardfile. Then I ran
As can be seen the control-url config was taken into account (see below from the logs)
but the application's port (configured as default to be 2400) is not picked up from the puma config file (see below from the logs)
So my following assumption I shared before is incorrect:
So I updated following in Guardfile
TO
and then removed following from puma config (this change I made as mentioned at the start of this comment)
Then I ran
So again as can be seen the control-url config was taken into account (see below from the logs)
but the application's port (configured as default to be 2400) is not picked up from Guardfile (see below from the logs)
This is strange! Then I again added back following to puma config file
and ran
So again the application's port (configured as default to be 2400) is neither picked up from Guardfile nor from puma's config file (see below from the logs)
That's again weird. Now I updated following in Guardfile
TO
Note that at this point I haven't updated puma config file w.r.t sequential changes I made and mentioned before while we are investigating the issue. So the puma config file doesn't have the following default configured option in the config file generated by Hanami 2.0 application.
Now I ran
So now the application's port is 9292 (see below from the logs below)
and the control-url's port is 9293 (see below from the logs below)
Now I again updated following in Guardfile
TO
and again in puma config file there is no configuration for port available. Now I ran
So again the application's port is 9292 (see below from the logs below)
Now adding back following to puma config file
and running
So now the application's port is 2400 (see below from the logs below) as is configured in puma config file:
So the gist is:
Thanks. |
ruby 3.1.2
puma (6.2.2)
hanami (2.0.3)
hanami-cli (2.0.3)
rack (2.2.7)
Following shown is my Puma config file containing my custom changes:
config/puma.rb
When I start the server using
hanami server
following are the logsFrom above it is clear that
port
option change is picked up but theactivate_control_app
option specified is not taken into account which is evident from following in the logs:Also one more thing I noticed related to port is the following inconsistency:
Coming back to my point:
activate_control_app
is a supported config option as can be seen at https://github.com/puma/puma/blob/v6.2.2/lib/puma/dsl.rb#L198-L235.But when I directly start the server using following command
then the options are correctly picked-up.
Is this a bug on hanami-cli side or it looks like Puma-side issue related to when options are defined in configuration file?
Thanks.
The text was updated successfully, but these errors were encountered: