Can't login after restoring


(Seferi) #1

Hi,

I migrated my forum to a local device behind a Raspberry Pi Nginx reverse proxy. Installed discourse and registered and went straight to Admin section to restore from my backup. (/var/discourse/shared/standalone/backups/default) I restored successfully but afterwards I couldn’t login anymore. I tried rebuilding the app but it didn’t help. Site works fine now but it doesn’t let me login, When i try to login it says unknown error in red, when i click forgot password and enter my username i get the email to choose new password but when i enter the new password and click ok it says "Sorry, that password change link is too old. Select the Log In button and use ‘I forgot my password’ to get a new link."
What can I do?


(Vaping Community) #2

This might seem dumb but is the time on your server correct?


(Vaping Community) #3

You could try:

cd /var/discourse 
./launcher enter app
rake admin:create

This should allow you to setup a new admin account


(Seferi) #4

Thanks for the reply mate. Server time is correct. I followed the steps and created a new admin account but when I try to login with it, it just shows back the login screen again… Doesn’t work… And sometime it says unknown error in red after trying to login…


(Daniela) #5

Try to login with http://your.site.com/users/admin-login


(Seferi) #6

I tried. It says: [“BAD CSRF”]


(Jay Pfaffman) #7

Was the old site https and this one is http? If so you need to enter the rails console and

SiteSettings.force_https=false

(Seferi) #8

Thanks mate, how do I enter the rails console?


#9

If I remember right off hand its the following:

cd /var/discourse
./launcher enter app
rails c

(Seferi) #10

When i do

and then

I get this:

[1] pry(main)> SiteSettings.force_https=false
NoMethodError: undefined method force_https=' for SiteSettings:Module from (pry):1:inpry
[2] pry(main)>


Force HTTPS - An error has occured
(Vaping Community) #11

Try wrapping false in quotes

This should work…
SiteSetting.force_https = false

OR

s = SiteSetting.find_by(name: 'force_https')
s.value = 'false'  
s.save

(Seferi) #12

Thanks alot guys, it worked, I can login now… In the process I created a few admin accounts which I don’t need. How can I delete those?


(Jay Pfaffman) #13

Remove their admin rights. Then you can delete them.