Issues when upgrading to Nextcloud 21 using Docker and PostgreSQL


When I try to changed my docker image from nextcloud:20-apache to nextcloud:21-apache, I ran into issues with memory first.
Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 438272 bytes) in /var/www/html/3rdparty/composer/autoload_real.php on line 37

I got around that problem by passing php -d memory_limit=1G occ upgrade.

After that, it fails with
Unknown database type name requested, Doctrine\DBAL\Platforms\PostgreSQL100Platform may not support it.

I am not sure how to fix this, can someone please help me out with this one? I am running PostgreSQL 12 and it was working fine with NC20.

Which Postgres image are you using? If you are using latest it might be the issue. Because latest is now Postgres 13 and not compatible with Postgres 12 databases. I ran in to this issue but not sure if this is the case for you, if so just use the image 12 or 12-alpine.

Nextcloud works fine with Postgresql 13.2.

Did not said otherwise, but if you started with Postgresql 12 upgrading to 13 is not automatic and throw an error in the style of “database created with an older version on Postgresql”.

It was automatic for me.

Maybe it depends on how you have it setup. I am not familiar with running Postgresql in a docker.

Maybe your distro package upgrade takes care of migrating the databases.

I am using PostgreSQL 12. It was working perfectly fine with NC20, after which the only change that I have made is to change NC20 to NC21 image.

The auto migration that happens in the entrypoint of the NC21 container or when I run occ upgrade is when I see the error.

If I delete the version.php file and revert back to the NC20 image, NC loads up fine. So, I don’t think it is a database issue.

Maybe posting your docker-compose.yml could provide more information.

you can add your own php.ini to /usr/local/etc/php/php.ini inside the container with --volume to set the memory limit.

p.s.: postgres container update ->

p.p.s.: i got automatic updated from php-fpm nextcloud 20 to 21 using postgres 10. without issues.