WordPress.org

Ready to get started?Download WordPress

Forums

HyperDB
[resolved] Hyperdb redirects to wp-admin/install.php with no read servers up (2 posts)

  1. archon810
    Member
    Posted 1 year ago #

    I'm enabling hyperdb on a high-traffic website (http://www.androidpolice.com) but during my testing found pretty shocking behavior in my opinion when a certain situation occurs.

    Basically, when all db read servers are down, rather than showing the standard "Error establishing a database connection" page as you would expect, anyone visiting the site is immediately redirected to wp-admin/install.php. No matter if you're logged in or not, that's where you end up.

    I kind of understand why it happens, but I'm terrified to think that rather than get a descriptive DB error page, users will be instead directed to a page that shows up during the very first WP install. Moreover, I'm not sure what would happen if they got to that page and the read server came back up in the meantime, then they submitted the form.

    Is there a way to get hyperdb to error out when no read servers are available instead of having users deal with this unfriendly and potentially dangerous behavior?

    To test, just set all read servers to 0 in the config or just shut down mysql on the hosts with read > 0.

    http://wordpress.org/extend/plugins/hyperdb/

  2. archon810
    Member
    Posted 1 year ago #

    Fix offered here: http://core.trac.wordpress.org/ticket/22853

    function wpdb_connection_error( $host, $port, $op, $tbl, $ds, $dbhname, $wpdb ) {
    	dead_db();
    }
    $wpdb->add_callback( 'wpdb_connection_error', 'db_connection_error' );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.