"You are not permitted to delete this file", External Storage (local), Docker

Hello, I am not overly technical but happy to work with anyone willing to help, please be kind.

I am self hosting Nextcloud using the following docker compose file:

cat ~/docker-compose/nextcloud/docker-compose.yml
services:
  nextcloud:
    image: nextcloud
    container_name: nextcloud
    restart: unless-stopped
    ports:
      - 4443:80
    volumes:
      - ./nextcloud:/var/www/html
      - /media/drive1/photos:/photos
    environment:
      - MYSQL_HOST=db
      - MYSQL_PASSWORD=example
      - MYSQL_USER=root
      - MYSQL_DATABASE=nextcloud

  db:
    image: mysql:5.7
    container_name: nextcloud_db
    restart: unless-stopped
    environment:
      - MYSQL_ROOT_PASSWORD=example
    volumes:
      - ./db:/var/lib/mysql

I am signed in via the Android app, but I can’t seem to be able to delete files from my external storage. I did a whole lot of research and would like to think it’s not a permissions error:

ls -la /media/drive1 | grep photo
drwxr-x---   26 www-data www-data  4096 Nov  2 09:20 photos

I have also confirmed that the share is not in read-only mode (see screenshot)

Error also attached.

What could I be missing?


Many thanks in advance,
hooda

requirements are pretty the same as for primary storage: webserver account (uid 33 by default) of the container must have read and write access to your share /media/drive1/photos:/photos from your report looks like this is the case but please double check the files and if the uid of www-data is 33 on the host.

Many thanks for your response. Could you be kind enough and share with me the commands to run to verify? Am I running these commands in the docker container or on the host? Many thanks in advance.

Ok, i think I figured out what needs to be checked. Seems that both UID’s match =(

On the container:
docker exec -it nextcloud /bin/bash
root@fab25ae43e71:/var/www/html# id www-data
uid=33(www-data) gid=33(www-data) groups=33(www-data)
root@fab25ae43e71:/var/www/html# exit

on the host:
id www-data
uid=33(www-data) gid=33(www-data) groups=33(www-data)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.