WordPress.org

Ready to get started?Download WordPress

Forums

"Unknown Login Key" caused by read only DB (3 posts)

  1. My host is experiencing some issues with their Database, and this means the remote login JS in WP Mu Domain Mapping is failing as it cannot write the key/ID to the DB, doesn't notices this is the case, then redirects the user to a screen where the key/ID is checked… this fails with "Unknown Login Key" as the key/ID isn't in the DB because it was never written due to the DB being in read only mode. So much fun, am I right?

    The problem is that this means logged in admins cannot browse the site in this situation, because the error message keeps coming up.

    I created a patch for WP Mu Domain Mapping which does two things:

    1. Test to ensure that when the key/ID was written there were no DB errors, and if an error is detected print a debug message instead of the redirection JS.
    2. While I was there, I rewrote the insert to use the $wpdb->insert method, instead of the $wpdb->query method.

    The patch is here: http://pastebin.com/U0NeFpYQ

    Any feedback welcome. DO NOT APPLY THIS PATCH UNLESS YOU KNOW WHAT YOU ARE DOING.

    http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

  2. Donncha O Caoimh
    Member
    Posted 1 year ago #

    Thanks Simon, that's a good idea. I might even make it email the admin, although that would require some sort of memory so the admin isn't inundated with emails!

  3. I guess you could store the flag that an email has been sent in a cookie, and perhaps email the user rather than the admin to explain what's happening (rather than the site owner)? Difficult if the user is non-technical and just panics… but then if they're prone to panic and the site has just gone read-only, then they might be panicking already!

Topic Closed

This topic has been closed to new replies.

About this Topic