Where is the read only mode?


(Patrick Klug) #1

I can’t figure out where to put discourse into a read only mode for maintenance. Apparently there are bugs for this feature so it must exist.

Where is it?


(Régis Hanol) #2

It’s in the /admin/backups section :wink:


(Florian Beer) #3

There is no such page (admin/backups) on this particular setup :frowning:
Is there any other way? e.g. with a config setting or simila?


(Régis Hanol) #4

You need to be admin of your instance and running the very latest version of Discourse.


(Florian Beer) #5

I am admin and updating to the latest version is kinda the point here :wink:
Currently running 0.9.8.3


(Régis Hanol) #6

It’s a recent feature that was introduced a week ago. So you’ll have to update the old way I guess.


(Florian Beer) #7

Is there a recommended way?
Redirecting the nginx host to a temporary page or something like that?


(Clifford Duke) #8

You could add 502 error handling while discourse is down.

error_page 502 /502.html;
location = /502.html {
	root  /var/www/public_html;
}

(Florian Beer) #9

Ultimately I just made a new nginx config for the original URL that pointed to a static page and switched the old discourse to a custom subdomain (to be able to see old settings).

The whole process was part of a migration to a new Digital Ocean Droplet and using discourse_docker for the new install. It all went flawlessly as far as I can see and I’m very happy with the way discourse now runs in a portable container.


(Clifford Duke) #10

Glad you managed to get it transitioned smoothly :smile:

I would still suggest adding the error_page portion to your nginx config as it will be used when you update your discourse instance (which should be fairly often considering how often things are added or changed)


(Caue Rego) #11

Is there a way to tell how and why it was activated?

I’m the only admin of my discourse and I got no idea why it was activated. Admin/Logs don’t show it either. Much to the contrary, they show the last time I was doing anything, it was certainly not activated since my actions were being recorded.


(Dylan) #12

Are you on the latest version? If so, did you try running a backup or have automatic backups?

It’s had a bug for backups where it will crash and leave the site in read only mode, happened to me a few times since updating to 1.2.0.beta6.


(Dean Taylor) #13

Possible disk space issue:


(Caue Rego) #14

Hmm, that’s good to know @DeanMarkTaylor . Maybe that was it…

Yes and no. The only thing I did 1 week ago, in which the read only mode was naturally off (I think I never turned it on ever) was I changed embedding url to a broken one (forgot to make the new one working) and now I see the error log went crazy.

So right now it looks to me the error log took out all the disk space, even if my backups are not failing (also have backups set on S3 anyway). Well, I won’t look too much into it (lazy to get on terminal now). If that was it I’ll know about it soon enough. :stuck_out_tongue:


(Mitchell Krog) #15

I was just sitting here this morning wondering about putting up a nice maintenance message instead of a horrible 502 error when rebuilding the app or doing other maintenance, this answered that question and I just popped a nice maintenance in progress page into the nginx configuration for the site using this. Thank you :wink: