Spirals-Team / docker-machine-driver-g5k

Docker Machine driver for the Grid'5000 testbed infrastructure.
https://www.grid5000.fr
Apache License 2.0
13 stars 5 forks source link

Error with pre-create check: "Connection to frontend of 'luxembourg' site failed using docker-machine on Grid5000 #28

Closed adagolodjo closed 5 years ago

adagolodjo commented 5 years ago

Hi everyone, I am trying to use docker-machine for the grid5000. When I do "sudo openvpn Grid5000_VPN.ovpn" I got this :

Mon Mar 18 13:46:58 2019 OpenVPN 2.4.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Sep  5 2018
Mon Mar 18 13:46:58 2019 library versions: OpenSSL 1.1.0g  2 Nov 2017, LZO 2.08
Mon Mar 18 13:46:58 2019 WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Mon Mar 18 13:46:58 2019 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Mon Mar 18 13:46:58 2019 TCP/UDP: Preserving recently used remote address: [AF_INET]194.254.60.36:443
Mon Mar 18 13:46:58 2019 Attempting to establish TCP connection with [AF_INET]194.254.60.36:443 [nonblock]
Mon Mar 18 13:46:59 2019 TCP connection established with [AF_INET]194.254.60.36:443
Mon Mar 18 13:46:59 2019 TCP_CLIENT link local: (not bound)
Mon Mar 18 13:46:59 2019 TCP_CLIENT link remote: [AF_INET]194.254.60.36:443
Mon Mar 18 13:46:59 2019 [vpn.grid5000.fr] Peer Connection Initiated with [AF_INET]194.254.60.36:443
Mon Mar 18 13:47:00 2019 TUN/TAP device tun0 opened
Mon Mar 18 13:47:00 2019 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Mon Mar 18 13:47:00 2019 /sbin/ip link set dev tun0 up mtu 1500
Mon Mar 18 13:47:00 2019 /sbin/ip addr add dev tun0 172.20.64.6/18 broadcast 172.20.127.255
Mon Mar 18 13:47:00 2019 /etc/openvpn/update-resolv-conf tun0 1500 1554 172.20.64.6 255.255.192.0 init
RTNETLINK answers: File exists
Mon Mar 18 13:47:00 2019 ERROR: Linux route add command failed: external program exited with error status: 2
Mon Mar 18 13:47:00 2019 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Mon Mar 18 13:47:00 2019 Initialization Sequence Completed

But when I used the first an example given in the section "Usage examples", of course I changed the username and the password to correspond to mine : https://github.com/Spirals-Team/docker-machine-driver-g5k I got this :

Running pre-create checks...
Error with pre-create check: Connection to frontend of 'luxembourg' site failed. Please check if the site is not undergoing maintenance and your VPN client is connected and properly configured (see driver documentation for more information)".

I tried the frontend 'lille', 'lyon' and all the rest I still have the same error. Thanks in advance for your help

gfieni commented 5 years ago

Hello, Your VPN configuration seems to be invalid, you can see the following errors in OpenVPN log:

Mon Mar 18 13:47:00 2019 /etc/openvpn/update-resolv-conf tun0 1500 1554 172.20.64.6 255.255.192.0 init
RTNETLINK answers: File exists
Mon Mar 18 13:47:00 2019 ERROR: Linux route add command failed: external program exited with error status: 2

Please check if your OpenVPN configuration file follows the instructions on the Grid'5000 wiki.

adagolodjo commented 5 years ago

I am using the one I downloaded from my grid5000 page (created following the tutorial on ). I also tried to comment the udp and uncomment tcp. It does not change anything

adagolodjo commented 5 years ago

I cleaned up the docker Ethernet and it resolve the first part of my problem, I have now :

Mon Mar 18 17:12:43 2019 OpenVPN 2.4.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Sep  5 2018
Mon Mar 18 17:12:43 2019 library versions: OpenSSL 1.1.0g  2 Nov 2017, LZO 2.08
Mon Mar 18 17:12:43 2019 WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Mon Mar 18 17:12:43 2019 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Mon Mar 18 17:12:43 2019 TCP/UDP: Preserving recently used remote address: [AF_INET]194.254.60.36:1194
Mon Mar 18 17:12:43 2019 UDP link local (bound): [AF_INET][undef]:1194
Mon Mar 18 17:12:43 2019 UDP link remote: [AF_INET]194.254.60.36:1194
Mon Mar 18 17:12:43 2019 [vpn.grid5000.fr] Peer Connection Initiated with [AF_INET]194.254.60.36:1194
Mon Mar 18 17:12:45 2019 TUN/TAP device tun0 opened
Mon Mar 18 17:12:45 2019 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Mon Mar 18 17:12:45 2019 /sbin/ip link set dev tun0 up mtu 1500
Mon Mar 18 17:12:45 2019 /sbin/ip addr add dev tun0 172.20.192.1/18 broadcast 172.20.255.255
Mon Mar 18 17:12:45 2019 /etc/openvpn/update-resolv-conf tun0 1500 1552 172.20.192.1 255.255.192.0 init
Mon Mar 18 17:12:45 2019 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Mon Mar 18 17:12:45 2019 Initialization Sequence Completed

But I still can use your examples

adagolodjo commented 5 years ago

Sorry : But I still "can't" use your examples

gfieni commented 5 years ago

What is your Linux distribution and its version ?

adagolodjo commented 5 years ago

I am using Ubuntu 18.04.2 LTS

gfieni commented 5 years ago

Hello, Can you install the following package:

sudo apt install openvpn-systemd-resolved

And update the up and down parameters of your OpenVPN configuration file with the following values:

up /etc/openvpn/update-systemd-resolved
down /etc/openvpn/update-systemd-resolved

And retry using the driver.

adagolodjo commented 5 years ago

Thanks, It works