New Setup Docker Compose not working

Hey!

So I wanted to install nextcloud on docker using docker-compose.

But when I insert my creditentals I get this error.

The Nextcloud and the mariadb setup is completly fresh.

Compose file looking like this.

db:
image: mariadb:10.6.0
container_name: mariadb
volumes:
- /srv/homeautomation/mariadb:/var/lib/mysql
- /etc/localtime:/etc/localtime:ro
environment:
- MYSQL_ROOT_PASSWORD=password123
networks:
- db_network
restart: unless-stopped

nextcloud:
image: nextcloud:21.0.1
container_name: nextcloud
networks:
- db_network
depends_on:
- db
volumes:
- /srv/homeautomation/nextcloud:/var/www/html
- /srv/homeautomation/nextcloud/config:/var/www/html/config
- /srv/homeautomation/nextcloud/custom_apps:/var/www/html/custom_apps
- /srv/homeautomation/nextcloud/data:/var/www/html/data
- /srv/homeautomation/nextcloud/themes:/var/www/html/themes
- /etc/localtime:/etc/localtime:ro
- /Disk1:/data
ports:
- “8083:80/tcp”
restart: unless-stopped

im my docker setup I defined a user dedicated for Nextcloud (besides mysqlroot). I’m not an expert in MariaDB but maybe an application is simply not allowed to use root credentials.

try adding Nextcloud DB and Nextcloud user (and use this credentials for NC setup):

    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_PASSWORD=pwdOfNextcloudUser
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

hint: you can use environment files like .env - it makes easier to use and change settings - if you use ${NC_MYSQL_PWD} multiple times you only need to change it once in your .env file…

1 Like

Hey, thanks for the answer. Sadly I just tried it and it doesn’t work. Still the same error.

Did you specify the mysql password environment variable also for your nextcloud container?

Yup just tried it with the mysql_password variable in the nextcloud container. That didn’t work. Also setting every mysql variable(Host, Password, User and Database) didnt work sadly. Still the same error as above.

Seems to be related to MariaDB 10.6, which by the way is currently in alpha status:

MariaDB starting with 10.6

From MariaDB 10.6.0, tables that are of the COMPRESSED row format are read-only by default. This is the first step towards removing write support and deprecating the feature.

Set the innodb_read_only_compressed variable to OFF to make the tables writable.

2 Likes

Please start with the official docker-compose file - this is doesn’t cover everything you want (e.g. no cron and redis) but it is good starting point…

version: '2'

volumes:
  nextcloud:
  db:

services:
  db:
    image: mariadb
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=
      - MYSQL_PASSWORD=
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud
    restart: always
    ports:
      - 8080:80
    links:
      - db
    volumes:
      - nextcloud:/var/www/html
    environment:
      - MYSQL_PASSWORD=
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db

another more complex setup I posted here. But I strongly recommend to start with an easy example and add complexity once more simple setup works.

1 Like

Sooo. The fix was actually pretty easy for mariadb 10.6.0.
@Chartman123 lead me in the right direction.
Adding

command: --innodb-read-only-compressed=OFF

fixes the error. The other stuff that is in the offical docker-compose file isn’t needed for this to be fixed(Not really sure what that does anyway). Thanks for the help!

3 Likes

Hi, can you maybe elaborate on how you fixed this?
I tried to exec into the container and run

mysqld --innodb-read-only-compressed=OFF

but it didn’t work
grafik
It basically said: Don’t touch me, you don’t know what your doing!
Or should i just edit some config file withing the volume? (from outside the container?)

Just running this command probably wouldn’t help much as it’s not persistent. So just add the command when you run the container.

1 Like

Alright, thanks :slight_smile: !
creating a command section in my docker-compose.yml file worked:
grafik

2 Likes

Why hasn’t this been added to the official docker-compose file? This is still a problem.