PCLZIP_ERR_BAD_FORMAT (-10) when trying to upgrade from 1.7.3 to 2.x

As CP 1.7.3 does neither get automatic updates nor offers a manual upgrade option to CP 2.x, today I re-installed Switch To ClassicPress in order to get the necessary upgrades done. I chose a blog that I don’t actually use anymore, but which is still online. I want to be sure that it works before I upgrade my main blog.

But when I tried to switch to CP 2.2, I got this error message:
Das Paket konnte nicht installiert werden. (= The package could not be installed.): PCLZIP_ERR_BAD_FORMAT (-10) : Invalid archive structure

I thought that CP 2.2 might be too far ahead of CP 1.7.3, so I tried CP 2.1.1, but with the same outcome.

After some research I found a hint that libzip might be missing or outdated in PHP. I installed the package php8.2-zip and tried again, but no change.

System: Devuan GNU/Linux 4 daedalus
Linux 6.1.0-28-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.119-1 (2024-11-22) x86_64 GNU/Linux
PHP 8.2.24 (cli) (built: Sep 27 2024 04:16:10) (NTS)
nginx version: nginx/1.22.1

PCL Zip is the historic fallback that WP (and, therefore, CP) uses when it doesn’t detect the PHP Zip library. I doubt it’s been subject to much development for years, so that’s probably why it’s failing. The question is why you’re still falling back to it rather than using the PHP Zip module you’ve added.

Have you tried stopping and re-starting the server or trying PHP 8.3 instead?

EDIT: The other thing to check for is that you have enough space on the disk for the update to happen.

Restarted php8.2-fpm: no change.
Restarted nginx: no change.
Anything else? The whole system? :thinking:

Hard disk space: 2.3 TB of free space on that partition should be enough, right? :wink:

I’d really like to avoid software versions that are not in the distributions’s repo (aside from web applications) because of the additional work with updates.

SOLVED! php8.2-curl was missing. I got the idea after I re-read my older threads here in this forum and found this: Update to 1.1.4 failed - #2 by james – older version, same problem.

So I had recognized before that major distri upgrades don’t automatically update all the PHP stuff from the former version. This happened here some time ago when I upgraded from Devuan 3 to Devuan 4. I had to install all the PHP stuff anew, as Devuan 3 came with PHP 7.4, and Devuan 4 with 8.2. I was pretty sure that I got all the modules that I had installed before, but well …

1 Like

Thanks for coming back with the solution, in case it helps others!

@timkaye,

Does CP not have a dependencies check feature built-in?

Perhaps we need a script that can be run against a system to make sure it’s ready for an upgrade like a “pre-flight” or “compatibility” checker…

Yes, it does, but evidently it doesn’t check for this module.

@timkaye,

Do we have a “dry-run” mode?

This might prevent future issues by “simulating” an install, highlight errors or missing modules, allow a user to fix their system, then install :slight_smile:

1 Like

How would it help? It would just result in a different statement when unsuccessful.

@timkaye,

The idea would be to go through all the basic steps of an install, when it comes across what would normally cause an error, it reports back what is missing or incorrectly set.

I believe the “Health Check” feature in CP does something similar to this, but that’s after an initial successful install.

With a “pre-flight” or “simulated” install, errors that prevent a successful install could be caught before actually doing the real install. Basically checking for missing “modules” or incompatible software…

Ex.

  1. Is a supported version of PHP installed
  2. Are are the PHP modules available that are required
  3. Etc.

*** This is a report from another app, but illustrates a report that could be generated by CP before an install is committed ***

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.