Unable to login as admin after enabling read only mode

My site says “Login is disabled while the site is in read only mode?” so I cannot log in:

1 Like

Visit yoursite.com/u/admin-login i.e. help.gulshankumar.net/u/admin-login and then try to log in if that works?

Hi,

Thanks for the response. I tried, it says -

{"errors":["The site is in read only mode. Interactions are disabled."],"error_type":"read_only"}

Depending upon how you enabled the read only mode, here is some help:


or

3 Likes

I had enabled read-only mode from admin area from where we do backup.

1 Like

Second option I suggested above should work for you. Please do not log out the next time you put your forum into read only mode.

Ps: Try searching before posting a new query, You may find your solution into a similar question asked by someone else.

1 Like

Sorry, I couldn’t understand above written steps. Do I need to edit any code? :thinking:

1 Like

You don’t have to edit anything. Just ssh into your discourse server and do the following:

cd /var/discourse
./launcher enter app
rails c
Discourse.disable_readonly_mode(Discourse::USER_READONLY_MODE_KEY)

6 Likes

I hope everything is fine.

Try again, You may have entered the commands incorrectly. It should return like this:
Screenshot%20from%202018-04-15%2014-13-47

3 Likes

I replicated above steps. Still, site is showing in the read-only mode.

image

Discourse.disable_readonly_mode
Not working.

Discourse.disable_readonly_mode(Discourse::USER_READONLY_MODE_KEY)
Working.

Thanks a lot. Now I am able to login.

6 Likes