haugene / docker-transmission-openvpn

Docker container running Transmission torrent client with WebUI over an OpenVPN tunnel
GNU General Public License v3.0
4.13k stars 1.21k forks source link

Synology - Can't access Transmission WebUI #51

Closed trevmlt closed 8 years ago

trevmlt commented 8 years ago

Hello. I am new to Docker, but I am close to getting this working I think. In the log I can see the VPN has connected, and Transmission Initialization Sequence Complete. My Diskstation IP is 192.168.2.22 and I am trying to use port 8899. My nginx.conf file at etc/nginx has the following content: events { worker_connections 1024; }

http { server { listen 8899; location / { proxy_pass http://192.168.2.22:9091; } } } To start nginx I am used the following, and had the following output:

DiskStation> docker run -d \

-v /path/to/nginx.conf:/etc/nginx/nginx.conf:ro \ -p 192.168.2.22:8899:8899 \ nginx Unable to find image 'nginx:latest' locally latest: Pulling from nginx 1e58eecba27a: Pull complete a0e9fe2f8803: Pull complete d4e3870153bf: Pull complete 7608c10ea730: Pull complete 5068080f8d28: Pull complete 556c463c2460: Pull complete 8d66bf39903a: Pull complete 6e36f46089ed: Pull complete nginx:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security. Digest: sha256:83be29bb91fc47f3a7453fc51db66816c9c637131f302a83dfd136e4b1901fbe Status: Downloaded newer image for nginx:latest ceb40e07049a428266423b52f1ca361a8348222d822cdf80c81b89c727945dd4 FATA[0022] Error response from daemon: Cannot start container ceb40e07049a428266423b52f1ca361a8348222d822cdf80c81b89c727945dd4: [8] System error: not a directory

The container does install and can be started. Here is the log - not sure if the listed error is a problem, but docker ps (below) tells me this is working I think:

Timestamp: 2016-02-17 19:13:03.452376616 -0700 MST Code: System error

Message: not a directory

Frames:

0: setupRootfs Package: github.com/docker/libcontainer

File: rootfs_linux.go@29

1: Init Package: github.com/docker/libcontainer.(*linuxStandardInit)

File: standard_init_linux.go@52

2: StartInitialization Package: github.com/docker/libcontainer.(*LinuxFactory)

File: factory_linux.go@223

3: initializer Package: github.com/docker/docker/daemon/execdriver/native File:

docker ps returns the following, so I think nginx is working:

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ceb40e07049a nginx:latest "nginx -g 'daemon of 38 minutes ago Up 11 minutes 80/tcp, 443/tcp, 0.0.0.0:8899->8899/tcp sad_fermat c5696582abe4 haugene/transmission-openvpn:latest "/etc/openvpn/start. 24 hours ago Up 16 seconds 0.0.0.0:9091->9091/tcp mad_payne

I can not get http://192.168.2.22:8899/transmission/web/ to work. I have disabled all firewalls and STILL no dice. Any help would sure be appreciated. I am using a DS 1815+.

haugene commented 8 years ago

This error: FATA[0022] Error response from daemon: Cannot start container ceb40e07049a428266423b52f1ca361a8348222d822cdf80c81b89c727945dd4: [8] System error: not a directory

Is probably because you're starting your nginx with a invalid path to your nginx.conf. You say that you have saved your nginx.conf at /etc/nginx.conf on the DS?

In your run command you haven't changed the path for where your config is. docker run -d \ -v /path/to/nginx.conf:/etc/nginx/nginx.conf:ro \ -p 192.168.2.22:8899:8899 \ nginx

You need to change /path/to/nginx.conf to be the actual path on your DS.

trevmlt commented 8 years ago

Yes, that worked perfectly. Rather ridiculous mistake on my part. One last question about the listening port in transmission. What should that be set to? Can it be any random high port, or does it have to be a specific port? Not sure with the proxy/container and everything else going on, what port should be used. Thank you very much for the help, and the work you have done on this. I wish I had a small fraction of the knowledge and ability you guys do!

haugene commented 8 years ago

Thank you, that's nice to say! We're all stumbling around I guess, until the stumble gets more stable and then you find another depth to stumble into :)

You are now speaking of the peer listening port found in settings in the WebUI right? You can just set that to a random high port. All ports on the container are open by default, when the container is accessed directly. It's only when you want to bind it to your hosts IP that you need to specify much for the ports. And the proxy is not playing a part here.

trevmlt commented 8 years ago

Well, I had it for a short period. It looks like something is going wrong in the nginx container that causes the WebUI to throw a Connection Failed can't connect to the server error. I attached both the Transmission OpenVPN log and nginx log if you want to have a look. Something in there might make sense to you. My VPN is USENETSERVER which I don't think many others are using. That may have something to do with this. Everything appeared to start up ok, but within a few seconds/minutes, connection is lost in the WebUI. The containers both continue to run. As far as the port goes, I was not able to get that open either. I left it at the default of 51413. I opened all ports on the host (192.168.2.22) and then forwarded 51413 on the router to 192.162.2.22 with both udp and tcp. Port never switch off Closed in web GUI. Shortly after that, I lost the connection to server in the GUI.

Transmission OpenVPN log.docx

nginx log.txt

trevmlt commented 8 years ago

As this looked like a possible problem with stability, I went back and removed everything, including Docker, and re-installed it all again. The 2 containers have been running, and the WebUI accessible for about 2 hours now. Port 51413 still indicates Closed. canyouseeme.org also fails when checking that port with my WAN IP. I have put in a couple of torrents to see if anything would happen, but as you can guess - it did not. Could the problem be on the USENETSERVER side? Thanks again haugene for your help, but maybe this is not fixable.

haugene commented 8 years ago

Ok, so now everything is running. And the only issue is that the port is closed? As you assumed, that port being closed has nothing to do with your local setup. Your transmission client is operating on the IP provided to you by USENETSERVER, and they will have to provide you with an open port.

Some providers do this. I use PIA, which has a web endpoint I can through the tunnel to retrieve an open port. I have scripted this into the container so that it checks and possibly changes my transmission port every hour.

This is the PIA page on ports: https://www.privateinternetaccess.com/forum/discussion/180/port-forwarding-without-the-application-advanced-users And this is my script: https://github.com/haugene/docker-transmission-openvpn/blob/master/transmission/updatePort.sh

If you find a similar service for USENETSERVER, you can try to make something similar to automatically set the port in Transmission.

trevmlt commented 8 years ago

Thanks again, for confirming this for me, as well as your time in helping me work through this. I will follow up with my provider, and close this issue.