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)
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.
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
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.