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

Self-built docker unable to resolve host #19

Closed ab623 closed 9 years ago

ab623 commented 9 years ago

So I don't know if this is an issue or not, but I'm seeing some weird behaviour.

When I run the following default script, everything works fine.

$ docker run --privileged  -d \
              -v /your/storage/path/:/data \
              -e "PIA_USERNAME=user" \
              -e "PIA_PASSWORD=pass" \
              -p 9091:9091 \
              -e "OPEN_VPN_CONFIG=Netherlands" \
              haugene/transmission-openvpn

but if I do

$ git clone https://github.com/haugene/docker-transmission-openvpn
$ docker build -t="docker-transmission-openvpn" .

$ docker run --privileged  -d \
              -v /your/storage/path/:/data \
              -e "PIA_USERNAME=user" \
              -e "PIA_PASSWORD=pass" \
              -p 9091:9091 \
              -e "OPEN_VPN_CONFIG=Netherlands" \
              ocker-transmission-openvpn

I get the following messages when I run docker logs containerid

Starting OpenVPN using config Netherlands.ovpn
Overriding resolv.conf...
Setting PIA credentials...
Wed May 27 21:22:28 2015 OpenVPN 2.3.2 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [eurephia] [MH] [IPv6] built on Dec  1 2014
Wed May 27 21:22:28 2015 WARNING: file '/config/pia-credentials.txt' is group or others accessible
Wed May 27 21:22:28 2015 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Wed May 27 21:22:28 2015 RESOLVE: Cannot resolve host address: nl.privateinternetaccess.com: Temporary failure in name resolution
Wed May 27 21:22:28 2015 RESOLVE: Cannot resolve host address: nl.privateinternetaccess.com: Temporary failure in name resolution
Wed May 27 21:22:33 2015 RESOLVE: Cannot resolve host address: nl.privateinternetaccess.com: Temporary failure in name resolution

It won't connect at all, which is weird.

Any ideas?

haugene commented 9 years ago

There was some DNS issues in #4 Can you see what's inside /etc/resolv.conf? I'm guessing that your DNS server setup has gone wrong somehow. If that is the case, as you can see in issue 4 there is a workaround for this. See RESOLV_OVERRIDE parameter described in README. Related: https://github.com/docker/docker/issues/541

ab623 commented 9 years ago

Did you notice that the script was trying to set the resolv.conf file even though I didn't specify the ENV variable.

Overriding resolv.conf...

I went to the transmission/start.sh and commented out the following line (23): # printf "$RESOLV_OVERRIDE" > /etc/resolv.conf

and i had no issues building and running the container.

I think there's an issue with the ENV variable setting the wrong info. Is this becuase its not wrapped in {}?

haugene commented 9 years ago

The {} wrapping in environment-variables.sh file is only for transmission related settings. The resolv override happens before this.

I haven't seen that error before, no. It doesn't occur on my host (running xubuntu), and as you say it doesn't happen in the trusted build images either. So it's probably something on your host system?

ab623 commented 9 years ago

I'll run an apt-get upgrade to see if there are any recent docker changes, and will try again. Thanks

ab623 commented 9 years ago

Updated docker version and this resolved this issue. Raised PR #21 to ensure this wont happen again to future people.