OpenMediaVault-Plugin-Developers / openmediavault-docker-gui

Docker plugin for OpenMediaVault
32 stars 17 forks source link

Not working with Open VPN plugin #34

Closed gubagu closed 6 years ago

gubagu commented 7 years ago

Hey there,

Wonderful plugin great addition to omv and it is not NAS anymore but a nas and application server. cool ! really cool, thanks for that. Lately was struggling to get Openmediavault-openvpn 1.1 and Openmediavault-docker-gui 0.2.22 working on the same omv instance. Still not working as it should. If the Docker plugin is installed first then ovpn is not working. I finally got them working but the docker GUI is not working now. I get the folloowing error:

Error: "couldn't connect to host" - Code: 7

Error #0:
exception 'OMVModuleDockerException' with message 'Error: "couldn't connect to host" - Code: 7' in /usr/share/omvdocker/Utils.php:63
Stack trace:
#0 /usr/share/omvdocker/Utils.php(180): OMVModuleDockerUtil::doApiCall('http://localhos...')
#1 /usr/share/openmediavault/engined/rpc/docker.inc(354): OMVModuleDockerUtil::getContainers('42015')
#2 [internal function]: OMVRpcServiceDocker->getContainers(Array, Array)
#3 /usr/share/php/openmediavault/rpcservice.inc(125): call_user_func_array(Array, Array)
#4 /usr/share/php/openmediavault/rpc.inc(79): OMVRpcServiceAbstract->callMethod('getContainers', Array, Array)
#5 /usr/sbin/omv-engined(500): OMVRpc::exec('Docker', 'getContainers', Array, Array, 1)
#6 {main}

I know that once you have docker plugin installed and then ovpn iptables redirection rules get quirky. Ovpn does not work because redirects traffic to docker0 IP instead to the local network. On the other hand if you install the ovpn first and configure it. then install the docker gui and enable it you get the error above but you can still manage the images and the containers through the ssh. So docker works good just the interface crashes. Any suggestions how to fix that ?

Thanks in advance !

Guby

nicjo814 commented 7 years ago

I'm sorry but I don't have a solution for you. I had lots of issues with iptables/routing when creating an OpenVPN Docker container. Docker relies a lot on iptables and I guess the OpenVPN plugin might very well mess with the rules required by Docker. The plugin itself tries to use a socket listening on localhost with a port specified by the user. If the traffic somehow is redirected so it can't reach that port, the communication would fail like you describe. Don't know how to fix this issue in your setup though.

gubagu commented 7 years ago

No worries mate, terminal is just fine. I will try some solutions and will let you know if I succeed. The plugin on its own works great ! Great job ! It would be even greater if supports docker-compose 😃

nicjo814 commented 7 years ago

Just found this: https://github.com/OpenMediaVault-Plugin-Developers/openmediavault-openvpn/pull/10 which might be a fix for your problem.