You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suggest to catch errors from Composer\Semver\Semver::satisfies().
I suggest to output the plugin which actually failed. That would spare command-line run/bissecting time (The string psd-files is nowhere on the filesystem. Not even ~/.composer/cache).
Provide additional context/Screenshots
https://plugins.svn.wordpress.org/wp-maintenance-mode/tags/
Shows that a psd-files tags was added.
When wp-maintenance-mode is at the latest version already, it seems the psd-files tag is omitted.
But if not, then it triggers an error at /composer/semver/src/VersionParser.php:172 which is not caught.
PHP Fatal error: Uncaught UnexpectedValueException: Invalid version string "psd-files" in phar:///usr/local/bin/wp/vendor/composer/semver/src/VersionParser.php:172
Stack trace:
#0 phar:///usr/local/bin/wp/vendor/composer/semver/src/Semver.php(39): Composer\Semver\VersionParser->normalize()
#1 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/utils.php(785): Composer\Semver\Semver::satisfies()
#2 phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/WP_CLI/CommandWithUpgrade.php(583): WP_CLI\Utils\get_named_sem_ver()
#3 phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/WP_CLI/CommandWithUpgrade.php(342): WP_CLI\CommandWithUpgrade->get_minor_or_patch_updates()
#4 phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php(640): WP_CLI\CommandWithUpgrade->update_many()
#5 [internal function]: Plugin_Command->update()
#6 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(98): call_user_func()
#7 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\ in phar:///usr/local/bin/wp/vendor/composer/semver/src/VersionParser.php on line 172
Fatal error: Uncaught UnexpectedValueException: Invalid version string "psd-files" in phar:///usr/local/bin/wp/vendor/composer/semver/src/VersionParser.php:172
Stack trace:
#0 phar:///usr/local/bin/wp/vendor/composer/semver/src/Semver.php(39): Composer\Semver\VersionParser->normalize()
#1 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/utils.php(785): Composer\Semver\Semver::satisfies()
#2 phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/WP_CLI/CommandWithUpgrade.php(583): WP_CLI\Utils\get_named_sem_ver()
#3 phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/WP_CLI/CommandWithUpgrade.php(342): WP_CLI\CommandWithUpgrade->get_minor_or_patch_updates()
#4 phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php(640): WP_CLI\CommandWithUpgrade->update_many()
#5 [internal function]: Plugin_Command->update()
#6 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(98): call_user_func()
#7 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\ in phar:///usr/local/bin/wp/vendor/composer/semver/src/VersionParser.php on line 172
Error: There has been a critical error on your website.Learn more about debugging in WordPress. There has been a critical error on your website
The text was updated successfully, but these errors were encountered:
I can't replicate this currently. It looks like the misformed tag was removed again, so I assume this also does create problems in other areas of the WP.org ecosystem.
Nevertheless, I agree that the code needs to be more robust to fail gracefully if unexpected data is fed to it.
Bug Report
Describe the current, buggy behavior
wp plugin update
fails badly if a repository provide unparsable tags.Describe how other contributors can replicate this bug
wp-maintenance-mode
2.2.x (It's important to be below the maximum release. 2.2.4 for example)wp @ae plugin update --patch wp-maintenance-mode
Uncaught UnexpectedValueException: Invalid version string "psd-files"
. (See below for the full stacktrace)Describe what you would expect as the correct outcome
Update (patch release) to work.
Let us know what environment you are running this on
(Using Bedrock)
Provide a possible solution
Composer\Semver\Semver::satisfies()
.psd-files
is nowhere on the filesystem. Not even~/.composer/cache
).Provide additional context/Screenshots
https://plugins.svn.wordpress.org/wp-maintenance-mode/tags/
Shows that a
psd-files
tags was added.When
wp-maintenance-mode
is at the latest version already, it seems thepsd-files
tag is omitted.But if not, then it triggers an error at
/composer/semver/src/VersionParser.php:172
which is not caught.The text was updated successfully, but these errors were encountered: