Skip to content

wp plugin update --all --minor generates error wp plugin update --all works fine. #292

@planetahuevo

Description

@planetahuevo

Bug Report

Describe the current, buggy behavior

When I run
wp plugin update --all --minor
or
wp plugin update --all --patch
I get an error.
Fatal error: Uncaught UnexpectedValueException: Invalid version string "3.2.0-dev1" in phar:///usr/local/bin/wp/vendor/composer/semver/src/VersionParser.php:185
When running without minor, it works fine.
And then it runs with minor just fine.
I think the problem is that one of the plugins has an invalid version string, but that blocks the whole update.

I was expecting it to give me an error on one plugin but the whole thing stops.

This is the full error

Fatal error: Uncaught UnexpectedValueException: Invalid version string "3.2.0-dev1" in phar:///usr/local/bin/wp/vendor/composer/semver/src/VersionParser.php:185
Stack trace:
#0 phar:///usr/local/bin/wp/vendor/composer/semver/src/Semver.php(39): Composer\Semver\VersionParser->normalize('3.2.0-dev1')
#1 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/utils.php(931): Composer\Semver\Semver::satisfies('3.2.0-dev1', '3.1.x')
#2 [...].wp-cli/packages/vendor/wp-cli/extension-command/src/WP_CLI/CommandWithUpgrade.php(593): WP_CLI\Utils\get_named_sem_ver('3.2.0-dev1', '3.1.4')
#3 [...].wp-cli/packages/vendor/wp-cli/extension-command/src/WP_CLI/CommandWithUpgrade.php(343): WP_CLI\CommandWithUpgrade->get_minor_or_patch_updates(Array, 'minor')
#4 [...].wp-cli/packages/vendor/wp-cli/extension-command/src/Plugin_Command.php(640): WP_CLI\CommandWithUpgrade->update_many(Array, Array)
#5 [internal function]: Plugin_Command->update(Array, Array)
#6 phar:///usr/local/bin/wp/vendor/wp-cli/wp- in phar:///usr/local/bin/wp/vendor/composer/semver/src/VersionParser.php on line 185
OS:     Linux 4.15.0-147-generic #151-Ubuntu SMP Fri Jun 18 19:21:19 UTC 2021 x86_64
Shell:  /bin/bash
PHP binary:     /usr/bin/php7.3
PHP version:    7.3.21-1+ubuntu18.04.1+deb.sury.org+1
php.ini used:   /etc/php/7.3/cli/php.ini
MySQL binary:   /usr/bin/mysql
MySQL version:  mysql  Ver 8.0.20-11 for Linux on x86_64 (Percona Server (GPL), Release '11', Revision '5b5a5d2')
WP-CLI version: 2.5.0

This is the list of plugins that had updates with their version for this particular install before the update.

+------------------------------------------------------+-----------+----------------+
| name                                                 | update    | update_version |
+------------------------------------------------------+-----------+----------------+
| woo-order-export-lite                                | available | 3.1.9          |
| astra-addon                                          | available | 3.5.4          |
| cartflows                                            | available | 1.6.15         |
| cartflows-pro                                        | available | 1.6.13         |
| woocommerce-direct-checkout                          | available | 2.4.7          |
| disable-dashboard-for-woocommerce                    | available | 2.4.10         |
| elementor                                            | available | 3.3.0          |
| mainwp-child                                         | available | 4.1.7          |
| product-open-pricing-name-your-price-for-woocommerce | available | 1.6.0          |
| wp-simple-firewall                                   | available | 11.4.4         |
| shortpixel-image-optimiser                           | available | 4.22.2         |
| woocommerce                                          | available | 5.1.1          |
| woocommerce-gateway-stripe                           | available | 5.2.3          |
| wp-mail-smtp                                         | available | 2.9.0          |
+------------------------------------------------------+-----------+----------------+

From that list, I think that the one messing with the tags is Elementor:
https://plugins.svn.wordpress.org/elementor/tags/

As I have version Versión 3.1.4 and then the next ones are:

3.1.4/
3.2.0/
3.2.0-beta1/
3.2.0-beta2/
3.2.0-beta3/
3.2.0-beta4/
3.2.0-dev1/
3.2.0-dev2/
3.2.0-dev3/
3.2.0-dev4/
3.2.0-dev5/
3.2.0-dev6/
3.2.0-dev7/
3.2.0-dev8/
3.2.1/
3.2.2/
3.2.3/
3.2.4/
3.2.5/
3.3.0/

So clearly something going on with that one.
I run
wp plugin update elementor --version 3.3.0

And then the command worked as expected with no issues.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions