linuxserver / docker-nextcloud

GNU General Public License v3.0
699 stars 128 forks source link

[BUG] ERROR: relation "oc_appconfig" does not exist at character 57 with new install of latest version ONLY #467

Open alamoudimoh opened 3 weeks ago

alamoudimoh commented 3 weeks ago

Is there an existing issue for this?

Current Behavior

the below error only happens when installing a fresh installtion of 29.0.5-ls335

i used version 29.04 and it works fine, i used version 29.04 and upgraded to latest tag and it worked fine, only with new installation of latest

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

Expected Behavior

logging into nextcloud normaly

Steps To Reproduce

  1. create new docker with PostgreSQL and nextcloud using nextcloud latest tag
  2. installtion complete successfully
  3. start the intial setup.
  4. once the database start to connect you get the following error
    
    Internal Server Error

The server encountered an internal error and was unable to complete your request. Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report. More details can be found in the server log.


### Environment

```markdown
- OS: ubuntu 22.04
- How docker service was installed: portainer stack

CPU architecture

x86-64

Docker creation

services:
  database:
    image: postgres:16
    container_name: PostgreSQL
    restart: always
    environment:
      POSTGRES_USER: db_user
      POSTGRES_PASSWORD: db_password
      POSTGRES_DB: nextcloud_db
    volumes:
      - /Storage/PostgreSQL/database:/var/lib/postgresql/data
    networks:
      - nc_network

  app:
    image: lscr.io/linuxserver/nextcloud:29.0.4-ls332
    container_name: NextCloud
    restart: always
    environment:
      PUID: 1000
      PGID: 1000
      TZ: Asia/Riyadh
    ports:
      - 443:443
    volumes:
      - /Storage/NextCloud/config:/config
      - /Pool-Storage/Storage/data:/data
    depends_on:
      - database
      - cache
    networks:
      - nc_network

Container logs

PostgreSQL init process complete; ready for start up.
2024-08-24 11:37:48.228 UTC [1] LOG:  starting PostgreSQL 16.4 (Debian 16.4-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-08-24 11:37:48.228 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-08-24 11:37:48.228 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-08-24 11:37:48.240 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-08-24 11:37:48.253 UTC [65] LOG:  database system was shut down at 2024-08-24 11:37:48 UTC
2024-08-24 11:37:48.261 UTC [1] LOG:  database system is ready to accept connections
2024-08-24 11:37:48.360 UTC [69] ERROR:  relation "oc_mounts" does not exist at character 27
2024-08-24 11:37:48.360 UTC [69] STATEMENT:  SELECT user_id, path FROM oc_mounts INNER JOIN oc_filecache ON root_id = fileid WHERE storage_id = 1
2024-08-24 11:39:00.064 UTC [75] ERROR:  relation "oc_appconfig" does not exist at character 57
2024-08-24 11:39:00.064 UTC [75] STATEMENT:  SELECT "appid", "configkey", "configvalue", "type" FROM "oc_appconfig" WHERE "lazy" = $1
2024-08-24 11:39:00.067 UTC [75] ERROR:  relation "oc_appconfig" does not exist at character 57
2024-08-24 11:39:00.067 UTC [75] STATEMENT:  SELECT "appid", "configkey", "configvalue", "type" FROM "oc_appconfig" WHERE "lazy" = $1
2024-08-24 11:39:00.067 UTC [75] ERROR:  relation "oc_appconfig" does not exist at character 57
2024-08-24 11:39:00.067 UTC [75] STATEMENT:  SELECT "appid", "configkey", "configvalue", "type" FROM "oc_appconfig" WHERE "lazy" = $1
2024-08-24 11:39:00.068 UTC [75] ERROR:  relation "oc_appconfig" does not exist at character 57
2024-08-24 11:39:00.068 UTC [75] STATEMENT:  SELECT "appid", "configkey", "configvalue", "type" FROM "oc_appconfig" WHERE "lazy" = $1
2024-08-24 11:39:00.069 UTC [75] ERROR:  relation "oc_appconfig" does not exist at character 57
2024-08-24 11:39:00.069 UTC [75] STATEMENT:  SELECT "appid", "configkey", "configvalue", "type" FROM "oc_appconfig" WHERE "lazy" = $1
2024-08-24 11:39:00.112 UTC [76] ERROR:  relation "oc_appconfig" does not exist at character 57
2024-08-24 11:39:00.112 UTC [76] STATEMENT:  SELECT "appid", "configkey", "configvalue", "type" FROM "oc_appconfig" WHERE "lazy" = $1
2024-08-24 11:39:00.113 UTC [76] ERROR:  relation "oc_appconfig" does not exist at character 57
2024-08-24 11:39:00.113 UTC [76] STATEMENT:  SELECT "appid", "configkey", "configvalue", "type" FROM "oc_appconfig" WHERE "lazy" = $1
2024-08-24 11:39:00.113 UTC [76] ERROR:  relation "oc_appconfig" does not exist at character 57
2024-08-24 11:39:00.113 UTC [76] STATEMENT:  SELECT "appid", "configkey", "configvalue", "type" FROM "oc_appconfig" WHERE "lazy" = $1
2024-08-24 11:39:00.114 UTC [76] ERROR:  relation "oc_appconfig" does not exist at character 57
github-actions[bot] commented 3 weeks ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

KrazyJO commented 3 weeks ago

I have the same error :(

j0nnymoe commented 3 weeks ago

This needs to be reported upstream, this is an app issue, not a container issue.

cfragkos commented 3 weeks ago

I have the same on a fresh install

joshtrichards commented 3 weeks ago

Is there an owncloud.db (SQLite) file created within your /data folder when this happens (even though you're specifying postgresql)?

alamoudimoh commented 3 weeks ago

Is there an owncloud.db (SQLite) file created within your /data folder when this happens (even though you're specifying postgresql)?

yes that is correct

KrazyJO commented 3 weeks ago

I could solve the problem for me. The problem appeared after upgrading from 28.x to 29.x. I had to manually add add 2 columns into a table: Have a look here: https://github.com/nextcloud/server/issues/46879#issuecomment-2259920951. Hope this helps.

joshtrichards commented 3 weeks ago

We had a similar situation arise with the micro-services Docker image (nextcloud/docker#2283).

Fixed in nextcloud/server#47521

chrislentz commented 6 days ago

Any updates here? The official image has had a fix for this for sometime.

lmaddox commented 1 day ago

Is there an owncloud.db (SQLite) file created within your /data folder when this happens (even though you're specifying postgresql)?

Yes, in my case, there were a lot of files on the mounted drive. Deleting them seems to have triggered the container to re-create the database, this time using the PG. I notice that the /config/config.php now says that the db type is pgsql. Thanks.