Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade from 22.1.0-apache to 22.1.1-apache - PostgreSQL issues #1579

Closed
JoaoPPCastelo opened this issue Sep 4, 2021 · 13 comments
Closed

Upgrade from 22.1.0-apache to 22.1.1-apache - PostgreSQL issues #1579

JoaoPPCastelo opened this issue Sep 4, 2021 · 13 comments

Comments

@JoaoPPCastelo
Copy link

JoaoPPCastelo commented Sep 4, 2021

Hi everyone,

I recently upgraded my Nextcloud instance from 22.1.0-apache to 22.1.1-apache and now i'm getting errors related to PostgreSQL initialization. Even tried with a fresh install but same result :/

Steps to reproduce:

  1. Start Nextcloud with version 22.1.0-apache and PostgreSQL (if it helps, i'm adding my docker-compose file below, just change the directories and create the secrets). Let it start and check you can access the web portal.
  2. Edit the docker-compose file to use version 22.1.1-apache for Nextcloud.
  3. Run docker-compose up to recreate the Nextcloud container with the new version.

Server not started and this got this error on the logs :

nextcloud-app | Initializing finished
nextcloud-app | An unhandled exception has been thrown:
nextcloud-app | Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] timeout expired in /var/www/html/lib/private/DB/Connection.php:87
nextcloud-app | Stack trace:
nextcloud-app | #0 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1486): OC\DB\Connection->connect()
nextcloud-app | #1 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1014): Doctrine\DBAL\Connection->getWrappedConnection()
nextcloud-app | #2 /var/www/html/lib/private/DB/Connection.php(231): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM "...', Array, Array, NULL)
nextcloud-app | #3 /var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(210): OC\DB\Connection->executeQuery('SELECT * FROM "...', Array, Array)
nextcloud-app | #4 /var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\DBAL\Query\QueryBuilder->execute()
nextcloud-app | #5 /var/www/html/lib/private/AppConfig.php(344): OC\DB\QueryBuilder\QueryBuilder->execute()
nextcloud-app | #6 /var/www/html/lib/private/AppConfig.php(109): OC\AppConfig->loadConfigValues()
nextcloud-app | #7 /var/www/html/lib/private/AppConfig.php(300): OC\AppConfig->getApps()
nextcloud-app | #8 /var/www/html/lib/private/legacy/OC_App.php(961): OC\AppConfig->getValues(false, 'installed_versi...')
nextcloud-app | #9 /var/www/html/lib/private/Server.php(685): OC_App::getAppVersions()
nextcloud-app | #10 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(160): OC\Server->OC\{closure}(Object(OC\Server))
nextcloud-app | #11 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
nextcloud-app | #12 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(127): Pimple\Container->offsetGet('OC\\Memcache\\Fac...')
nextcloud-app | #13 /var/www/html/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OC\\Memcache\\Fac...', false)
nextcloud-app | #14 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OC\\Memcache\\Fac...')
nextcloud-app | #15 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(182): OC\AppFramework\Utility\SimpleContainer->get('OC\\Memcache\\Fac...')
nextcloud-app | #16 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(160): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
nextcloud-app | #17 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
nextcloud-app | #18 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(127): Pimple\Container->offsetGet('OCP\\ICacheFacto...')
nextcloud-app | #19 /var/www/html/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OCP\\ICacheFacto...', false)
nextcloud-app | #20 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OCP\\ICacheFacto...')
nextcloud-app | #21 /var/www/html/lib/private/Server.php(1050): OC\AppFramework\Utility\SimpleContainer->get('OCP\\ICacheFacto...')
nextcloud-app | #22 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(160): OC\Server->OC\{closure}(Object(OC\Server))
nextcloud-app | #23 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
nextcloud-app | #24 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(127): Pimple\Container->offsetGet('OCP\\Lock\\ILocki...')
nextcloud-app | #25 /var/www/html/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Lock\\ILocki...', false)
nextcloud-app | #26 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OCP\\Lock\\ILocki...')
nextcloud-app | #27 /var/www/html/lib/private/Server.php(2010): OC\AppFramework\Utility\SimpleContainer->get('OCP\\Lock\\ILocki...')
nextcloud-app | #28 /var/www/html/lib/private/Files/View.php(118): OC\Server->getLockingProvider()
nextcloud-app | #29 /var/www/html/lib/private/Server.php(433): OC\Files\View->__construct()
nextcloud-app | #30 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(160): OC\Server->OC\{closure}(Object(OC\Server))
nextcloud-app | #31 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
nextcloud-app | #32 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(127): Pimple\Container->offsetGet('OC\\Files\\Node\\H...')
nextcloud-app | #33 /var/www/html/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OC\\Files\\Node\\H...', false)
nextcloud-app | #34 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OC\\Files\\Node\\H...')
nextcloud-app | #35 /var/www/html/lib/private/Server.php(1373): OC\AppFramework\Utility\SimpleContainer->get('OC\\Files\\Node\\H...')
nextcloud-app | #36 /var/www/html/lib/base.php(594): OC\Server->boot()
nextcloud-app | #37 /var/www/html/lib/base.php(1083): OC::init()
nextcloud-app | #38 /var/www/html/console.php(48): require_once('/var/www/html/l...')
nextcloud-app | #39 /var/www/html/occ(11): require_once('/var/www/html/c...')
nextcloud-app | #40 {main}nextcloud-app | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.31.0.4. Set the 'ServerName' directive globally to suppress this message
nextcloud-app | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.31.0.4. Set the 'ServerName' directive globally to suppress this message
nextcloud-app | [Sun Jan 00 00:00:00.000000 1900] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.48 (Debian) PHP/8.0.10 configured -- resuming normal operations
nextcloud-app | [Sun Apr 28 05:29:33.'''(+- 1935] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND

Server configuration
Operating system (lsb_release -a):

  • Distributor ID: Raspbian
  • Description: Raspbian GNU/Linux 10 (buster)
  • Release: 10
  • Codename: buster
    Web server: Handled in the docker image (Apache)
    Database: PostgreSQL

Where did you install Nextcloud from: Docker with Docker-compose

version: '3.2'

services:
  db:
    image: postgres:13.4
    restart: always
    container_name: nextcloud-db
    volumes:
      - /mnt/ssd/db:/var/lib/postgresql/data
    environment:
      POSTGRES_DB_FILE: /run/secrets/postgres_db
      POSTGRES_USER_FILE: /run/secrets/postgres_user
      POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
    secrets:
      - postgres_db
      - postgres_password
      - postgres_user

  app:
    image: nextcloud:22.1.0-apache
    restart: always
    container_name: nextcloud-app
    ports:
      - 80:80
    volumes:
      - /mnt/ssd/nextcloud:/var/www/html
    environment:
      POSTGRES_HOST: nextcloud-db
      POSTGRES_DB_FILE: /run/secrets/postgres_db
      POSTGRES_USER_FILE: /run/secrets/postgres_user
      POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
      NEXTCLOUD_ADMIN_PASSWORD_FILE: /run/secrets/nextcloud_admin_password
      NEXTCLOUD_ADMIN_USER_FILE: /run/secrets/nextcloud_admin_user
      NEXTCLOUD_TRUSTED_DOMAINS: 10.0.0.* 
      REDIS_HOST: nextcloud-redis
    depends_on:
      - db
      - redis
    secrets:
      - nextcloud_admin_password
      - nextcloud_admin_user
      - postgres_db
      - postgres_password
      - postgres_user

  redis:
    image: arm32v7/redis
    restart: always
    container_name: nextcloud-redis

secrets:
  nextcloud_admin_password:
    file: /opt/nextcloud/secrets/nextcloud_admin_password # put admin password to this file
  nextcloud_admin_user:
    file: /opt/nextcloud/secrets/nextcloud_admin_user # put admin username to this file
  postgres_db:
    file: /opt/nextcloud/secrets/postgres_db # put postgresql db name to this file
  postgres_password:
    file: /opt/nextcloud/secrets/postgres_password # put postgresql password to this file
  postgres_user:
    file: /opt/nextcloud/secrets/postgres_user # put postgresql username to this file

Are you using external storage, if yes which one: Yes (ssd mounted to the RaspberryPi)
Are you using encryption: No
Are you using an external user-backend, if yes which one: No

Don't know if it helps, but here are the Docker Image IDs (in case new versions are pushed):

docker images | grep -E "nextcloud|postgres"
postgres                                   13.4            95cc60d09644   10 hours ago   266MB
nextcloud                                  22.1.1-apache   8f3e0cc72ede   4 days ago     808MB
nextcloud                                  latest          8f3e0cc72ede   4 days ago     808MB
nextcloud                                  22.1.0-apache   f4f8e743b282   8 days ago     766MB
postgres                                   latest          e99cab8d5d80   2 weeks ago    266MB

I checked the GitHub actions and there are some failing workflows even form version 22.1.1-apache. Don't know if that's related.
Thanks in advance for your help !

@ghost
Copy link

ghost commented Sep 12, 2021

Same here. Can't get it run with Postgres on a Pi4B.

@nordcomputer
Copy link

I have the same issue - after upgrading via docker-compose pull and docker-compose up -d.
I was able to upgrade via terminal (occ command) but I am not able to access my installation.

@Narsskrarc
Copy link

Narsskrarc commented Sep 14, 2021

Same here (with Postgresql 11.13). Tried to restore my backup of the database and the html folder, but same error when restarting the container.
Nextcloud is down at the moment; every attempt to access the site results in a 500 Internal Server Error.

@ghost
Copy link

ghost commented Sep 14, 2021

i am using docker-compose to create my containers. If i use for example "nextcloud:21.0.2-apache" image, I can access my fresh installation. So it's not a Postgres issue I think.

I tested also a fresh install with SQLite which didn't work too.

@nordcomputer
Copy link

nordcomputer commented Sep 14, 2021

It seems to me, that the latest apache2 image is broken then...

@ghost
Copy link

ghost commented Sep 14, 2021

The fpm image is broken too. Seems to be related to the arm image because on my x64 Maschine everything works fine.

@nordcomputer
Copy link

just to be clear - you tested a brand new installation with 21.0.2 and not the "broken" updated one? @BorussiaPlayer17

@ghost
Copy link

ghost commented Sep 14, 2021

Yes. Because you get an error if you want to downgrade to an older version. Didn’t wanted to figure out if you can manually downgrade the DB.

It looks like every 22.1.0 version works on arm.

@ghost
Copy link

ghost commented Sep 19, 2021

Don‘t know what happened, but now a new fresh install works fine with the latest image.

@ghost
Copy link

ghost commented Sep 20, 2021

Now i updated my old production system and it's working too. Don't know what was updated, but it's working now on my Pi4. Latest image with apache and latest postgres.

@nordcomputer
Copy link

I tried to start a fresh instance, but without luck. I am not able to install a new instance, as I am getting a "time" - error, that seems to be related to #1589 . So I am not able to start a new instance and restore a backup.

@nordcomputer
Copy link

nordcomputer commented Sep 21, 2021

Ok, I got my instance working again. It seems like the timesync problem (#1589) (old version of libseccomp2) is indeed responsible for the problems.
You can check if it works as expected with this command:

docker exec -it nextcloud-container-name date

With the new version of libseccomp2 it shows the correct date. With the old version it just shows the 1.1.1970 as date.

I added the backports repo to my Buster installation and installed a newer version of libseccomp2.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138
echo "deb http://deb.debian.org/debian buster-backports main" | sudo tee -a /etc/apt/sources.list.d/buster-backports.list
sudo apt update
sudo apt install -t buster-backports libseccomp2

Also, I had to uninstall docker from the buster repository and reinstalled it with the official docker repostitory.

So, unless the raspberry foundation does not update their repositories (or jumps to bullseye), this seems to be the workaround.

Source of the solution:
https://docs.linuxserver.io/faq#my-host-is-incompatible-with-images-based-on-ubuntu-focal-and-alpine-3-13

@J0WI
Copy link
Contributor

J0WI commented Feb 2, 2022

Duplicate of #1589

@J0WI J0WI marked this as a duplicate of #1589 Feb 2, 2022
@J0WI J0WI closed this as completed Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants