madslundt / docker-cloud-media-scripts

Upload and stream media from the cloud with or without encryption. Cache all new and recently streamed media locally to access quickly and reduce API calls
MIT License
100 stars 34 forks source link

ls: cannot access '/cloud-encrypt': Transport endpoint is not connected #47

Open p1rps01 opened 5 years ago

p1rps01 commented 5 years ago

Initially entered the following docker commands to download and create volumes for cloud-media-scripts

sudo docker pull madslundt/cloud-media-scripts sudo docker volume create --name local-media sudo docker volume create --name local-decrypt sudo docker volume create --name config sudo docker volume create --name chunks sudo docker volume create --name datadb sudo docker volume create --name log sudo docker volume create --name cloud-encrypt sudo docker volume create --name cloud-decrypt

Then

ran

sudo docker create --name cloud-media-scripts \ --restart=always \ --net=lsio \ --privileged --cap-add=MKNOD --cap-add=SYS_ADMIN --device=/dev/fuse \ -e PUID=0 \ -e PGID=0 \ -e CLEAR_CHUNK_MAX_SIZE="1000G" \ -e REMOVE_LOCAL_FILES_WHEN_SPACE_EXCEEDS_GB="2000" \ -e FREEUP_ATLEAST_GB="1000" \ -v "/share/media":/local-media:shared \ -v /mnt/external/media:/local-decrypt:shared \ -v /mnt/external/media/cloud-encrypt:/cloud-encrypt:shared \ -v "/share/appdata/cms":/config \ -v /mnt/external/plexdrive:/chunks \ -v /logs:/log \ madslundt/cloud-media-scripts

I then successfully ran

sudo docker exec -ti cloud-media-scripts rclone_setup

following instructions here:

https://github.com/madslundt/docker-cloud-media-scripts

and then successfully ran

sudo docker exec -ti cloud-media-scripts plexdrive_setup.

Now when i start the docker container, I am seeing:

User gid: 0


[cont-init.d] 10-adduser: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Started mongod --logpath /log/mongod.log
Started mount
2019-10-23T16:15:39.390+0000 I CONTROL [main] log file "/log/mongod.log" exists; moved to "/log/mongod.log.2019-10-23T16-15-39".
[ 2019-10-23@16:15:45 ] Mounting Google Drive mountpoint: /cloud-encrypt
ls: cannot access '/cloud-encrypt': Transport endpoint is not connected
Waiting for mount /cloud-encrypt ...

I tried via ssh to execute

fusermount -uz /mnt/external/media/cloud-encrypt

which executed successfully. I then stopped and restarted the container and still get the error message

ls: cannot access '/cloud-encrypt': Transport endpoint is not connected

Can you tell me how to fix this error?

What is the best way to contact you for your assistance? Discord? If so, what ID?

p1rps01 commented 5 years ago

Your thoughts on what i can do to fix this error?

madslundt commented 5 years ago

A couple of questions:

What OS are you running this on and what version of Docker?

I'm not sure what --net=lsio means.

Are you sure that your pgid and puid should be 0?

Are you able to ssh into the docker container and access /cloud-encrypt?

p1rps01 commented 5 years ago

OS version that i am running is Linux.

OS Kernal version is

[admin@RSMediaServer ~]# uname -r 4.14.24-qnap

Docker version is:

[admin@RSMediaServer ~]# docker version Client: Version: 17.09.1-ce API version: 1.32 Go version: go1.8.3 Git commit: e398b97 Built: Tue May 28 12:02:28 2019 OS/Arch: linux/amd64

Server: Version: 17.09.1-ce API version: 1.32 (minimum version 1.12) Go version: go1.8.3 Git commit: e398b97 Built: Tue May 28 12:02:28 2019 OS/Arch: linux/amd64 Experimental: false

--net=lsio in a discussed here:

https://blog.linuxserver.io/2019/04/25/letsencrypt-nginx-starter-guide/

Docker networking Letsencrypt container happily runs with bridge networking. However, the default bridge network in docker does not allow containers to connect each other via container names used as dns hostnames. Therefore, it is recommended to first create a user defined bridge network and attach the containers to that network.

If you are using docker-compose, and your services are on the same yaml, you do not need to do this, because docker-compose automatically creates a user defined bridge network and attaches each container to it as long as no other networking option is defined in their config.

For the below examples, we will use a network named lsio. We can create it via docker network create lsio. After that, any container that is created with --net=lsio can ping each other by container name as dns hostname.

Keep in mind that dns hostnames are meant to be case-insensitive, however container names are case-sensitive. For container names to be used as dns hostnames in nginx, they should be all lowercase as nginx will convert them to all lowercase before trying to resolve.

On the PGID and PUID i am using, I am aware of this article that explains how they work:

https://medium.com/@mccode/understanding-how-uid-and-gid-work-in-docker-containers-c37a01d01cf

I am running the docker container as the admin user which is basically a user that has root access:

[admin@RSMediaServer ~]# id -a admin uid=0(admin) gid=0(administrators) groups=0(administrators),100(everyone),1000(media) [admin@RSMediaServer ~]# id -g admin 0

I am able to SSH into the docker container and access /cloud-encrypt

[admin@RSMediaServer ~]# docker exec -it cms /bin/bash root@cd55bc92c90f:/data# cd /cloud-encrypt/Media root@cd55bc92c90f:/cloud-encrypt/Media# ls -l total 0 drwxr-xr-x 1 root root 0 Oct 27 23:02 @Recycle drwxr-xr-x 1 root root 0 Oct 29 01:01 TV Shows drwxr-xr-x 1 root root 0 Oct 27 23:03 cloud-encrypt root@cd55bc92c90f:/cloud-encrypt/Media# ^C root@cd55bc92c90f:/cloud-encrypt/Media#

Can you please send me a way to chat with you online or a direct email that i can contact you at? I would like to get the issue resolved in Docker container up and running. Unable to copy files to local-media directory. Permissions show ok via ls-l. #49 ASAP.

Thanks.

madslundt commented 5 years ago

Is it correct that you are running it on a Qnap NAS? Some have had problems with shared mounts https://github.com/madslundt/docker-cloud-media-scripts/issues/35#issuecomment-515775253

Have you tried that?

p1rps01 commented 5 years ago

So what would the mount commands that you referred to for the following volumes be?

Should the docker create code have --mount commands? If so, what should they be?

See: https://docs.docker.com/storage/volumes/

-v "/share/media":/local-media:shared -v /mnt/external/media:/local-decrypt:shared -v /mnt/external/media/cloud-encrypt:/cloud-encrypt:shared -v "/share/appdata/cms":/config -v /mnt/external/plexdrive:/chunks -v /logs:/log

I tried this at my SSH command prompt and received the following:

[admin@RSMediaServer ~]# sudo mount --make shared /share/media mount: unrecognized option '--make' Usage: mount -V : print version mount -h : print this help mount : list mounted filesystems mount -l : idem, including volume labels So far the informational part. Next the mounting. The command is `mount [-t fstype] something somewhere'. Details found in /etc/fstab may be omitted. mount -a [-t|-O] ... : mount all stuff from /etc/fstab mount device : mount device at the known place mount directory : mount known device here mount -t type dev dir : ordinary mount command Note that one does not really mount a device, one mounts a filesystem (of the given type) found on the device. One can also mount an already visible directory tree elsewhere: mount --bind olddir newdir or move a subtree: mount --move olddir newdir A device can be given by name, say /dev/hda1 or /dev/cdrom, or by label, using -L label or by uuid, using -U uuid . Other options: [-nfFrsvw] [-o options] [-p passwdfd]. For many more details, say man 8 mount .

[admin@RSMediaServer ~]# sudo mount --make shared /local-media mount: unrecognized option '--make' Usage: mount -V : print version mount -h : print this help mount : list mounted filesystems mount -l : idem, including volume labels So far the informational part. Next the mounting. The command is `mount [-t fstype] something somewhere'. Details found in /etc/fstab may be omitted. mount -a [-t|-O] ... : mount all stuff from /etc/fstab mount device : mount device at the known place mount directory : mount known device here mount -t type dev dir : ordinary mount command Note that one does not really mount a device, one mounts a filesystem (of the given type) found on the device. One can also mount an already visible directory tree elsewhere: mount --bind olddir newdir or move a subtree: mount --move olddir newdir A device can be given by name, say /dev/hda1 or /dev/cdrom, or by label, using -L label or by uuid, using -U uuid . Other options: [-nfFrsvw] [-o options] [-p passwdfd]. For many more details, say man 8 mount . [admin@RSMediaServer ~]#

madslundt commented 5 years ago

You should just run the command by itself on your shared bindings and then afterwards run docker create/run

You need to type --make-shared and not --make shared.