I… I’m not even sure how to begin.
I’m running the latest version of Discourse using the
web_only template – using external Redis and Postgres servers, and also fronted by a reverse proxy using haproxy.
Today, when I was trying to get haproxy to pass along the actual IP of the client, I used the ‘Force Browser Refresh’ button on the back-end for my profile. I have a sneaking suspicion I clicked it twice.
As a result, the page would load… and then refresh. And then refresh again. And refresh again. And on and on in a never-ending loop of pain.
Logging out (which I managed) interrupted the cycle, and I was able to browse anonymously, but then when I logged back in, the redirect loop was back.
So I URL-manipulated my way to the back-end page for my user and clicked the ‘logout user’ button, hoping that would fix things (NB: I have ‘logout on all devices’ disabled).
Now whenever I log in, I get a popup that says that I’ve been logged out… and before I can do anything, the page refreshes, only to repeat. On the odd chance that I’m quick enough to click the ‘Refresh’ button on that modal, I’m logged out, redirected to my logout page… and then when I try to login again, it’s back.
So I did a bit of digging, and found out that the MessageBus was responsible. I also found a ton of messages under the /logout channel there, so I figured I’d clear out Redis and things would be solved. No dice – a
FLUSHDB on both the database specified in
DISCOURSE_REDIS_HOST and a
FLUSHDB to the entire server itself both failed to solve the problem.
I’ve restarted Redis, restarted Sidekiq, rebuilt and restarted Discourse, and I’m still stuck in this Sisyphean nightmare. I don’t really know what I did, but I’m sorry, I promise.
I’m also at the limit of my troubleshooting ability here. I could dig more into MessageBus and figure out how it’s discharged, but I was hoping someone with a bit more knowledge of that code could give me a few tips on how best to get myself straight again!