Getting FUSE working in Docker 12.0.14

Struggling with this, Fuse starts, but I when I visit the folder to view files /opt/seafile-fuse I get a permissions error.

have modified seafile-server.yml

    volumes:
      - ${SEAFILE_VOLUME:-/opt/seafile-data}:/shared
      - type: bind
        source: /opt/seafile-fuse
        target: /seafile-fuse
        bind:
          propagation: rshared
    privileged: true
    cap_add:
      - SYS_ADMIN
    environment:
      - DB_HOST=${SEAFILE_MYSQL_DB_HOST:-db}

then run it…

docker compose up -d
docker exec -it seafile bash

cd /opt/seafile/seafile-server-latest/
./seaf-fuse.sh start /seafile-fuse

It starts…

bunny@bunny-pc:/opt/seafile$ docker exec -it seafile bash
root@ee734fd5ec56:/opt/seafile# cd /opt/seafile/seafile-server-latest/
root@ee734fd5ec56:/opt/seafile/seafile-server-latest# ./seaf-fuse.sh start /seafile-fuse

Starting seaf-fuse, please wait ...
seaf-fuse started

Done.

From within the container I can see the files /folders

root@ee734fd5ec56:/seafile-fuse# ls
05cfc6c68378466184c75cd474ae2eab@auth.local  6d494218ac5e4d03964091363990a917@auth.local
1c723a58365d45fab2bf8762f9bd1882@auth.local  me@myemail.co.nz
67d291f462324166a4fd0ad30c9d4362@auth.local  db0a7accdf174ed78dba1003f888b418@auth.local
root@ee734fd5ec56:/seafile-fuse# cd me@myemail.co.nz
root@ee734fd5ec56:/seafile-fuse/me@myemail.co.nz# ls
'0316898e-6cef-4872-98aa-8948fb9f9ba2_Random Stuff'
'1eebf21b-38d3-4965-9fe2-8873f6cf6da5_Camera Uploads'
'215f86fb-7e19-4d8d-a463-f8fb9fbd754a_Seadrive Stuff'
'33443d00-ab08-46b5-b44c-bc1fc49f48a1_test me'

Thinking a ownership issue errored - sudo chown -R root:root /opt/seafile-fuse

bunny@bunny-pc:/opt/seafile$ sudo chown -R root:root /opt/seafile-fuse
[sudo] password for bunny: 
chown: changing ownership of '/opt/seafile-fuse/67d291f462324166a4fd0ad30c9d4362@auth.local/61a03ca0-09b9-4ed1-a3f3-726851e10abe_ClientAccess/test': Function not implemented

can’t even cd into it

bunny@bunny-pc:/opt/seafile$ cd /opt/seafile-fuse
bash: cd: /opt/seafile-fuse: Permission denied

cant set permissions either, chmod isn’t implemented either - same Function not implemented error

any clues?

The following may help resolve your issue:

The core of the issue appears to be that the FUSE filesystem, mounted inside your Docker container, does not fully expose standard filesystem operations like chown and chmod to the host system. The “Function not implemented” errors you’re seeing when trying to change ownership or permissions on /opt/seafile-fuse from the host are a strong indicator of this limitation.

Here’s a summary of the analysis:

  • FUSE Filesystem Limitations: FUSE filesystems, especially when exposed across a Docker boundary, might not implement all standard filesystem operations. The “Function not implemented” error means that direct chown and chmod operations on the FUSE-mounted path from the host are not supported by the FUSE driver running within the container.
  • Permission Denied on Host: The “Permission denied” error when trying to cd into /opt/seafile-fuse from the host is a consequence of the host not being able to interpret or manipulate the permissions of the FUSE-managed files effectively. Even if chown and chmod were implemented, a user/group ID mismatch between the host and the container (where FUSE is running as root) would likely cause similar access issues.
  • Docker Configuration: While privileged: true, cap_add: - SYS_ADMIN, and propagation: rshared are correctly used to enable FUSE within the container, they don’t overcome the fundamental limitation of the FUSE filesystem itself not exposing full permission control to the host.

To resolve or work around this, consider these approaches:

  1. Interact within the Container: The most reliable way to interact with the FUSE-mounted files is directly from within the Docker container. As you’ve shown, you can ls and cd into the /seafile-fuse path inside the container without issues, indicating that the FUSE mount is working correctly there.
  2. Seafile Client Access: Accessing the files through the Seafile client is the intended and fully supported method for interacting with your Seafile data.
  3. Explore FUSE Mount Options: Investigate if the seaf-fuse.sh script or the underlying FUSE command supports specific mount options (e.g., allow_other, default_permissions) that could change how permissions are handled or exposed to the host. You would need to consult Seafile’s FUSE documentation for available options.
  4. Host Directory Permissions: Ensure the empty directory /opt/seafile-fuse on your host machine has appropriate permissions for your bunny user before the FUSE mount is established. While this won’t fix the “Function not implemented” error, it’s a good practice.

In essence, you’re encountering a limitation of how FUSE filesystems work when a FUSE mount originates inside a container and is then exposed to the host. Direct manipulation of ownership and permissions from the host, using standard chown and chmod, is not supported in this scenario.