Make WordPress Core

Opened 11 months ago

Closed 10 months ago

Last modified 10 months ago

#59320 closed defect (bug) (fixed)

Fatal error while processing failed plugin upgrade

Reported by: akihiroharai's profile akihiroharai Owned by: costdev's profile costdev
Milestone: 6.3.2 Priority: normal
Severity: minor Version: 6.3
Component: Upgrade/Install Keywords: has-patch commit fixed-major
Focuses: Cc:

Description

Fatal error occurs while processing a failed plugin update.

$ wp plugin update disable-comments
メンテナンスモードを有効化中...
https://downloads.wordpress.org/plugin/disable-comments.2.4.5.zip から更新をダウンロード中...
Using cached file '/var/web/.wp-cli/cache/plugin/disable-comments-2.4.5.zip'...
署名が見つからなかったため、disable-comments.2.4.5.zip の信頼性を確認できませんでした。
更新を展開しています…
最新のバージョンをインストールしています…
プラグインの古いバージョンを削除しています…
Warning: 古いプラグインを削除できませんでした。
プラグインの更新に失敗しました。
メンテナンスモードを無効にします…
+------------------+-------------+-------------+--------+
| name             | old_version | new_version | status |
+------------------+-------------+-------------+--------+
| disable-comments | 2.4.4       | 2.4.5       | Error  |
+------------------+-------------+-------------+--------+
Error: No plugins updated (1 failed).
PHP Fatal error:  Uncaught ArgumentCountError: 2 arguments are required, 1 given in /var/web/wp/wp-admin/includes/class-wp-upgrader.php:1209
Stack trace:
#0 /var/web/wp/wp-admin/includes/class-wp-upgrader.php(1209): sprintf('%s \xE3\x81\xAE\xE4\xB8\x80\xE6\x99\x82\xE3\x83\x90...')
#1 /var/web/wp/wp-includes/class-wp-hook.php(308): WP_Upgrader->delete_temp_backup()
#2 /var/web/wp/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(Object(WP_Error), Array)
#3 /var/web/wp/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#4 /var/web/wp/wp-includes/load.php(1252): do_action('shutdown')
#5 [internal function]: shutdown_action_hook()
#6 {main}
  thrown in /var/web/wp/wp-admin/includes/class-wp-upgrader.php on line 1209
Fatal error: Uncaught ArgumentCountError: 2 arguments are required, 1 given in /var/web/wp/wp-admin/includes/class-wp-upgrader.php:1209
Stack trace:
#0 /var/web/wp/wp-admin/includes/class-wp-upgrader.php(1209): sprintf('%s \xE3\x81\xAE\xE4\xB8\x80\xE6\x99\x82\xE3\x83\x90...')
#1 /var/web/wp/wp-includes/class-wp-hook.php(308): WP_Upgrader->delete_temp_backup()
#2 /var/web/wp/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(Object(WP_Error), Array)
#3 /var/web/wp/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#4 /var/web/wp/wp-includes/load.php(1252): do_action('shutdown')
#5 [internal function]: shutdown_action_hook()
#6 {main}
  thrown in /var/web/wp/wp-admin/includes/class-wp-upgrader.php on line 1209

Change History (8)

This ticket was mentioned in PR #5181 on WordPress/wordpress-develop by harai.


11 months ago
#1

  • Keywords has-patch added

Fix incorrect right paren for sprintf().

Trac ticket: https://core.trac.wordpress.org/ticket/59320

#2 @afragen
11 months ago

This looks correct. PR seems appropriate. Good catch @akihiroharai

#3 @costdev
11 months ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 6.3.2
  • Owner set to costdev
  • Status changed from new to assigned
  • Version changed from trunk to 6.3

Hi @akihiroharai, welcome to Trac!

Nice catch!

This was introduced in [55720] (WordPress 6.3). Updating the Version property on the ticket.

The PR looks good to me. Assigning to myself and adding commit.

#4 @costdev
11 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 56550:

Upgrade/Install: Fix broken sprintf() call when deleting a backup.

In WP_Upgrader::delete_temp_backup(), a malformed sprintf() call did not pass the value, triggering a Warning in PHP 7 and a Fatal Error in PHP 8.

This fixes the malformed sprintf() call by correctly passing the value.

Follow-up to [55720].

Props akihiroharai, afragen.
Fixes #59320.

@costdev commented on PR #5181:


11 months ago
#5

Thanks for the PR! Merged in r56550.

#6 @costdev
11 months ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backport to the 6.3 branch.

#7 @costdev
10 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 56582:

Upgrade/Install: Fix broken sprintf() call when deleting a backup.

In WP_Upgrader::delete_temp_backup(), a malformed sprintf() call did not pass the value, triggering a Warning in PHP 7 and a Fatal Error in PHP 8.

This fixes the malformed sprintf() call by correctly passing the value.

Follow-up to [55720].

Props akihiroharai, afragen.
Merges [56550] to the 6.3 branch.
Fixes #59320.

@costdev commented on PR #5181:


10 months ago
#8

Backported to the 6.3 branch in r56582.

Note: See TracTickets for help on using tickets.