Cloner sais "The blog already exists" when it does not.

Hi,

Just to report a small bug: when I try to clone a site to a new site and I choose the name "dev" (on a subdomain installation) I get a notice "The blog already exists" and Cloner refuses to create that new site.

There is (was) no such site on the network and "dev" is not in the disallowed site names list. After creating a site on the dev subdomain manually, I could use Cloner's "Replace exisiting site" to get my dev site up and running without any problems... Looks like there is no valid reason why Cloner would refuse to create the site in the first place.

  • Vinod Dalvi

    Hi @Ravan,

    I hope you are well today and thanks for posting on the forum.

    I have tested it on my test site (on a subdirectory installation) and found the dev blog is getting created by cloning the site using cloner without getting the issue "Replace existing site".

    May be it's subdomain installation specific issue so Would you mind if I logged in to your site and did some troubleshooting? This might help get to the bottom of this faster. If this is ok, just grant me temporary admin access to your site by clicking "Grant Access" button in the WPMU DEV Dashboard Settings as described on the following page and reply on this thread after granting it?

    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Could you please use the attached small plugin on your site that will display the information in the footer of your site only for admin users regarding whether the dev blog exists on your site or not?

    Kind Regards,
    Vinod Dalvi

  • Vinod Dalvi

    Hi @Ravan,

    You can activate the plugin on any of the sites of your multisite.

    I could confirm the issue on your site that the dev blog doesn't exist on your multisite and the shared plugin also confirmed it by displaying "Dev blog does not exist" in the footer but the cloner plugin displays error message as "The blog already exists".

    I couldn't reproduce this issue on my test site.

    Would you mind if I access your site using FTP and did some testing? This might help get to the bottom of this faster. If this is ok, just send log in info through our secured contact form: https://premium.wpmudev.org/contact/
    - Choose "I have a different question"
    - Include my name in the subject "Vinod Dalvi"
    - Include the URL of this post in your message so that I may track this issue better
    - Include login information (Wordpress admin info username + password )
    - Include FTP Details

    Regards,
    Vinod Dalvi

  • RavanH

    I couldn't reproduce this issue on my test site.

    That's funny. I cannot reproduce it either on a similar VPS (Nginx, PHP5.6, MariaDB) with fairly similar network setup. So it looks like a one-off problem...

    I can live with it though. Working around it is not a big problem. So if you don't care too much either (I suppose nobody else reported the issue) than we can leave it like it is. But if you want to get to the bottom of this, I'll be happy to create an FTP account for you :slight_smile: Will www-data level access suffice?

  • RavanH

    Hi Ash, no problem.

    I did notice a few errors in the error.log related to Cloner but it does not look like they occurred during attempts to create a dev clone. In fact, I never had any blank pages or failed clone processes or anything which I would expect looking at these errors. Strange. I'll post them here so you can have a look at them but I don't expect them to say anything meaningful about this issue...

    Some entries like this:

    2015/08/04 00:24:03 [error] 11876#0: *860602 FastCGI sent in stderr: "PHP message: Erreur de la base de données WordPress Table 'aufildudoux_fr.wp_53_options' doesn't exist pour la requête SELECT option_value FROM wp_53_options WHERE option_name = 'wp_53_user_roles' LIMIT 1 faite par require_once('wp-admin/network/admin.php'), require_once('wp-admin/admin.php'), do_action('load-index_page_clone_site'), call_user_func_array, WPMUDEV_Cloner_Admin_Clone_Site->sanitize_clone_form, WPMUDEV_Cloner_Admin_Clone_Site->pre_clone_actions, create_empty_blog, switch_to_blog, WP_Roles->reinit, get_option, W3_Db->query, W3_DbCache->query, W3_DbCallUnderlying->query, W3_Db->query, W3_DbProcessor->query, W3_Db->default_query" while reading response header from upstream, client: 2a02:8426:3dc:4b00:1822:d2d4:f426:4964, server: aufildudoux.fr, request: "POST /wp-admin/network/index.php?page=clone_site&blog_id=52&action=clone HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "aufildudoux.fr", referrer: "http://aufildudoux.fr/wp-admin/network/index.php?page=clone_site&blog_id=52&action=clone"

    And on one attempt:

    2015/08/04 00:35:15 [error] 11876#0: *861093 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to undefined method Site_Copier_Terms::_remove_object_terms() in /var/www/aufildudoux.fr/htdocs/wp-content/plugins/cloner/copier/class.copier-terms.php on line 468" while reading response header from upstream, client: 2a02:8426:3dc:4b00:1822:d2d4:f426:4964, server: aufildudoux.fr, request: "POST /wp-admin/admin-ajax.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "dev.aufildudoux.fr", referrer: "http://dev.aufildudoux.fr/wp-admin/"

    The last error occurred (I suppose) during Vinods visit again such a "table does not exist" error:

    2015/08/05 03:32:25 [error] 11876#0: *896530 FastCGI sent in stderr: "PHP message: Erreur de la base de données WordPress Table 'aufildudoux_fr.wp_55_options' doesn't exist pour la requête SELECT option_value FROM wp_55_options WHERE option_name = 'wp_55_user_roles' LIMIT 1 faite par require_once('wp-admin/network/admin.php'), require_once('wp-admin/admin.php'), do_action('load-index_page_clone_site'), call_user_func_array, WPMUDEV_Cloner_Admin_Clone_Site->sanitize_clone_form, WPMUDEV_Cloner_Admin_Clone_Site->pre_clone_actions, create_empty_blog, switch_to_blog, WP_Roles->reinit, get_option, W3_Db->query, W3_DbCache->query, W3_DbCallUnderlying->query, W3_Db->query, W3_DbProcessor->query, W3_Db->default_query" while reading response header from upstream, client: 106.77.52.105, server: aufildudoux.fr, request: "POST /wp-admin/network/index.php?page=clone_site&blog_id=2&action=clone HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "aufildudoux.fr", referrer: "http://aufildudoux.fr/wp-admin/network/index.php?page=clone_site&blog_id=2&action=clone"
  • RavanH

    It looks like you have a plugin which trying to access the cloned site's table, but while the tables are being created.

    That would be a network wide activated plugin then because this happens on a site with no plugins activated. I tried disabling all W3TC modules but that only changed the error to not include W3TC related functions any more. So it must be one of the others... However, you can understand I hesitate to disable any network wide plugins on a live network.

    PHP version is a 5.5.26-1~dotdeb (not a 5.6 I reported before).

  • Vinod Dalvi

    Hi RavanH,

    "PHP message: Erreur de la base de données WordPress Table 'aufildudoux_fr.wp_53_options' doesn't exist

    "PHP message: Erreur de la base de données WordPress Table 'aufildudoux_fr.wp_55_options' doesn't exist

    Regarding the above two error messages could you please check in your WordPress database that whether the tables aufildudoux_fr.wp_53_options and aufildudoux_fr.wp_55_options exists.

    PHP Fatal error: Call to undefined method Site_Copier_Terms::_remove_object_terms() in /var/www/aufildudoux.fr/htdocs/wp-content/plugins/cloner/copier/class.copier-terms.php on line 468"
    I could confirm the above issue and notified the plugin developer about this so that it can be fixed.

    It will be fixed ASAP.

    In the meanwhile you can fix this issue by editing the following Cloner plugin file on line number 468 as displayed below.

    Cloner plugin file :
    /wp-content/plugins/cloner/copier/class.copier-terms.php

    Before Editing :
    $remove = $this->_remove_object_terms( $object_id, $delete_term_ids, $taxonomy );

    After Editing :
    $remove = $this->remove_object_terms( $object_id, $delete_term_ids, $taxonomy );

    Alternatively you can just replace the above plugin file with the attached updated file class.copier-terms.php that contains the above change.

    Thanks,
    Vinod Dalvi

  • RavanH

    @Vinod that's great!

    The table that is reported missing in the error does exist after the cloning process is done. The redirect to the new dashboard goes just fine.

    I did another cloning and looked at the error time stamp. It looks like the error occurs right at the start of the cloning process. I suppose just before or right at the first stage "Cloning Settings" (or "options" or whatever the text message is).

    Is there maybe a switch_to_blog being done before the table is created?

    One more thing I noticed when copying sites: the main administration e-mail address gets replaced with "you@example.com". Is this by design?

  • Ash

    Hello @RavanH

    One more thing I noticed when copying sites: the main administration e-mail address gets replaced with "you@example.com". Is this by design?

    This is default behavior. So, that you can set new email address in a new cloned site. But you can use a little code snippet to copy the email address too. Please try the following:

    add_filter( 'wpmudev_copier_exclude_settings', 'wpmudev_copier_exclude_settings_cb', 10, 1 );
    function wpmudev_copier_exclude_settings_cb( $exclude_settings ) {
    
      if (($key = array_search('admin_email', $exclude_settings)) !== false) {
        unset($exclude_settings[$key]);
      }
    
      if (($key = array_search('new_admin_email', $exclude_settings)) !== false) {
        unset($exclude_settings[$key]);
      }
    
      return $exclude_settings;
    
    }

    You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.

    "PHP message: Erreur de la base de données WordPress Table 'aufildudoux_fr.wp_55_options' doesn't exist

    I could replicate the issue in my test site, so I am letting the developer know.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.