Cannot upgrade from NC 25 to 26, Docker Nextcloud thinks v25 > v26

Nextcloud version (eg, 20.0.5): 25.0.9.226.0.4.2
Operating system and version (eg, Ubuntu 20.04): Docker image: production-fpm (currently 26.0.4.2)
Apache or nginx version (eg, Apache 2.4.25): Docker image: nginx:mainline (currently 1.25.1)
PHP version (eg, 7.4): Nextcloud docker image: php:8.1-fpm-bullseyephp:8.2-fpm-bookworm

The issue you are facing:
When I pulled a new version of the production-fpm docker image, it will no longer start up. It errors out complaining…

nextcloud_1| Can't start Nextcloud because the version of the data (
nextcloud_1| Warning: PHP Startup: Unable to load dynamic library 'imap.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/imap.so (libc-client.so.2007e: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20220829/imap.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20220829/imap.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
nextcloud_1| 25.0.9.2) is higher than the docker image version (
nextcloud_1| Warning: PHP Startup: Unable to load dynamic library 'imap.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/imap.so (libc-client.so.2007e: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20220829/imap.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20220829/imap.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
nextcloud_1| 26.0.4.2) and downgrading is not supported. Are you sure you have pulled the newest image version?

So for some reason Nextcloud is thinking that 25.0.9.2 is a higher version number than 26.0.4.2. :thinking:

If I switch back to using the 25-fpm docker image, it starts up just fine with no such errors.

Turns out this was the same issue as here: Unable to load dynamic library 'imap.so' - #2 by jtr

And also here: Unable to load dynamic library ‘imap.so’ · Issue #2037 · nextcloud/docker · GitHub

I had to fix the Warning because the Version comparison code in entrypoint.sh actually included that warning text as part of the version string when trying to compare which one was newer.