Unable to log into my discourse - "You can't log in as xxx from that IP address."


(Tobias Eigen) #1

Uh oh - I am having a problem!

Update: my suspicion is that this is about cloudflare, and the way we block IP addresses when deleting users. Is there any way to fix this so we can log into our discourse again??


(Neil Lalonde) #2

You’ll need to go into the rails console or postgresql command line and delete the ScreenedIpAddress record for your IP address.

s = ScreenedIpAddress.match_for_ip_address("...")
s.destroy

(Tobias Eigen) #3

Thanks, @neil! I’m happy to do this but don’t know how to do it. Would you be willing to give me steps? I’d really appreciate it.


(Neil Lalonde) #4

Using the standard Docker install:

cd /var/discourse
sudo -E ./launcher enter app
rails c
s = ScreenedIpAddress.match_for_ip_address("...")
s.destroy

You might have used a different name than “app” for your yml file.


(Kane York) #5

Use ScreenedIpAddress.all to see what’s there and which ones you need to delete.


(Tobias Eigen) #6

thanks everyone! so what worked for me ultimately was:

  1. log in using my phone (where I had not yet logged out!) and grab the user list, which includes IP address for users
  2. opened rails console using commands provided elsewhere by @sam, then ran commands provided by @neil for the IP address of affected users