winterbox encountered an issue where Read-only mode remained enabled on a secondary site within a multisite Discourse installation after a restore, despite successfully using discourse disable_readonly. zogstrip suggested entering the Rails console to run Discourse.disable_readonly_mode, but winterbox confirmed this also failed without errors. zogstrip correctly identified that the command was likely targeting the primary database instead of the specific secondary site database required for multisite setups. After winterbox verified that the standard command only affected the first site, zogstrip advised specifying the database name using the RAILS_DB environment variable. winterbox initially struggled to identify the correct database name, attempting secondforum which resulted in an error. Ultimately, winterbox resolved the issue by executing RAILS_DB=secondsite rails c followed by Discourse.disable_readonly_mode, successfully disabling Read-only mode on the restored secondary site.
root@localhost-app:/# discourse disable_readonly
The site is now fully operable.
Here I did your instruction:
root@localhost:/var/discourse# ./launcher enter app
WARNING: No swap limit support
root@localhost-app:/# rails c
[1] pry(main)> Discourse.disable_readonly_mode
=> true
root@localhost-app:/# discourse enable_readonly
The site is now in readonly mode.
root@localhost-app:/# discourse disable_readonly
The site is now fully operable.
root@localhost-app:/#
But it seems it only affects on the first site, not the second site.
(For more info: I configured multisite, and I restored with backup data. Then it happened)