Docker not seeing rclone mount after dropping

What is the problem you are having with rclone?

I have a rclone mount which a docker container is using. Sometimes the mount will drop and restart. The host can read it fine, but the container no longer can read it and gives a transport endpoint error. The error is "Transport endpoint is not connected"

I'm using Portainer to manage docker. I have read some info about the need to use rslave with the bind mount, but I don't know much about it. The problem with Portainer is, as far as I can tell, I cannot set the mode.

Any help would be greatly appreciated.

What is your rclone version (output from rclone version)

rclone v1.51.0

Which OS you are using and how many bits (eg Windows 7, 64 bit)

CentOS 7

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

Dropbox

Generally if you have a mount and it gets killed by something, you get that error. You'd have to remove the processes that are still hitting the mount point and restart it.

Ideally, you want to figure out what's killing it and address the root cause of the issue.

Version is a few back, but I would doubt that is your issue.

Thanks for the reply. Updated the version and upped the log level to DEBUG. Would be good if there was a solution for it though.

That's the challenge, I'd bet a good amount you aren't going to see anything in rclone as something outside of rclone is killing the process.

The error you described is when the rclone process killed like 99% of the time.

I've mainly seen it with systemd killing the process as that's what the defaults do.

I had similar problems and decided to try and solve it last week.
The solution for me was to write a shell script that reboots the docker container if it is running and the mounted volume on the container returns "Transport endpoint is not connected".

I am running this script in a crontab right now.

#!/bin/bash

# will print Error: No such container: plex if container not running

test=$(docker exec -it plex ls /media)
if [[ $(echo $test | grep "Transport endpoint is not connected") ]]; then
	echo 'Mount disconnected will restart container'
	docker-compose -f ~/docker/plex/docker-compose.yml restart
fi

and in my docker-compose file I have

volumes:
      - type: bind
        source: /home/qnorsten/.gdrive/
        target: /media
        bind:
            propagation: rslave

Opps pasted the wrong script. For it to work with a crontab you need to remove the -it part from the docker exec command

#!/bin/bash

# will print Error: No such container: plex if container not running

test=$(docker exec -it plex ls /media)
if [[ $(echo $test | grep "Transport endpoint is not connected") ]]; then
   echo 'Mount disconnected will restart container'
  docker-compose -f ~/docker/plex/docker-compose.yml restart
fi

While that is a work around, it's not solving the issue as the issue itself should not happen.

The goal would be to figure out why the situation is occurring as the error occurs when something kills the rclone process, which is not normal and leaves a dangling fuse mount which generates the error listed.

Thank you both for your replies. After more debugging, it looks like the mount is failing due to too many connections. The mount is being scanned a lot. I will use the script from @qnorsten whilst I break the folder up into smaller, hopefully more manageable, folders.

What causes it to drop though? When you say failing, what does that mean? I've scanned with Plex/Emby and hammered my mount and I haven't ever seen rclone crash or the mount drop.

Nothing is showing in the log. I have it set to DEBUG. It just stops and then starts again. No error, nothing. Line before shows part of a Plex scan and then the next line is rclone starting the mount.

Tried setting the tpslimit to 1 with burst of 10 but didn't help.

That means something killed it if you have no log entries as that's not rclone crashing/dying/stopping.

Dockers add that extra layer of complexity so figuring out what's doing it is trickier. Good luck!

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