XF 2.2 Upgrading to 2.2.8 Patch 1 failed due to ArgumentCountError in Statement.php

DeltaHF

Well-known member
Using the automatic upgrade process failed with the following error.

Screen Shot 2021-12-29 at 1.59.58 AM.webp

The site has been knocked offline because this has stalled the upgrade process. What should I do?
 
I used the "one-click upgrade" when the upgrade was triggered. I have completed one-click upgrades successfully before.

The site was stuck in maintenance mode and was not usable. I have fixed the issue for now by "downgrading" to 2.2.8 via manually uploading the files.

I'm not sure the upgrade actually completed as it's still showing 2.2.8 in the Admin panel, and the "file health check" shows everything is healthy. My staging environment completed the one-click upgrade without any issues.
 
I am still unable to upgrade from 2.2.8 to 2.2.8 Patch 1.

I have tried:
  • Disabling all add-ons before the upgrade.
  • One-click upgrade.
  • Manually uploading the new files.
  • CLI upgrade.
Nothing works. The CLI upgrade shows a similar error, though without the stack trace:

Screen Shot 2022-01-04 at 1.32.26 AM.webp

There is nothing in the PHP-FPM error logs.

I have used XenForo for 9 years and have successfully completed both types of upgrades many times before. I am running PHP 8.0.
 
This is highly confusing because, to the best of our knowledge, no one else has run into this and the code is clear:

PHP:
$this->executeUpgradeQuery(
   'UPDATE xf_image_proxy
      SET pruned = ?,
         file_hash = ?
      WHERE fetch_date > ?',
   [1, '', $upgradeDate]
);

There are three ? placeholders in the query and three values passed in (1 and empty string and $upgradeDate).

This error would happen if there were more or fewer ? placeholders than values passed in.

Is there anything particularly notable about your MySQL set up? Which version of MySQL are you using? (Or MariaDB etc version)?

This may be something we need to have a closer look at, so please feel free to submit a ticket, but honestly I don't really know what I'll be looking for yet!
 
Yeah, the error does not make any sense. I checked the query that defines $upgradeDate and it does return the expected date:

Code:
> select completion_date from xf_upgrade_log where version_id = '2020870';
+-----------------+
| completion_date |
+-----------------+
|      1639294069 |
+-----------------+
1 row in set (0.000 sec)

I'm running MariaDB version 10.4.22 in a standard configuration on a dedicated server configured with @eva2000's Centminmod. PHP version 8.0.13.

I will do more of my own debugging with the code to see if I can provide any additional information before troubling you with a ticket. Something feels "off" here.
 
Back
Top Bottom