Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.41k stars 1.99k forks source link

Unable to update unmanaged themes on Atomic Sites #90131

Open arinoch opened 6 months ago

arinoch commented 6 months ago

Quick summary

Users on atomic sites running Twenty Twenty-Four are not able to update the theme.

Steps to reproduce

  1. On a site with the Creator plan or higher, if not active already, activate hosting features.
  2. If Twenty Twenty-Four is installed, confirm whether it's managed or unmanaved. If managed, remove it.
  3. Install from the WordPress.org community the unmanaged Twenty Twenty-Four theme.
  4. Optionally, activate that theme.
  5. Your site will be running 1.0 of this theme. Try to update to 1.1.

What you expected to happen

The update should install without issue.

What actually happened

In the user interface, updating this theme tthrows an error (8061986-zd-a8c). In CLI, the update reports success but 1.0 is still installed when the data is pulled.

Impact

Most (> 50%)

Available workarounds?

No but the platform is still usable

Platform (Simple and/or Atomic)

Atomic

Logs or notes

I tested the update process on an internal testing site. In the UI for me, version 1.1 of this theme did not show (it did for the user and an HC). In CLI, the update command reported success but actually failed on both my site and the user's.

github-actions[bot] commented 6 months ago

Support References

This comment is automatically generated. Please do not edit it.

rickmgithub commented 6 months ago

📌 ACTIONS

Message to author

Thanks so much for the report @arinoch I tried installing the .org version from here - https://en-au.wordpress.org/themes/twentytwentyfour/ But I got an error just trying to install that. Can I check those were the correct steps to follow? Do let us know and we continue to look at this.

arinoch commented 6 months ago

Hi @rickmgithub! Those are the correct instructions. I did not get an error on the install, but the update didn't apply in CLI and wasn't showing in Calypso. The user got an error when updating (see the ticket), but had it installed already.

The location in theory shouldn't make a difference, but I successfully installed it from here. https://en-ca.wordpress.org/themes/twentytwentyfour/

arinoch commented 6 months ago

@rickmgithub, as a workaround try installing the theme through wp-admin/themes.php instead? I don't get the error when I do that.

pauljacobson commented 6 months ago

I tried to update the theme in CLI and while I also didn't see any errors, the theme didn't update:

CleanShot 2024-05-05 at 14 39 18@2x

I have the same theme installed on a site with a WordPress.com Creator plan and no other, external plugins (this is a "clean" test site).

https://github.com/Automattic/wp-calypso/assets/2912202/570303ce-e7a2-4a7e-894f-960ff45064cd

I tried to run the update through Activity Log and experienced pretty much the same thing:

I cleared my test site's cache and ran the update again. Again, it seemed to run successfully even though the theme was not updated.

filipanoscampos commented 6 months ago

Adding that, if I try to set a specific version in CLI I get:

Can't find the requested plugin/theme's version 1.1 in the WordPress.org plugin/theme repository (A valid URL was not provided.).

lizswafford commented 6 months ago

I downloaded the theme from the WPORG, it's v. 1.1. On my test site I removed the twentytwentyfour theme, then forced installed the new version from the media library using CLI. I get the error message "Warning: Download failed. "Forbidden"" CLI shows version 1.0 and update available for 1.1. But, it's not possible to update.

upwardmomentum84 commented 6 months ago

I was able to get this updated on a test site by running these commands via SSH:

upwardmomentum84 commented 6 months ago

In further testing, I'm not able to update twentytwentythree and pendant on my test site using wp theme update so I'm not sure that TT4 is the only one affected. It does the same thing where it says it successfully updated but the theme is not updated.

I also see this error when using wp theme install but it seems the theme is installed anyway (tested with only required plugins activated) :


Installing the theme...
Theme installed successfully.
Fatal error: Uncaught InvalidArgumentException: Unsupported argument type passed to WP_CLI::error_to_string(): 'object' in phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/class-wp-cli.php:1097
Stack trace:
#0 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/class-wp-cli.php(879): WP_CLI::error_to_string(Object(WP_Error))
#1 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/UpgraderSkin.php(39): WP_CLI::warning(Object(WP_Error))
#2 /wordpress/core/6.5.3/wp-admin/includes/class-wp-upgrader.php(854): WP_CLI\UpgraderSkin->error(Object(WP_Error))
#3 /wordpress/core/6.5.3/wp-admin/includes/class-theme-upgrader.php(250): WP_Upgrader->run(Array)
#4 phar:///usr/local/bin/wp-cli/vendor/wp-cli/extension-command/src/Theme_Command.php(428): Theme_Upgrader->install('twentytwentythr...')
#5 phar:///usr/local/bin/wp-cli/vendor/wp-cli/extension-command/src/WP_CLI/CommandWithUpgrade.php(211): Theme_Command->install_from_repo('twentytwentythr...', Array)
#6 phar:///usr/local/bin/wp-cli/vendor/wp-cli/extension-command/src/Theme_Command.php(496): WP_CLI\CommandWithUpgrade->install(Array, Array)
#7 [internal function]: Theme_Command->install(Array, Array)
#8 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func(Array, Array, Array)
#9 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}(Array, Array)
#10 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(497): call_user_func(Object(Closure), Array, Array)
#11 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(441): WP_CLI\Dispatcher\Subcommand->invoke(Array, Array, Array)
#12 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(464): WP_CLI\Runner->run_command(Array, Array)
#13 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1295): WP_CLI\Runner->run_command_and_exit()
#14 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#15 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#16 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#17 phar:///usr/local/bin/wp-cli/php/boot-phar.php(20): include('phar:///usr/loc...')
#18 /usr/local/bin/wp-cli(4): include('phar:///usr/loc...')
#19 {main}
  thrown in phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/class-wp-cli.php on line 1097
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.```
liviopv commented 6 months ago

📌 REPRODUCTION RESULTS

📌 FINDINGS/SCREENSHOTS/VIDEO

  1. Accessed CLI
  2. Ran wpcomsh theme use-unmanaged twentytwentyfour
  3. It returned:
Error: There was an error installing the theme
Fatal error: Uncaught InvalidArgumentException: Unsupported argument type passed to WP_CLI::error_to_string(): 'object' in phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/class-wp-cli.php:1097
Stack trace:
#0 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/class-wp-cli.php(879): WP_CLI::error_to_string(Object(WP_Error))
#1 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/UpgraderSkin.php(39): WP_CLI::warning(Object(WP_Error))
#2 /wordpress/core/6.5.3/wp-admin/includes/class-wp-upgrader.php(854): WP_CLI\UpgraderSkin->error(Object(WP_Error))
#3 /wordpress/core/6.5.3/wp-admin/includes/class-theme-upgrader.php(250): WP_Upgrader->run(Array)
#4 phar:///usr/local/bin/wp-cli/vendor/wp-cli/extension-command/src/Theme_Command.php(428): Theme_Upgrader->install('twentytwentyfou...')
#5 phar:///usr/local/bin/wp-cli/vendor/wp-cli/extension-command/src/WP_CLI/CommandWithUpgrade.php(211): Theme_Command->install_from_repo('twentytwentyfou...', Array)
#6 phar:///usr/local/bin/wp-cli/vendor/wp-cli/extension-command/src/Theme_Command.php(496): WP_CLI\CommandWithUpgrade->install(Array, Array)
#7 [internal function]: Theme_Command->install(Array, Array)
#8 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func(Array, Array, Array)
#9 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}(Array, Array)
#10 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(497): call_user_func(Object(Closure), Array, Array)
#11 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(441): WP_CLI\Dispatcher\Subcommand->invoke(Array, Array, Array)
#12 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(464): WP_CLI\Runner->run_command(Array, Array)
#13 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1295): WP_CLI\Runner->run_command_and_exit()
#14 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#15 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#16 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#17 phar:///usr/local/bin/wp-cli/php/boot-phar.php(20): include('phar:///usr/loc...')
#18 /usr/local/bin/wp-cli(4): include('phar:///usr/loc...')
#19 {main}
  thrown in phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/class-wp-cli.php on line 1097
  1. Despite the error, the symlink was removed and version 1.0 was installed:

CleanShot 2024-05-10 at 13 59 00@2x

  1. Despite the successful message after running theme update twentytwentyfour, the theme was not updated

CleanShot 2024-05-10 at 14 01 23@2x

  1. Tried to updating using URL, and it failed like Brandon mentioned above
  2. Tried the same steps with Pendant, and it failed as well

📌 ACTIONS

📌 Message to Author @arinoch @filipanoscampos @lizswafford @upwardmomentum84 @pauljacobson is there a good reason why the user wants to use the unmanaged version of TT4? If not, we can solve this user's "problem" by adding the symlink again https://github.com/Automattic/wp-calypso/commit/80619867b2997c5a93aa059e8bf6b8b9e57dcdfd

upwardmomentum84 commented 5 months ago

From what I understand from the user's request it sounds like they were seeing a notice that an update was available in Jetpack > Activity Log and wanted to make sure everything was up-to-date. When I look at my test site, I see this as well:

CleanShot 2024-05-11 at 07 43 17