SOLVED cpaddons WP update hangs on plugin error

jndawson

Well-Known Member
Aug 27, 2014
303
32
78
Western US
cPanel Access Level
DataCenter Provider
We have a customer trying to update his newly installed via cpaddons wordpress using the cpaddons update button and is getting the following error:
Code:
The system could not copy the “/home/username/public_html/wp-content/plugins/akismet/views/strict.php” folder to working folder “./wp-content/plugins/akismet/views/strict.php”.
Error: The system could not prepare the working directory:
That's the entire error message, and we also see it when trying the update via WHM. The odd thing is that the file 'strict.php' doesn't exist, permissions are all correct for directories (755) and files (644).

In the /usr/local/cpanel/logs/error_log:
Code:
Cpanel::FileUtils::Copy::safecopy("/home/username/public_html/wp-content/plugins/akismet/views/st"..., "./wp-content/plugins/akismet/views/strict.php") called at /usr/local/cpanel/Cpanel/cPAddons/Obj.pm line 874
Which is:
Code:
        $copy_to_working_folder_ok = Cpanel::FileUtils::Copy::safecopy( $source_directory, $update_directory );
Any ideas how to fix this?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,216
463
The system could not copy the “/home/username/public_html/wp-content/plugins/akismet/views/strict.php” folder to working folder “./wp-content/plugins/akismet/views/strict.php”. Error: The system could not prepare the working directory:
Hello,

Could you verify which version of cPanel is installed on the system? EX:

Code:
cat /usr/local/cpanel/version
Also, can you verify the customer made no changes to the WordPress files after initially installing it via cPanel?

Thank you.
 

jndawson

Well-Known Member
Aug 27, 2014
303
32
78
Western US
cPanel Access Level
DataCenter Provider
Hello,

Could you verify which version of cPanel is installed on the system? EX:

Code:
cat /usr/local/cpanel/version
64.0.12
Also, can you verify the customer made no changes to the WordPress files after initially installing it via cPanel?

Thank you.
We're waiting for a response from the customer for confirmation, but from our ticket, he indicates he's not made any changes to WP files.
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,216
463

jndawson

Well-Known Member
Aug 27, 2014
303
32
78
Western US
cPanel Access Level
DataCenter Provider
Hello,

Could you verify if this installation stems from the new WordPress cPAddon offered in cPanel version 64, or the legacy WordPress cPAddon? You can read more about the new one at:

64 Release Notes - Version 64 Documentation - cPanel Documentation

Thank you.
That might could be it. The install is identified with '(legacy)'.

What's the solution? Your release notes aren't clear:
cPAddons - WordPress
In cPanel & WHM version 64, we updated the cPAddons feature to use RPMs to install WordPress®. When you install WordPress through cPAddons with the RPM, it allows you to update WordPress through its own administrative interface. WHM's Install cPAddons Site Software interface (Home >> cPanel >> Install cPAddons Site Software) discovers, installs, and uninstalls RPM-based packages with the yum utility. The cPanel, Inc.-managed RPM contains an unaltered WordPress installer package obtained from wordpress.org.

Note:

You cannot use the cPAddons interface to upgrade your legacy Wordpress instances to the RPM-based Wordpress installations. However, we plan to add that ability in the future.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,216
463
Hello,

Since it's a legacy WordPress cPAddon installation, the error message suggests the user modified the core WordPress files and thus the update is failing. If you can confirm the core files were not modified, feel free to open a support ticket using the link in my signature so we can take a closer look.

Thanks!
 

jndawson

Well-Known Member
Aug 27, 2014
303
32
78
Western US
cPanel Access Level
DataCenter Provider
UPDATE:
We opened a ticket. There were several files missing due to th ecustomer removing stuff he thought he didn't need, and after several false starts at restoring the files, the following steps to re-install, then upgrade were taken:

Code:
/home/username/public_html # curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
 
/home/username/public_html # chmod +x wp-cli.phar

/home/username/public_html # php wp-cli.phar core download --version=4.7.2 --force
The update to 4.7.3 was then properly completed using the cpaddons upgrade link.

Hope that helps somebody.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,216
463
Hello,

I'm happy to see the issue is now solved. Thank you for updating us with the outcome.
 

jndawson

Well-Known Member
Aug 27, 2014
303
32
78
Western US
cPanel Access Level
DataCenter Provider
Hello,

I'm happy to see the issue is now solved. Thank you for updating us with the outcome.
Here we are a couple of months later, and another customer with the exact same issue with Akismet plugin using a cpAddon WP legacy install. We tried the above fix, but got the same error.

I see this issue crops up a lot. Has anybody discovered a better fix?
 

jndawson

Well-Known Member
Aug 27, 2014
303
32
78
Western US
cPanel Access Level
DataCenter Provider
We decided to try to run the upgrade after we discovered that creating the missing file moved the update along. We touched the following missing files:

Code:
public_html/wp-content/plugins/akismet/views/strict.php
public_html/wp-content/plugins/hello.php
public_html/wp-content/themes/twentyfifteen/genericons/example.html
Worked great until we got stalled by the big error:
Code:
Warning: The plugin “cPanel & WHM® Site Software” could not be activated
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.2.1_4.2.2/diff” patch and returned the following error code: 1
Error: You modified this cPAddon or the upgrade test failed. You cannot update this cPAddon via this interface.

To force the upgrade, type the following in to the form below:

Error: You modified this cPAddon or the upgrade test failed. You cannot update this cPaddon via this interface.

For technical reasons, you can only attempt a forced upgrade via cPanel when logged in as the user with the user’s password.
Logged into user's cpanel, ran the forced upgrade:
Code:
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.2.1_4.2.2/diff” patch and returned the following error code: 1


Starting forced upgrade from “4.2.1” to “4.2.2” …
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.2.1_4.2.2/diff” patch and returned the following error code: 1


Starting forced upgrade from “4.2.2” to “4.2.3” …


Starting forced upgrade from “4.2.3” to “4.2.4” …


Starting forced upgrade from “4.2.4” to “4.2.4.cp1” …


Starting forced upgrade from “4.2.4.cp1” to “4.2.4.cp2” …
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.2.4.cp2_4.3/diff” patch and returned the following error code: 1


Starting forced upgrade from “4.2.4.cp2” to “4.3” …
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.2.4.cp2_4.3/diff” patch and returned the following error code: 1
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.3_4.3.1/diff” patch and returned the following error code: 1


Starting forced upgrade from “4.3” to “4.3.1” …
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.3_4.3.1/diff” patch and returned the following error code: 1
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.3.1_4.4/diff” patch and returned the following error code: 1


Starting forced upgrade from “4.3.1” to “4.4” …
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.3.1_4.4/diff” patch and returned the following error code: 1


The system could not copy the “/home/username/public_html/wp-content/plugins/akismet/views/strict.php” folder to working folder “./wp-content/plugins/akismet/views/strict.php”.
Error: The system could not prepare the working directory: No such file or directory
On the upside, it looks like we got to WP version 4.4 before completely failing.

More to come.
 

jndawson

Well-Known Member
Aug 27, 2014
303
32
78
Western US
cPanel Access Level
DataCenter Provider
Tried touching strict.php again:
Code:
Site Software
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.4_4.4.1/diff” patch and returned the following error code: 1


Starting forced upgrade from “4.4” to “4.4.1” …
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.4_4.4.1/diff” patch and returned the following error code: 1


Starting forced upgrade from “4.4.1” to “4.4.2” …
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.4.2_4.5/diff” patch and returned the following error code: 1


Starting forced upgrade from “4.4.2” to “4.5” …
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.4.2_4.5/diff” patch and returned the following error code: 1


Starting forced upgrade from “4.5” to “4.5.1” …


Starting forced upgrade from “4.5.1” to “4.5.2” …
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.5.2_4.5.3/diff” patch and returned the following error code: 1


Starting forced upgrade from “4.5.2” to “4.5.3” …
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.5.2_4.5.3/diff” patch and returned the following error code: 1


Starting forced upgrade from “4.5.3” to “4.6” …
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.6_4.6.1/diff” patch and returned the following error code: 1


Starting forced upgrade from “4.6” to “4.6.1” …
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.6_4.6.1/diff” patch and returned the following error code: 1


Starting forced upgrade from “4.6.1” to “4.7” …
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.7_4.7.1/diff” patch and returned the following error code: 1


Starting forced upgrade from “4.7” to “4.7.1” …
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.7_4.7.1/diff” patch and returned the following error code: 1


Starting forced upgrade from “4.7.1” to “4.7.2” …
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.7.2_4.7.3/diff” patch and returned the following error code: 1


Starting forced upgrade from “4.7.2” to “4.7.3” …
Error: The system could not apply the “/usr/local/cpanel/cpaddons/cPanel/Blogs/WordPress/upgrade/4.7.2_4.7.3/diff” patch and returned the following error code: 1
Warning: You attempted to force an upgrade on a modified cPAddon. The upgrade process completed but returned errors. The cPAddon may be non-functional.
The website appears to be working. We'll have the customer check for sure, but there do seem to be a whole lot of errors in that update scroll.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,216
463
Hello,

Upgrading WordPress through the cPAddon feature is not supported once the WordPress files are manually upgrade or altered. Generally, you'd have to setup a new WordPress installation through "cPanel >> Site Software" and migrate the WordPress installation that was altered to it using the instructions at:

Moving WordPress « WordPress Codex

Thank you.
 

jndawson

Well-Known Member
Aug 27, 2014
303
32
78
Western US
cPanel Access Level
DataCenter Provider
Hello,

Upgrading WordPress through the cPAddon feature is not supported once the WordPress files are manually upgrade or altered. Generally, you'd have to setup a new WordPress installation through "cPanel >> Site Software" and migrate the WordPress installation that was altered to it using the instructions at:

Moving WordPress « WordPress Codex

Thank you.
Just to clarify, the customer only removed a couple of files that cpaddon (apparently) looks for when upgrading, but there were no other updates attempted outside of the cpaddons feature. When the files were touched, the cpaddon upgrade function worked, more or less.

This was easier than trying to explain how he would need to remove all of his content, delete his legacy WP install, and then install the new cpaddon WP package along with whatever plugins and other templates he needs, and then reinstall his content.

The customer is happy - nothing broke.
 
  • Like
Reactions: cPanelMichael