Domain maping causing connection reset

Hi I'm experiencing an issue with domain mapping-plugin. I keep getting

"The connection was reset" in the browser when in wp-admin.

This only happens when the mapping-plugin is in the WordPress plugins folder if it's not then there is not "The connection was reset" from the browser.

I'm also using multi-DB

  • Alexander
    • DEV MAN’s Mascot

    Hi @northgate,

    I'm sorry you're having this issue. Let's see if we can find any other error messages. Then we can narrow down the problem a bit further.

    Can you please start by enabling debug mode? This can be done by opening your wp-config.php file and changing

    define('WP_DEBUG', false);
    to
    define('WP_DEBUG', true);

    Then try to access your dashboard again. Let me know if you get any error message.

    Thanks for being a WPMU DEV member. Let us know if we can be of any further assistance.
    Best regards,

  • northgate
    • The Incredible Code Injector

    on the site front-end I'm getting

    Notice: Use of undefined constant DATACENTER - assumed 'DATACENTER' in /wp-content/db.php on line 287 Notice: Use of undefined constant DATACENTER - assumed 'DATACENTER' in /wp-content/db.php on line 294

    On the back-end

    The connection was reset

    Notice: Undefined variable: query_type in /wp-content/db.php on line 665 Notice: Undefined variable: query_type in /wp-content/db.php on line 665 Notice: Use of undefined constant DATACENTER - assumed 'DATACENTER' in wp-content/db.php on line 287 Notice: Use of undefined constant DATACENTER - assumed 'DATACENTER' in /wp-content/db.php on line 294

    Can’t select database

    We were able to connect to the database server (which means your username and password is okay) but not able to select the xxx_global database.

    Are you sure it exists?
    Does the user user_name have permission to use the xxx_global database?
    On some systems the name of your database is prefixed with your username, so it would be like username_xxx_global. Could that be the problem?

    If you don't know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.

    Note: The front-end of sites do work as normal and do not produce the connection error

    This all started yesterday.

  • Alexander
    • DEV MAN’s Mascot

    Hi again @northgate,

    Thank you for providing the error messages. I have a couple more questions.

    This one might be unrelated, but when you installed Domain Mapping, did you move the sunrise.php file as per the instructions here? https://premium.wpmudev.org/project/domain-mapping/#usage

    Those errors suggest a problem with the multi db configuration. Can you also provide the contents of your "db-config.php" file? Please mask out any confidential information such as username/password.

    Thanks!

  • northgate
    • The Incredible Code Injector

    Here is my error

    [Thu Jun 20 12:33:37 2013] [warn] [client 190.123.123.123] mod_fcgid: stderr: \\";s:7:\\"user_id\\";i:7;s:6:\\"action\\";s:5:\\"login\\";}s:32:\\"225af92892ed6d750dea3cda4ec9f942\\";a:4:{s:6:\\"domain\\";s:25:\\"http://www.example.com/\\";s:4:\\"hash\\";s:32:\\"225af92892ed6d750dea3cda4ec9f942\\";s:7:\\"user_id\\";i:7;s:6:\\"action\\";s:5:\\"login\\";}}' WHERE user_id = 7 AND meta_key = 'cross_domain' made by include('wp-admin/admin-header.php'), do_action('admin_head'), call_user_func_array, domain_map->build_cookie, update_user_meta, update_metadata, m_wpdb->
    [Thu Jun 20 12:33:37 2013] [warn] [client 190.123.123.123] mod_fcgid: stderr: query
    [Thu Jun 20 12:33:37 2013] [warn] [client 190.123.123.123] mod_fcgid: stderr: Wordpress database error MySQL server has gone away for query DELETE FROM database_options WHERE option_name = '_transient_dirsize_cache' made by include('wp-admin/admin-header.php'), do_action('admin_notices'), call_user_func_array, ProSites_Module_Quota->out_message, is_upload_space_available, get_upload_space_available, get_space_used, get_dirsize, get_transient, delete_option, m_wpdb->query

  • Alexander
    • DEV MAN’s Mascot

    Would you mind also providing the contents of your db-config.php with the confidential info masked out?

    I'm not sure what is causing that error, so it's likely I'll need to contact the developer, but would like to make sure he has all the info possible.

    Thanks!

  • northgate
    • The Incredible Code Injector

    I'm still not sure exactly what caused the error but I rolled back my database to an older back-up (the day before the issue) and it seems to have resolved the problem.

    I will keep an eye on it and update this post if it reoccurs.

    Thanks for the help guys

  • northgate
    • The Incredible Code Injector

    Updated: with `define('WP_DEBUG', true);
    `
    Notice: Undefined variable: query_type in /wp-content/db.php on line 665 Notice: Undefined variable: query_type in /wp-content/db.php on line 665 Notice: Use of undefined constant DATACENTER - assumed 'DATACENTER' in /wp-content/db.php on line 287 Notice: Use of undefined constant DATACENTER - assumed 'DATACENTER' in /wp-content/db.php on line 294

  • northgate
    • The Incredible Code Injector

    Thanks for responding with the update.

    Note: so far the connection reset only occurs when trying to login as supper admin.

    Logging into a sub site doesn't cause the connection rest.

    I believe the plugin might be trying to running too many queries at the same time or there might be other problems.

    Awaiting your response.

  • Barry
    • DEV MAN’s Mascot

    Notice: Undefined variable: query_type in /wp-content/db.php on line 665 Notice: Undefined variable: query_type in /wp-content/db.php on line 665 Notice: Use of undefined constant DATACENTER - assumed 'DATACENTER' in /wp-content/db.php on line 287 Notice: Use of undefined constant DATACENTER - assumed 'DATACENTER' in /wp-content/db.php on line 294

    That means you have incorrect settings in your db-config.php file (it's a message you get when one of the settings is incorrect, so there may be others).

  • northgate
    • The Incredible Code Injector

    Any update?

    From further testing it appears that the plugin is some how running queries (which is very long) for all domains on all available sites when logged in as supper admin on each page load.

    Also note: Despite all subsites are already up to date, after continues refreshing the supper admin back-end will load occasionally load however this notice is shown "Thank you for Updating! Please visit the Update Network page to update all your sites."

    If the plugin is not activated the update sites notice is not shown.

  • Barry
    • DEV MAN’s Mascot

    During initial setup almost 10-12 months ago I was informed by support that it wasn't necessary

    It's very necessary - otherwise you wouldn't be getting the warnings about it not being set :slight_smile: It determines the priority of connections within the plugin - every add_db_server is trying to add a database to a datacenter (dc1) that you haven't defined anywhere :slight_smile:

  • Barry
    • DEV MAN’s Mascot

    My database is not hosted on the same server but hosted on Amazon RDS connection is via endpoints and not Ip

    Yet you have the IP address in all your add_db_server lines? what IP address are you using in those lines if it isn't the db server?

    add_db_server('000', 'dc1', 1, 1,'123.123.123.85','123.123.123.85', 'database_000', 'username', 'password');

  • northgate
    • The Incredible Code Injector

    Amazon RDS utilizes endpoints as follows:

    Endpoint: dbname.czay3fxonrmi.us-west-1.rds.amazonaws.com:3306

    They do not provide IP addresses for connecting to databases.

    Yet you have the IP address in all your add_db_server lines? what IP address are you using in those lines if it isn't the db server?

    The numbers included in the db-config file are simply numbers used to mask my original endpoint my apologies for the confusion.

    is it possible for the plugin to utilize endpoint or is it design to only work with ip's?

  • Aaron
    • CTO

    From further testing it appears that the plugin is some how running queries (which is very long) for all domains on all available sites when logged in as supper admin on each page load.

    The question is what are these queries, and what plugin is generating them? You'll have to narrow that down, it's common for people to code multisite plugins and not make them scalable, trying to loop through all blogs.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.