Rclone Mount Contents Can Not Be Seen By Plex Docker Container

What is the problem you are having with rclone?

I am mounting rclone crypt remote to /home/ubuntu/mnt/gcrypt. The mount is working as expected and I can see all the folders/files inside, but my docker container Plex is unable to see anything inside the mount when I bind the volume.

I'm trying to figure out where the issue is. I thought it may be permissions so I made sure the systemd mount service has allow-other and umask 000 (I've tried 002 as well) set. I also exec'd into container and saw that the container can indeed see /plexmedia folder but inside there is nothing (even though there should be Movies, TV Shows, 4K, 4K TV, etc). Not sure where else to go from here but I can't seem to narrow it down.

Here is my docker-compose as a reference:

services:
  plex:
    image: lscr.io/linuxserver/plex:latest
    container_name: plex
    environment:
      - PUID=1001
      - PGID=1001
      - VERSION=docker
      - PLEX_CLAIM=claim-token
    volumes:
      - /opt/appdata/plex/data:/config
      - /home/ubunutu/mnt/gcrypt:/plexmedia
    ports:
      - "32400:32400/tcp"
      - "3005:3005/tcp"
      - "8324:8324/tcp"
      - "32469:32469/tcp"
      - "1900:1900/udp"
      - "32410:32410/udp"
      - "32412:32412/udp"
      - "32413:32413/udp"
      - "32414:32414/udp"
    restart: unless-stopped
    networks:
      - oracle
networks:
  oracle:
    external: true

Run the command 'rclone version' and share the full output of the command.

rclone v1.60.1
- os/version: ubuntu 20.04 (64 bit)
- os/kernel: 5.15.0-1025-oracle (aarch64)
- os/type: linux
- os/arch: arm64
- go/version: go1.19.3
- go/linking: static
- go/tags: none

Which cloud storage system are you using? (eg Google Drive)

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone mount gcrypt: /home/ubuntu/mnt/gcrypt \
  --allow-other \
  --umask 000 \
  --config /home/ubuntu/.config/rclone/rclone.conf \
  --use-mmap \
  --dir-cache-time 1000h \
  --poll-interval=15s \
  --vfs-cache-mode writes \
  --tpslimit 10

The rclone config contents with secrets removed.

[gdrive]
type = drive
client_id = id
client_secret = secret
token = token
team_drive =

[gcrypt]
type = crypt
remote = gdrive:/encrypt
password = password1
password2 = password2

I think you need to add :shared or :rshared to the volume.

If you run a bash shell and check, you can probably see your permissions if that's the issue.

I don't see you using any docker rclone volume (I don't either).

I run rclone and my docker as the same user so I don't hit permission issues.

Do you mean in the docker-compose file?

Yes. I don't use docker-compose but the command line docker example is here if you want to translate it.

Yeah that's pretty the same way I have mine set up currently.

I was able to solve this by switching straight to /mnt/gcrypt as the mountpoint instead of ~/mnt/gcrypt. I 775'd the /mnt so it could be seen regularly. Not sure if this is best practice but after restarting the service and plex I was able to finally see gcrypt inside Plex's docker container.

That is solved but now I am having the issue of the rclone mount essentially stalling out after a little bit of time. I've tried enabling logging to a log-file but I get nothing written to any log file. Is that again a permissions thing or what?

@ncw - thanks for your earlier suggestions, see this update.

Dunno. You'd have to share your command, what you've run and some output.

I run a server that only I use so I use the same user for everything.

Permissions only generally get 'bad' if you are on a shared server and you'd have to be more precise.

The command is a systemd file but here is the snippet

rclone mount gcrypt: /mnt/gcrypt \
  --allow-other \
  --umask 000 \
  --config /home/ubuntu/.config/rclone/rclone.conf \
  --use-mmap \
  --dir-cache-time 1000h \
  --read-only \
  --poll-interval=15s \
  --vfs-cache-mode writes \
  --tpslimit 10
  --log-level DEBUG \
  --log-file /logs/rclone-vfs.log \

The /logs directory is owned by the same user running rclone and has 777 perms. This isn't a shared server, just my personal one I use on Oracle.

The command looks odd as you have a trailing \ at the end of the last line.

Are you running a service file or something?

Yes it's a systemd service file. Full file here (removed trailing \):

[Unit]
Description=GCrypt
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
KillMode=none

ExecStart=/usr/bin/rclone mount gcrypt: /mnt/gcrypt \
  --allow-other \
  --umask 000 \
  --config /home/ubuntu/.config/rclone/rclone.conf \
  --use-mmap \
  --dir-cache-time 1000h \
  --read-only \
  --poll-interval=15s \
  --vfs-cache-mode writes \
  --tpslimit 10
  --log-level DEBUG \
  --log-file /logs/rclone-vfs.log

ExecStop=/bin/fusermount -uz /mnt/gcrypt

Restart=on-failure
RestartSec=15

[Install]
WantedBy=default.target

Does the log file get made?

ls -al /logs/rclone-vfs.log

Anything there?

If not, what does

journalctl -u <yourservicefilename> -b

show?

No log file made.

journalctl -u gcrypt -b
-- Logs begin at Tue 2021-09-07 18:37:22 UTC, end at Fri 2022-12-09 18:49:0>
-- No entries --
lines 1-2/2 (END)

Nothing from journalctl either.

Is that the right name for the service?

If it's running, you should see something.

Example:

felix@gemini:~$ journalctl -u rclone -b
-- No entries --
felix@gemini:~$ journalctl -u rclone-tv -b
Dec 08 19:35:46 gemini systemd[1]: Starting RClone Service Dropbox TV...
Dec 08 19:35:49 gemini rclone[1672]: {
Dec 08 19:35:49 gemini rclone[1672]:         "jobid": 1
Dec 08 19:35:49 gemini rclone[1672]: }
Dec 08 19:35:49 gemini systemd[1]: Started RClone Service Dropbox TV.

and

felix@gemini:~$ ls -al /etc/systemd/system/rclone-tv.service
-rw-r--r-- 1 root root 1816 Dec  1 16:25 /etc/systemd/system/rclone-tv.service

The service was under --user and I just moved it into /etc/systemd and re-did everything, rebooted, and here is the output from journalctl -u gcrypt -b | less.
Just a note: | less is used to wrap lines instead of truncating in terminal.

-- Logs begin at Tue 2021-09-07 18:37:22 UTC, end at Fri 2022-12-09 19:52:29 UTC. --
Dec 09 19:51:19 arm systemd[1]: Starting GCrypt...
Dec 09 19:51:21 arm systemd[1]: Started GCrypt.
~
(END)

So do you see the log file now? No errors there so looks most likely good.

No log file is being made in /logs as of yet. What could be the cause of that?

Generally, that means either your service file doesn't have a log file in it, you didn't reload the service file or something along those lines.

If you are sure that's the right service file, it'll fail to start if it can't write the log file.

Would look like:

root@gemini:/etc/systemd/system# vi test.service
root@gemini:/etc/systemd/system# systemctl daemon-reload
root@gemini:/etc/systemd/system# systemctl start test
Job for test.service failed because the control process exited with error code.
See "systemctl status test.service" and "journalctl -xeu test.service" for details.
root@gemini:/etc/systemd/system# journalctl -u test -b
Dec 09 17:07:51 gemini systemd[1]: Starting test...
Dec 09 17:07:51 gemini rclone[140105]: 2022/12/09 17:07:51 Failed to open log file: open /wrong/fake/test.log: no such file or directory
Dec 09 17:07:51 gemini systemd[1]: test.service: Main process exited, code=exited, status=1/FAILURE
Dec 09 17:07:51 gemini systemd[1]: test.service: Failed with result 'exit-code'.
Dec 09 17:07:51 gemini systemd[1]: Failed to start test.

and

root@gemini:/etc/systemd/system# cat test.service
[Unit]
Description=test
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
Environment=RCLONE_CONFIG=/opt/rclone/rclone.conf
RestartSec=5
ExecStart=/usr/bin/rclone mount GD: /home/felix/test --log-file /wrong/fake/test.log
ExecStop=/bin/fusermount -uz /home/felix/test
Restart=on-failure
User=felix
Group=felix

[Install]
WantedBy=multi-user.target

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