OpenVPN 4.0.3 - Error when adding DNS

    • OMV 4.x
    • Resolved

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • OpenVPN 4.0.3 - Error when adding DNS

      Hi, I just stumbled in the following error while trying to add DNS addresses to my OpenVPN configuration:


      Source Code

      1. Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; omv-mkconf openvpn setup 2>&1' with exit code '2': /usr/share/openmediavault/mkconf/openvpn: line 46: 5 - ( / 8) : syntax error: operand expected (error token is "/ 8) ") iptables v1.6.0: option "--to" requires an argument Try `iptables -h' or 'iptables --help' for more information.
      2. Error #0:
      3. OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; omv-mkconf openvpn setup 2>&1' with exit code '2': /usr/share/openmediavault/mkconf/openvpn: line 46: 5 - ( / 8) : syntax error: operand expected (error token is "/ 8) ")
      4. iptables v1.6.0: option "--to" requires an argument
      5. Try `iptables -h' or 'iptables --help' for more information. in /usr/share/php/openmediavault/system/process.inc:182
      6. Stack trace:
      7. #0 /usr/share/openmediavault/engined/module/openvpn.inc(88): OMV\System\Process->execute()
      8. #1 /usr/share/openmediavault/engined/rpc/config.inc(168): OMV\Engined\Module\OpenVpn->applyConfig()
      9. #2 [internal function]: OMVRpcServiceConfig->applyChanges(Array, Array)
      10. #3 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)
      11. #4 /usr/share/php/openmediavault/rpc/serviceabstract.inc(149): OMV\Rpc\ServiceAbstract->callMethod('applyChanges', Array, Array)
      12. #5 /usr/share/php/openmediavault/rpc/serviceabstract.inc(565): OMV\Rpc\ServiceAbstract->OMV\Rpc\{closure}('/tmp/bgstatusDm...', '/tmp/bgoutputtw...')
      13. #6 /usr/share/php/openmediavault/rpc/serviceabstract.inc(159): OMV\Rpc\ServiceAbstract->execBgProc(Object(Closure))
      14. #7 /usr/share/openmediavault/engined/rpc/config.inc(213): OMV\Rpc\ServiceAbstract->callMethodBg('applyChanges', Array, Array)
      15. #8 [internal function]: OMVRpcServiceConfig->applyChangesBg(Array, Array)
      16. #9 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)
      17. #10 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('applyChangesBg', Array, Array)
      18. #11 /usr/sbin/omv-engined(536): OMV\Rpc\Rpc::call('Config', 'applyChangesBg', Array, Array, 1)
      19. #12 {main}
      Display All
      The only possible action was to revert the changes and leave the DNS field empty.
    • Actually it seems that the problem is much wider than I thought as I noticed that after I got that error OpenVPN doesn't restart anymore.
      I see that there's an error thrown by the iptables command, I'm not sure if that's related to some change in the options of the iptables commands, I didn't have time to investigate any further.
    • Ok I just figured out the issue, so I will post here the solution in case someone falls into the same problem.
      This issue happens when OpenVPN is configured on a given interface (mine was set to eno1) and then the gateway interface gets changed, for instance when a bond interface gets configured (in fact that's what I've done). In such cases the OpenVPN plugin doesn't detect the change automatically, so the startup script fails by throwing a BASH error which is not extremely clear.
      To solve the problem it's enough to change the gateway interface with the newly created one and run a stop and start of the OpenVPN service.