Nextcloud installtion - no db tables created

Trying a new ansible install of nextcloud.
With the following compose:

services:

  nextcloud:
    container_name: nextcloud
    hostname: nextcloud
    restart: always
    mem_limit: 200m
    networks:
      - nextcloud
      - caddy-proxy
    labels:
      - com.centurylinklabs.watchtower.enable=false
    environment:
      - TZ=Pacific/Auckland
      - PUID=1000
      - PGID=1000
      - BASEPATH=/hdd/docker-data
      - DB_ROOT_PW=<redacted>
      - DB_NAME=nextcloud
      - DB_USER=nextcloud
      - DB_PW=insecure
    image:  linuxserver/nextcloud:22.2.3-ls165
    ports:
      - "8088:80"
      - "8090:443"
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
      - "/hdd/docker-data/nextcloud/nextcloud:/config"
      - nextcloud:/data

  mariadb:
   container_name: nextcloud_mariadb
   image: mariadb:10.5
   restart: unless-stopped
   mem_limit: 500m
   command: mysqld --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF >
   networks:
     - nextcloud
   volumes:
     - "/hdd/docker-data/dbbackups:/mnt/"
     - "/hdd/docker-data/nextcloud/mariadb:/scripts"
     - mariadb:/var/lib/mysql
     - mariadb:/tmp
   environment:
     MYSQL_ROOT_PASSWORD: <redacted>
     MYSQL_USER: nextcloud
     MYSQL_PASSWORD: insecure
     MYSQL_DATABASE: nextcloud
################################################################################

networks:
  nextcloud:
  caddy-proxy:
    driver: bridge
    external: true

volumes:
  mariadb:

the mariadb container is starting and it makes an empty nextcloud db.
But then the nextcloud container gets an error

Next Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_appconfig' doesn't exist in /config/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:47
Stack trace:

And I can’t see what or where, something should be creating the rest of the nextcloud tables. What am I missing?

My config looks pretty similar to the reference one: SWAG setup - LinuxServer.io

The tables get created during the nextcloud wizard on first deployment.

I thought you could do it by running occ maintenance:install with the database details?

That I wouldn’t know but our container doesn’t support auto deployment of the nextcloud database via the ENV’s you’ve provided.

Yeah this command.
sudo -u www-data php occ maintenance:install --database
“mysql” --database-name “nextcloud” --database-user “root” --database-pass
“password” --admin-user “admin” --admin-pass “password”
Nextcloud is not installed - only a limited number of commands are available
Nextcloud was successfully installed

From here
https://docs.nextcloud.com/server/latest/admin_manual/installation/command_line_installation.html

As going to the web page in order to ru. The wizard is what first alerted me to it as it had A server error

Ok, so a fair bit of that command is specific to their container. You’d want to replace sudo -u www-data php occ maintenance:install ... with just occ maintenance:install ... as our container has an alias that sorts the correct user etc.

Yeah I’d tried that. And with the user. Both had that same error in that the db exists and no oc_appconfig

As I’d tried it with the database dropped as well and got an error that the database didn’t exist. So then I create that and are told the table doesn’t exist

Only other thing I haven’t tried is manually creating that Nextcloud using with the insecure password from the config

So turns out, I’m a bit of a dumbass - even though i cleared everything, it’s didn’t seem to have done it.

So I made a point of clearing everything and reran the occ maintnance install command, and I got it to install.

Maybe there was some residual files there and it was complaing because the db half existed I don’t know.

But the install instructions did work.