Site-instelling is elke keer anders op Ubuntu development installation

AI-generated summary

Users joa1 and markb1 report inconsistent site settings behavior on Ubuntu development installations of Discourse, where changes are not reflected after refresh — likely due to caching or worker isolation. markb1 observes that reducing Puma workers to 1 resolves the issue locally but not in scaled environments, suggesting each worker holds its own settings cache. Falco clarifies that the official installation method doesn’t use Puma and doesn’t exhibit this bug, implying the issue stems from dev setup. markb1 confirms using the Ubuntu dev guide and launching via bundle exec rails server, which defaults to Puma. pfaffman suggests verifying server status and testing settings via Rails console. riking identifies a broken MessageBus — likely due to misconfigured Redis — as the root cause, noting live updates may also fail. markb1 adds that site_setting_saved events are still triggered but no longer listened to, possibly indicating outdated code paths. Falco suggests using Unicorn (bin/unicorn) as an alternative in dev. The core issue appears tied to Puma + Redis + MessageBus in non-standard dev setups, not production installations.

Hello I am building a forum site.

I tried to change the site settings and refresh the site,
I cannot get the changed values ​​intermittently.

Each refresh seems to show the previously cached values.

I Adjusted the number of puma workers, but it does do same.

The changed value is put in the database.

Is it a problem of message_bus?
If so, how should I change the settings configure?

Please reply to me. Thank you!

How exactly did you install Discourse?

I’m seeing the same thing. If I set the Puma worker count to 1 the issue goes away. It appears that each worker is holding a copy of the site settings object, and when one worker performs an update the other workers are never aware of that update.

Unfortunately, this issue is also present in a scaled-out environment with multiple Discourse servers, so just setting the worker count to 1 isn’t a total fix.

I need to ask the same thing: How exactly did you install Discourse?

When installed following the only supported method, we don’t use Puma, and this bug is not present.

I’m trying to do some plugin development, so I followed the link in the README to setup an Ubuntu development environment. When I run the command bundle exec rails server --binding=0.0.0.0 it starts the app with Puma.

The only thing like that I’ve seen is if the server is stopped the browser will sometimes return a json file or the cached version of the site.

Is the server still running?

Another thing I do is open another terminal and run

./bin/rails c

And change settings there with something like

SiteSetting.title=“my title”

The server is still running. I’ve verified from the logs that Discourse is serving the request. I also have cache disabled in my browser’s developer console while I’m debugging this.

Why are you scaling out during plugin development?

The symptoms indicate that your internal MessageBus is broken, so something’s wrong with your Redis setup. Live updates in the browser may also be broken.

I wasn’t scaling out for plugin development, just testing this in a few different scenarios to try to narrow down my issue and make sure I understood it. If the MessageBus is supposed to handle this then I will look into that further.

While debugging, I did notice that app/models/site_setting.rb is still triggering a :site_setting_saved event, which appears to have been removed from the app and replaced with :site_setting_changed. There is nothing listening to the :site_setting_saved event anymore.

You can run the Unicorn web server in development with bin/unicorn too.