Missing column in my PG DB

Hello there,

Nextcloud version : 22.2.3 (docker)
Operating system and version : Alpine 3.16 (on RPI3)
PostgreSQL version: 14.3 (docker postgres:14.3-alpine)

The issue you are facing:
I am facing a big problem. I have a dockerized Nextcloud (nextcloud:22.2.3-fpm-alpine) on a Raspberry Pi 3 and the system crashed.
I reinstalled everything and I re-imported the backup of my PostgreSQL DB.
But when I start my Nextcloud container, I have these errors :

I really don’t know why… What can I do?

EDIT: I tried php occ maintenance:repair

But these errors happened :

In ExceptionConverter.php line 67:

  An exception occurred while executing a query: SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "oc_filecache_extended" does not exist
  LINE 1: ...d_time" FROM "oc_filecache" "filecache" LEFT JOIN "oc_fileca...
                                                               ^


In Exception.php line 26:

  SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "oc_filecache_extended" does not exist
  LINE 1: ...d_time" FROM "oc_filecache" "filecache" LEFT JOIN "oc_fileca...
                                                               ^


In Statement.php line 92:

  SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "oc_filecache_extended" does not exist
  LINE 1: ...d_time" FROM "oc_filecache" "filecache" LEFT JOIN "oc_fileca...
                                                               ^


maintenance:repair [--include-expensive]

Many thanks.

Is this the first time you’ve seen this error? (Y/N): N

Steps to replicate it:

  1. Just run container

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

Ok, I tried this :

DROP table oc_flow_operations;
CREATE TABLE public.oc_flow_operations (
    id integer NOT NULL,
    class character varying(256) NOT NULL,
    name character varying(256) NOT NULL,
    checks text,
    operation text,
    entity varchar(256),
    events text
);

Now, the original problem is gone, but I still have these errors when I use php occ maintenance:repair :

In ExceptionConverter.php line 67:

  An exception occurred while executing a query: SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "oc_filecache_extended" does not exist
  LINE 1: ...d_time" FROM "oc_filecache" "filecache" LEFT JOIN "oc_fileca...
                                                               ^


In Exception.php line 26:

  SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "oc_filecache_extended" does not exist
  LINE 1: ...d_time" FROM "oc_filecache" "filecache" LEFT JOIN "oc_fileca...
                                                               ^


In Statement.php line 92:

  SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "oc_filecache_extended" does not exist
  LINE 1: ...d_time" FROM "oc_filecache" "filecache" LEFT JOIN "oc_fileca...
                                                               ^


maintenance:repair [--include-expensive]

I ran an upgrade : php occ upgrade
Now I have access to the login screen, but authentication always fails. So I reset my password, but it still doesn’t work. I even have an error because too many attempts.

It’s OK now !
The solution :

  1. Missing column in my PG DB - #2 by kimbrechts
  2. Missing column in my PG DB - #3 by kimbrechts
  3. Reset my password
  4. TRUNCATE oc_bruteforce_attempts;