Streisand: Installation failure at ocserv: Dependency failed for OpenConnect

Created on 20 Aug 2018  ·  5Comments  ·  Source: StreisandEffect/streisand

After I never encountered installation issues for like two years, the installation stops while trying to install ocserv. I use an Ubuntu 16.04 VPS:

TASK [openconnect : Install ocserv] ****************
fatal: [localhost]: FAILED! => {"cache_update_time": 1534802009, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\" install 'ocserv'' failed: E: Sub-process /usr/bin/dpkg returned an error code (1)\n", "rc": 100, "stderr": "E: Sub-process /usr/bin/dpkg returned an error code (1)\n", "stderr_lines": ["E: Sub-process /usr/bin/dpkg returned an error code (1)"], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nThe following additional packages will be installed:\n libhttp-parser2.1 liboath0 libpcl1 libtalloc2\nThe following NEW packages will be installed:\n libhttp-parser2.1 liboath0 libpcl1 libtalloc2 ocserv\n0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.\nNeed to get 0 B/272 kB of archives.\nAfter this operation, 895 kB of additional disk space will be used.\nSelecting previously unselected package libhttp-parser2.1:amd64.\r\n(Reading database ... \r(Reading database ... 5%\r(Reading database ... 10%\r(Reading database ... 15%\r(Reading database ... 20%\r(Reading database ... 25%\r(Reading database ... 30%\r(Reading database ... 35%\r(Reading database ... 40%\r(Reading database ... 45%\r(Reading database ... 50%\r(Reading database ... 55%\r(Reading database ... 60%\r(Reading database ... 65%\r(Reading database ... 70%\r(Reading database ... 75%\r(Reading database ... 80%\r(Reading database ... 85%\r(Reading database ... 90%\r(Reading database ... 95%\r(Reading database ... 100%\r(Reading database ... 97449 files and directories currently installed.)\r\nPreparing to unpack .../libhttp-parser2.1_2.1-2_amd64.deb ...\r\nUnpacking libhttp-parser2.1:amd64 (2.1-2) ...\r\nSelecting previously unselected package liboath0.\r\nPreparing to unpack .../liboath0_2.6.1-1_amd64.deb ...\r\nUnpacking liboath0 (2.6.1-1) ...\r\nSelecting previously unselected package libpcl1.\r\nPreparing to unpack .../libpcl1_1.6-1ubuntu1_amd64.deb ...\r\nUnpacking libpcl1 (1.6-1ubuntu1) ...\r\nSelecting previously unselected package libtalloc2:amd64.\r\nPreparing to unpack .../libtalloc2_2.1.5-2_amd64.deb ...\r\nUnpacking libtalloc2:amd64 (2.1.5-2) ...\r\nSelecting previously unselected package ocserv.\r\nPreparing to unpack .../ocserv_0.10.11-1build1_amd64.deb ...\r\nUnpacking ocserv (0.10.11-1build1) ...\r\nProcessing triggers for libc-bin (2.23-0ubuntu10) ...\r\nProcessing triggers for man-db (2.7.5-1) ...\r\nProcessing triggers for systemd (229-4ubuntu21.4) ...\r\nProcessing triggers for ureadahead (0.100.0-19) ...\r\nSetting up libhttp-parser2.1:amd64 (2.1-2) ...\r\nSetting up liboath0 (2.6.1-1) ...\r\nSetting up libpcl1 (1.6-1ubuntu1) ...\r\nSetting up libtalloc2:amd64 (2.1.5-2) ...\r\nSetting up ocserv (0.10.11-1build1) ...\r\nA dependency job for ocserv.service failed. See 'journalctl -xe' for details.\r\ninvoke-rc.d: initscript ocserv, action \"start\" failed.\r\n
ocserv.service - OpenConnect SSL VPN server\r\n Loaded: loaded (/lib/systemd/system/ocserv.service; enabled; vendor preset: enabled)\r\n Active: inactive (dead)\r\n Docs: man:ocserv(8)\r\n\r\nAug 20 21:28:58 v0 systemd[1]: Stopped OpenConnect SSL VPN server.\r\nAug 20 21:31:51 v0 systemd[1]: \u001b[0;1;39mDependency failed for OpenConnect SSL VPN server.\u001b[0m\r\nAug 20 21:31:51 v0 systemd[1]: \u001b[0;1;39mocserv.service: Job ocserv.service/start fai...'.\u001b[0m\r\nAug 20 21:38:09 v0 systemd[1]: \u001b[0;1;39mDependency failed for OpenConnect SSL VPN server.\u001b[0m\r\nAug 20 21:38:09 v0 systemd[1]: \u001b[0;1;39mocserv.service: Job ocserv.service/start fai...'.\u001b[0m\r\nAug 20 21:50:54 v0 systemd[1]: \u001b[0;1;39mDependency failed for OpenConnect SSL VPN server.\u001b[0m\r\nAug 20 21:50:54 v0 systemd[1]: \u001b[0;1;39mocserv.service: Job ocserv.service/start fai...'.\u001b[0m\r\nAug 20 21:51:18 v0 systemd[1]: Stopped OpenConnect SSL VPN server.\r\nAug 20 21:55:00 v0 systemd[1]: \u001b[0;1;39mDependency failed for OpenConnect SSL VPN server.\u001b[0m\r\nAug 20 21:55:00 v0 systemd[1]: \u001b[0;1;39mocserv.service: Job ocserv.service/start fai...'.\u001b[0m\r\nHint: Some lines were ellipsized, use -l to show in full.\r\ndpkg: error processing package ocserv (--configure):\r\n subprocess installed post-installation script returned error exit status 1\r\nProcessing triggers for libc-bin (2.23-0ubuntu10) ...\r\nErrors were encountered while processing:\r\n ocserv\r\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "The following additional packages will be installed:", " libhttp-parser2.1 liboath0 libpcl1 libtalloc2", "The following NEW packages will be installed:", " libhttp-parser2.1 liboath0 libpcl1 libtalloc2 ocserv", "0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.", "Need to get 0 B/272 kB of archives.", "After this operation, 895 kB of additional disk space will be used.", "Selecting previously unselected package libhttp-parser2.1:amd64.", "(Reading database ... ", "(Reading database ... 5%", "(Reading database ... 10%", "(Reading database ... 15%", "(Reading database ... 20%", "(Reading database ... 25%", "(Reading database ... 30%", "(Reading database ... 35%", "(Reading database ... 40%", "(Reading database ... 45%", "(Reading database ... 50%", "(Reading database ... 55%", "(Reading database ... 60%", "(Reading database ... 65%", "(Reading database ... 70%", "(Reading database ... 75%", "(Reading database ... 80%", "(Reading database ... 85%", "(Reading database ... 90%", "(Reading database ... 95%", "(Reading database ... 100%", "(Reading database ... 97449 files and directories currently installed.)", "Preparing to unpack .../libhttp-parser2.1_2.1-2_amd64.deb ...", "Unpacking libhttp-parser2.1:amd64 (2.1-2) ...", "Selecting previously unselected package liboath0.", "Preparing to unpack .../liboath0_2.6.1-1_amd64.deb ...", "Unpacking liboath0 (2.6.1-1) ...", "Selecting previously unselected package libpcl1.", "Preparing to unpack .../libpcl1_1.6-1ubuntu1_amd64.deb ...", "Unpacking libpcl1 (1.6-1ubuntu1) ...", "Selecting previously unselected package libtalloc2:amd64.", "Preparing to unpack .../libtalloc2_2.1.5-2_amd64.deb ...", "Unpacking libtalloc2:amd64 (2.1.5-2) ...", "Selecting previously unselected package ocserv.", "Preparing to unpack .../ocserv_0.10.11-1build1_amd64.deb ...", "Unpacking ocserv (0.10.11-1build1) ...", "Processing triggers for libc-bin (2.23-0ubuntu10) ...", "Processing triggers for man-db (2.7.5-1) ...", "Processing triggers for systemd (229-4ubuntu21.4) ...", "Processing triggers for ureadahead (0.100.0-19) ...", "Setting up libhttp-parser2.1:amd64 (2.1-2) ...", "Setting up liboath0 (2.6.1-1) ...", "Setting up libpcl1 (1.6-1ubuntu1) ...", "Setting up libtalloc2:amd64 (2.1.5-2) ...", "Setting up ocserv (0.10.11-1build1) ...", "A dependency job for ocserv.service failed. See 'journalctl -xe' for details.", "invoke-rc.d: initscript ocserv, action \"start\" failed.", "* ocserv.service - OpenConnect SSL VPN server", " Loaded: loaded (/lib/systemd/system/ocserv.service; enabled; vendor preset: enabled)", " Active: inactive (dead)", " Docs: man:ocserv(8)", "", "Aug 20 21:28:58 v0 systemd[1]: Stopped OpenConnect SSL VPN server.", "Aug 20 21:31:51 v0 systemd[1]: \u001b[0;1;39mDependency failed for OpenConnect SSL VPN server.\u001b[0m", "Aug 20 21:31:51 v0 systemd[1]: \u001b[0;1;39mocserv.service: Job ocserv.service/start fai...'.\u001b[0m", "Aug 20 21:38:09 v0 systemd[1]: \u001b[0;1;39mDependency failed for OpenConnect SSL VPN server.\u001b[0m", "Aug 20 21:38:09 v0 systemd[1]: \u001b[0;1;39mocserv.service: Job ocserv.service/start fai...'.\u001b[0m", "Aug 20 21:50:54 v0 systemd[1]: \u001b[0;1;39mDependency failed for OpenConnect SSL VPN server.\u001b[0m", "Aug 20 21:50:54 v0 systemd[1]: \u001b[0;1;39mocserv.service: Job ocserv.service/start fai...'.\u001b[0m", "Aug 20 21:51:18 v0 systemd[1]: Stopped OpenConnect SSL VPN server.", "Aug 20 21:55:00 v0 systemd[1]: \u001b[0;1;39mDependency failed for OpenConnect SSL VPN server.\u001b[0m", "Aug 20 21:55:00 v0 systemd[1]: \u001b[0;1;39mocserv.service: Job ocserv.service/start fai...'.\u001b[0m", "Hint: Some lines were ellipsized, use -l to show in full.", "dpkg: error processing package ocserv (--configure):", " subprocess installed post-installation script returned error exit status 1", "Processing triggers for libc-bin (2.23-0ubuntu10) ...", "Errors were encountered while processing:", " ocserv"]}
to retry, use: --limit @/root/streisand/playbooks/localhost.retry

Ansible Information

  • Ansible version: 2.5.4
  • Ansible system: Linux
  • Host OS: Ubuntu
  • Host OS version: 16.04
  • Python interpreter: /usr/bin/python
  • Python version: 2.7.12

Streisand Information

  • Streisand Git revision: 1d8ee35e16f350737a783c967c669ba462d6334f
  • Streisand Git clone has untracked changes: no
  • Genesis role: localhost
  • Custom SSH key: False

Enabled Roles

  • Shadowsocks enabled: True
  • Wireguard enabled: True
  • OpenVPN enabled: True
  • stunnel enabled: True
  • Tor enabled: False
  • Openconnect enabled: True
  • TinyProxy enabled: True
  • SSH forward user enabled: True
  • Configured number of VPN clients: 5

Most helpful comment

@nopdotcom @TheNomad11

TLDR;
you probably have another service (like nginx) listening on port 443, stop it and re-run the installation.

I had the same problem, after checking journalctl using sudo journalctl -xe I found out that ocserv was not able to start because its port was used (port 443).

Then I remembered that I have an nginx on the machine, and it's using port 443 for HTTPS. I turned it off using sudo systemctl stop nginx and re-ran the installation.

All 5 comments

After many attempts to make it work a reinstall helped :)

Heh. Reopen if it happens again? I'm a little worried about systemd hating us.

@nopdotcom @TheNomad11

same problem here,
I have tried to install ocserv this way: https://www.vultr.com/docs/setup-openconnect-vpn-server-for-cisco-anyconnect-on-ubuntu-14-04-x64
but i get these outputs:
https://pastebin.com/MFBSW5Cx

A dependency job for ocserv.service failed. See 'journalctl -xe' for details.
invoke-rc.d: initscript ocserv, action "start" failed.
● ocserv.service - OpenConnect SSL VPN server
Loaded: loaded (/lib/systemd/system/ocserv.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:ocserv(8)
Jun 18 08:09:59 localhost systemd[1]: Dependency failed for OpenConnect SSL...r.
Jun 18 08:09:59 localhost systemd[1]: ocserv.service: Job ocserv.service/st...'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package ocserv (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.23-0ubuntu11) ...
Processing triggers for ureadahead (0.100.0-19.1) ...
Processing triggers for systemd (229-4ubuntu21.21) ...
Errors were encountered while processing:
ocserv
E: Sub-process /usr/bin/dpkg returned an error code (1)

any solutions ?

@nopdotcom @TheNomad11

same problem here,
I have tried to install ocserv this way: https://www.vultr.com/docs/setup-openconnect-vpn-server-for-cisco-anyconnect-on-ubuntu-14-04-x64
but i get these outputs:
https://pastebin.com/MFBSW5Cx

A dependency job for ocserv.service failed. See 'journalctl -xe' for details.
invoke-rc.d: initscript ocserv, action "start" failed.
● ocserv.service - OpenConnect SSL VPN server
Loaded: loaded (/lib/systemd/system/ocserv.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:ocserv(8)
Jun 18 08:09:59 localhost systemd[1]: Dependency failed for OpenConnect SSL...r.
Jun 18 08:09:59 localhost systemd[1]: ocserv.service: Job ocserv.service/st...'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package ocserv (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.23-0ubuntu11) ...
Processing triggers for ureadahead (0.100.0-19.1) ...
Processing triggers for systemd (229-4ubuntu21.21) ...
Errors were encountered while processing:
ocserv
E: Sub-process /usr/bin/dpkg returned an error code (1)

any solutions ?

check this

https://www.linuxbabe.com/ubuntu/openconnect-vpn-server-ocserv-ubuntu-16-04-17-10-lets-encrypt

@nopdotcom @TheNomad11

TLDR;
you probably have another service (like nginx) listening on port 443, stop it and re-run the installation.

I had the same problem, after checking journalctl using sudo journalctl -xe I found out that ocserv was not able to start because its port was used (port 443).

Then I remembered that I have an nginx on the machine, and it's using port 443 for HTTPS. I turned it off using sudo systemctl stop nginx and re-ran the installation.

Was this page helpful?
0 / 5 - 0 ratings