Lots of disconnected sites after update of MainWP 4.5.0.1

Hi @dms, @VR51, @dcgavril , @josklever, @stevenosullivan , @spicone

We are open to helping out anyone who reaches out. If the solutions from the KB do not work for you, please open a support ticket, and we will be very glad to help.

We cannot currently provide a solution for bulk fix because we cannot duplicate the problem. So far, people that opened private tickets resolved issues on their own, and so there wasn’t an opportunity for us to investigate their issues.

Releasing a new Child plugin 4.5.0.1 at this point is not a viable solution because you would not be able to update it from Dashboard, so you would still need to go to each child site to update MainWP Child plus we don’t know if Child needs any additional update.

If you are unable to give us access, unfortunately, at this moment we can only refer you to the KB which instructs you how to fix the issues by yourself.

However, if you are willing to give us access to your Dashboard and child sites (or a Test Setup where you can duplicate the problem), support tickets are welcome and we will gladly investigate this issue further.

4 Likes

As mentioned by someone else above here the issue is mostly with sites that have been connected to MainWP for several years.

The following information might help some on here who have lost access to their sites’ admin area due to not having a current record of the login details.

Options for reactivating the child plugin:

  1. Use WP CLI to deactivate then reactivate the child plugin before reconnecting the dashboard plugin to the child site; or
  2. Use the script below to do the same.

How to use the script:

  1. Upload the script into a file at wp-content/mu-plugins/react.php (create as necessary);
  2. Visit the frontend of the child site;
  3. Delete the script react.php;
  4. Visit the dashboard site to reconnect to your child site then synch the child site.

It is important to delete the script before you try to reconnect or synch the child site. You cannot rename the script to disable it. It is an MU Plugin so will run no matter the file name.

Do not leave the script on your server otherwise the child plugin will perpetually deactivate and reactivate with every visit to your site.

You could if you wanted narrow the script’s functionality to only run when a specific page is visited e.g. a contact page.

function reactivate_plugin() {
		$plugin = 'mainwp-child/mainwp-child.php';
    deactivate_plugins($plugin);
    activate_plugin($plugin);
}
add_action( 'wp_loaded', 'reactivate_plugin' );
function done(){
    echo "<div style='width:100px;height:50px;background:#fff;color:#ff0000;'><p>Done!</p></div>";
    
}
add_action('wp_footer', 'done');

The above script deactivates then reactivates the child plugin when WP loads. Unless a cache plugin prevents it you should see a “Done” message near the bottom of the website. The message does not need to display in order for the plugin to have worked; it’s shown purely for my own satisfaction.

@bojan As I said in an earlier comment the best solution would be for Main WP to release a 4.5.0.1 child plugin and ask WordPress.org to force push the update. This update should contain an accessory plugin that runs once then deletes itself. That accessory plugin should deactivate MainWP Child then reactivate MainWP Child then delete itself. This would solve the problem for all MainWP users. All MainWP users would then need to reconnect all sites from the dashboard site. See the above script for help.

3 Likes

We are also experiencing this issue – I haven’t done a full scan but it looks like we have hundreds of our 500+ websites disconnected, as we’ve been using MainWP for years.

@bojan
An interesting thing I found is that while an affected child site is marked as “connected” in MainWP dashboard you cannot use the one-click log-in. BUT, if you try syncing the child site and it is then marked as “disconnected”, the one-click sign-in works (even though the site shows as disconnected).

From there we can disable and re-enable the Child plugin and then reconnect the site. This is still a one-by-one solution and we’d much prefer a bulk method if one can be found.

3 Likes

Same issue for me. After upgrading to the latest MainWP 4.5.0.1 Dashboard, each day when I log in I’ll have another group of my sites disconnected. Like everyone else, reconnecting them does not work because they’ll disconnect again during the next sync attempt. My only solution so far has been to log in one by one and deactivate and reactivate the MainWP Child plugin on each child site. With some older sites even this did not work. My only solution for those sites has been to completely delete the MainWP child plugin and reinstall it. This seems to change some plugin setting so that it will successfully reconnect and sync. An exhausting process…

Hi @acuperfect

Thanks for this insight.

This is perfectly understandable, and we’re working on it. What complicates matters is that we can’t reproduce it on our many test Dashboards.

The underlying issue appears to be related to the ‘mainwp_child_openssl_sign_algo’ option in the child site’s database not being created and also not being properly updated when the Signature algorithm is changed from SHA1 to SHA256.

We got access to one of the user’s Dashboards, which was affected by this issue, and we are identifying the root cause.

On that Dashboard, only some sites got disconnected, even though ALL the child sites are on the same server with fairly similar configurations.

So based on that, there was no obvious reason why the ‘mainwp_child_openssl_sign_algo’ option would fail to update only for some sites.

We looked into all potential problems, and common denominators, such as Cloudflare, cache, security plugins, and so on, and as of right now, we couldn’t find a pattern.

The only concrete conclusion is that something is preventing that option from being created/updated in the Database.
The work is ongoing.

Hi @abundantdesigns

Reinstalling MainWP Child shouldn’t do anything that deactivating & reactivating won’t, as no data is removed upon deletion. The issue was likely just coincidentally resolved by reinstalling.
Another possibility is that perhaps the Child plugin was not completely up to date prior to reinstallation.

Count me in as having the issue as well.

It seems realy to be only a problem of the oldest installations!

Now I manually reconnect ~30 Websites and after another sync, they stay connected so far :slight_smile:

@VR51 thank you!

1 Like

I’m not sure if this is related but we suddenly see half of the sites not updating anymore, since the mainwp update. They don’t disconnect but updates for plugins that always ran through without an issue suddenly fail. (tried repeatedly)

1 Like

Take a look at our KB article on resolving the connection issue related to v4.5: Fix the disconnection issue after upgrading to 4.5 - MainWP Documentation

If you are willing to give us access to your Dashboard and child sites (or a Test Setup where you can duplicate the problem), a support ticket is welcome, and we will gladly investigate this issue further.

Thanks for the update. I’m glad you’ve managed to reconnect all your sites.

Other than the updates not going through, are you able to synchronize the sites and/or perform other actions via the MainWP Dashboard?

1 Like

Upon further testing:
It seems this was related to the very same issue. Going to each site, disconnecting and reconnecting the mainwp plugin and sync and update worked again. The sites didn’t show as disconnected, but they may have been, causing the issue with updating.

1 Like

Thanks for updating us, and I’m glad deactivating and reactivating the Child plugin solved the issue.

I agree, but having to do so with many sites is not really a pleasurable experience, I promise you. This update has created more issues than any before … so something truly messed up.

I just had to move a site and this was a site that didn’t have the option “mainwp_child_openssl_sign_algo” with value 7 stored in the options table yet. So I did monitor the value to determine when this is exactly saved. It appears that this record is created at the first sync after the reconnect.

Hopefully this helps a bit in the investigation.

1 Like

Thanks, @josklever Jos, I’ve passed it along to the dev team.

1 Like

The entire team has been investigating the problem, and we finally got to the bottom of it. After an extensive investigation, we found that the issue affected Child sites connected to your MainWP Dashboard by using MainWP version 3.5.1 (released on November 14, 2018) or any previous version.

Until MainWP 3.5.2 (released on November 27, 2018), the plugin used an OpenSSL key length of 384 bites when a child site gets added to the MainWP Dashboard. However, with MainWP 3.5.2, the key length was updated to 2048. So, in case child sites never got disconnected and reconnected after that, the old (shorter) keys were still in use, and the recent update to the OpenSSL Signature Verification algorithm SHA256 caused compatibility problems.

When we found the cause, we designed the solution that would be easiest to apply and does not require a new MainWP Child plugin version.

In the MainWP Dashboard plugin, on the Tools page, we added the Reset OpenSSL Key Pair button. This feature will trigger the process to fix sites and run as follows:

  • It will use SHA1 as the Signature Verification Algorithm
  • It will remove the old (short) OpenSSL Public Key from disconnected child sites
  • It will reestablish Connection and use new OpenSSL Keys (2048 bits)

The help article is available here:

Before this version goes public, you are welcome to contact us via HelpDesk ticket if you want to get a pre-release version and try to resolve the problem. If you prefer, you can wait for the official release.

At first, we could not duplicate this problem on our sites, so we had to manually set legacy OpenSSL keys in our test sites and update them to SHA256. This caused the connection failure. So, we were able to test the fix, and it worked for us!

6 Likes

Hi @bojan!

This really sounds like a probable cause, so it’s great that this has been discovered! :partying_face:

I’m definitely a user from before 2018, so that explains why I was hit by this issue. However I’ve also got lots of sites that have been connected to my dashboard in the more recent years and they were also disconnected. So it might not be the only cause.

Would it be an idea to do some sort of health check (like WordPress - Tools - Site Health) to check all the options and tables related to MainWP in the database (both dashboard and child sites) and check their values? Everything that shows up but isn’t expected to be there (old options/tables) or have an incompatible value (like the shorter keys) could be listed and reported here or via a ticket. So nothing should be cleaned up automatically, but it improves the list and if it has been tested, old data can be removed automatically or updated to the current standards. This could help detect issues in an early stage and also cleanup the database. I would be very happy to test that! :smiley:

3 Likes

Same for me, I had the issue with all the sites I manage(old <2018 and new) even if they showed connected the updates were not showing up at sync, so I had to pass through every single one and deactivate and reactivate the child plugin +reconnect în order to have them work correctly, so most likely there are other settings that might create issues with this update. Hopefully the next update will not break the connection again. As @josklever was saying it might be useful to create a list of settings that need to be there and try to get the old ones updated or removed so that we’ll have a clean environment, but of course please try to not break them.

We all create bugs, the most important thing is to acknowledge it and try to improve.

Thank you to the MainWP team for working on finding a fix. :heart:

5 Likes

Thanks, @josklever. I’ve passed this idea to our development team.

Much appreciated @dcgavril and thanks for the kind words.

4 Likes

Almost every day I still have 1 or 2 sites that disconnect and can only be reconnected after deactivating and reactivating the MainWP Child plugin.

Is there any progress in the investigation for these events or more data that can be tested? Like settings in the database of the child site and/or dashboard site?

There are 2 separate issues. The initial one where all sites were disconnected and the incidental disconnects like I still experience. It’s totally random as far as I can see. I’ve seen some other posts here with this issue and it seems related to issues on the server of the child, but I can’t figure out why it would corrupt the connection and can’t be restored normally. I never had this before 4.5.0.1.

Hi @josklever

When you do have some sites disconnected, have you tried running our new tool to reset OpenSSL Key Pairi from the Settings > Tools page?

If you are referring to this discussion, we believe that this is unrelated, and based on our initial investigation this issue is related to Object Cache and we believe it is not something that was introduced recently.