Permission issues with Docker installation (unable to write/read/edit, can delete)

do you see the “Forbidden” message on the browser?
is there something useful in the server log?
Maybe you ht some silly logical issue like exceeded quota?

I have plenty of space left; no issues with the quota. This is a new installation.

There is nothing useful in the server log beyond what is quoted in the OP.

looks you are confident everything is right… likely you don’t need any help.

And yet… This is not what I see when I look at the directory listing.

What format is this other hard drive?

Hi Willi — I very much appreciate your assistance and willingness to help.

I am, unfortunately, still facing issues.

Consequently, I am re-doing the entire installation from scratch.

Hi Karl

Thanks for your reply.

It is EXT4.

@wwe and @KarlF12:

Could you please confirm that everything looks OK in this docker-compose?

services:
  nextcloud-db:
    image: mariadb:latest
    container_name: nextcloud-mysql
    restart: unless-stopped
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - ./nextcloud-mysql/db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=<pass>
      - MYSQL_PASSWORD=<pass>
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_LOG_CONSOLE=true
    networks:
      - nextcloud-net

  nextcloud-app:
    image: nextcloud:latest
    container_name: nextcloud-app
    restart: unless-stopped
    networks:
      - nextcloud-net
    ports: ["8080:80"]
    environment:
      - MYSQL_HOST=nextcloud-db
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_PASSWORD=<pass>
    volumes:
      - /media/uxb3/F/nextcloud/:/var/www/html
    depends_on:
      - nextcloud-db

networks:
  nextcloud-net:

I have not created /media/uxb3/F/nextcloud/ yet.

Compose file ok to me, except that you really should have redis also, or you may have file locking issues.

Just as a test, could you try putting the docker mount point on your root volume instead of this external drive and see if it works? Could be an issue with the way this external drive is mounted.

I have updated as follows:

services:
  nextcloud-db:
    image: mariadb:latest
    container_name: nextcloud-mysql
    restart: unless-stopped
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - ./nextcloud-mysql/db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=<pass>
      - MYSQL_PASSWORD=<pass>
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_LOG_CONSOLE=true
    networks:
      - nextcloud-net

  nextcloud-redis:
    image: redis:latest
    restart: unless-stopped
    container_name: nextcloud-redis
    volumes:
      - ./nextcloud-redis:/data
    networks:
      - nextcloud-net

  nextcloud-app:
    image: nextcloud:latest
    container_name: nextcloud-app
    restart: unless-stopped
    networks:
      - nextcloud-net
    ports: ["8080:80"]
    environment:
      - MYSQL_HOST=nextcloud-db
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_PASSWORD=<pass>
    volumes:
      - /media/uxb3/F/nextcloud/:/var/www/html
    depends_on:
      - nextcloud-db
      - nextcloud-redis

networks:
  nextcloud-net:

Should be OK?

Sure, I will give that a go.

docker tag mariadb:latest installs version 10.8 which is not supported by NC as of now. Please try using supported version e.g. 10.5.

Aha, if I use my root volume instead of an external drive, everything works.

I thought EXT4 as OK…?

Thank you; I have updated to 10.5.

With this in mind, how should I be mounting and subsequently using an external volume, @KarlF12?

There is no problem with EXT4 as the filesystem, but there could be some issue with how it’s mounted. Can you show your mount command?

The following should be the mount options.

type ext4 (rw,nosuid,nodev,relatime,errors=remount-ro,uhelper=udisks2)

Does this look correct, @KarlF12?

I think so. Are you using the acl package in the OS?

If you go into the container with docker exec -it -u www-data nextcloud-app bash are you able to read/write files in the user’s data folder?

1 Like

Hi Karl

So I just did docker-compose up on the above file with an updated volume on the external drive.

Exactly as I did in my original post… and, as far as I can tell, everything works now.

The only difference is the MariaDB version 10.5 as pointed out by @wwe.


… I spoke too soon.

Whilst everything worked perfectly fine before, restarting the machine introduces errors.

Starting the containers again using sudo docker-compose up and attempting to access the localhost:8080 yields the installation page. Attempting to access localhost:8080/apps/files/ yields the following error in the browser:

Forbidden

You don’t have permission to access this resource.


Apache/2.4.53 (Debian) Server at localhost Port 8080

Which in turn corresponds to the following error:

nextcloud-app      | [Sun Jul 03 21:21:19.203653 2022] [autoindex:error] [pid 31] [client 172.20.0.1:43014] AH01276: Cannot serve directory /var/www/html/apps/files/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
nextcloud-app      | 172.20.0.1 - - [03/Jul/2022:21:21:19 +0000] "GET /apps/files/ HTTP/1.1" 403 679 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0"

The Cannot serve directory /var/www/html/apps/files/: No matching DirectoryIndex (index.php,index.html) part is particularly interesting, because the directory created on my external volume remains as it was prior to the restart when everything worked. I can see all the files and directories that supposedly are not there.

This one is indicating a web server configuration issue.

Did you try this?

this sound like the database is not in the config anymore (or there is no more config at all).

as Nextcloud doesn’t (no DB) run you are trying to access the folder …/app/filles through your webserver which is not allowed, but this is not an issue here.