Quantcast
Channel: Topic Tag: Database Error | WordPress.org
Viewing all articles
Browse latest Browse all 631

mengsel on "Possible fix for sudden redirect loop at wp-login with reauth=1"

$
0
0

Hi there, just wanted to share the solution to my grand frustration of the night. I had two websites running perfectly fine until one day I had to log in and take a peek at them again and update WP, when I encountered an obscure error...

Upon logging in with correct credentials (I double checked first by resetting it, then manually changing it in PhpMyAdmin) I kept getting bounced back to the wp-login screen. The URL was each time appended as http://mysite/wp-login.php?redirect_to=http%3A%2F%2Fmysite%2Fwp-admin%2F&reauth=1. So I started mucking about the forums and googling fixes.

Here are all the things that I tried, but in my case, did not work:

  • Clearing my cache, logging in in Incognito-mode, user other browsers, etc.
  • Disabling all plugins by renaming the wp-content/plugins folder
  • Disabling all themes except twentysomething
  • Doing a complete re-upload of everything WP except wp-config.php and especially re-uploading wp-login.php
  • Wiping the .htaccess file (Thank god I made a backup)
  • Checking my database if it exceeded the allowed size (Mind you this has been a fix for several cases I encountered so make sure to check that!)
  • Adding code to wp-login.php to re-specify my site URL, or, doing the same manually in PhpMyAdmin to wp_options under 'home' and 'siteurl' (Mind you this can be a fix if you're using a different URL for your WP install than your server configuration, so that it bounces between http://www.yoursite and http://yoursite)

So then, like the hilarious amateur I am, I came to the enlightened idea of perhaps checking the debugger out!

TIP: when things hit the fan, churn on that debugger and amaze at the amount of useful information it provides you!

Now the debugger gave me two pieces of info I could use:

  1. An error stating MySQL server has gone away followed by something about usermeta, meta_value and a gigantic string of information it apparently tried and failed to write into the database
  2. Several errors regarding Cannot modify header information - headers already sent

Because I suspected the errors came in in the right order, just like that, I finally discovered the problem: the database. It looked like a session token was being written into the database, but because it was gigantic, the database timed out, making WordPress fling me back to the login page again.

My Fix

  1. Go into PhpMyAdmin to your WordPress database
  2. Find the table named wp_usermeta
  3. Find the rows titled session_token
  4. Delete the value associated with it
  5. (Mind you the value is huge and your browser might freak out. I did it by clicking 'edit' for that record first, then toggling the null value for the field on and off, selecting the empty field and pressing delete a couple of times to make sure, and then hit save)

And there you have it. A possible solution to that incessant and infuriating redirect loop problem that occurs when your database and WordPress stop playing together correctly. I've seen a lot of frustrated users in the forums with similar issues, so I hope this post will be of use to you. Good luck.


Viewing all articles
Browse latest Browse all 631

Trending Articles