OpenZiti Tunneler on Ubuntu 18 LTS

Hi,
I tried to install the tunneler but I get the following error.

#systemctl enable --now ziti-edge-tunnel.service
The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
   instance name specified.
Job for ziti-edge-tunnel.service failed because the control process exited with error code.
See "systemctl status ziti-edge-tunnel.service" and "journalctl -xe" for details.


#systemctl status ziti-edge-tunnel.service
โ— ziti-edge-tunnel.service - Ziti Edge Tunnel
   Loaded: loaded (/opt/openziti/share/ziti-edge-tunnel.service; static; vendor preset: enabled)
  Drop-In: /lib/systemd/system/ziti-edge-tunnel.service.d
           โ””โ”€10-run-as-root.conf
   Active: activating (start-pre) since Mon 2023-09-11 13:09:01 +03; 14s ago
Cntrl PID: 28244 (sh)
    Tasks: 6 (limit: 4657)
   CGroup: /system.slice/ziti-edge-tunnel.service
           โ”œโ”€28244 sh /opt/openziti/bin/ziti-edge-tunnel.sh
           โ””โ”€28248 /opt/openziti/bin/ziti-edge-tunnel enroll --jwt /opt/openziti/etc/identities/erp.jwt --identity /opt/openziti/etc/identities/erp.json

11 13:09:01 erp systemd[1]: ziti-edge-tunnel.service: Service hold-off time over, scheduling restart.
11 13:09:01 erp systemd[1]: ziti-edge-tunnel.service: Scheduled restart job, restart counter is at 19.
11 13:09:01 erp systemd[1]: Stopped Ziti Edge Tunnel.
11 13:09:01 erp systemd[1]: Starting Ziti Edge Tunnel...
11 13:09:01 erp ziti-edge-tunnel.sh[28244]: (28248)[        0.000]    INFO ziti-sdk:utils.c:188 ziti_log_set_level() set log level: root=3/INFO
11 13:09:01 erp ziti-edge-tunnel.sh[28244]: (28248)[        0.000]    INFO ziti-sdk:utils.c:188 ziti_log_set_level() set log level: root=3/INFO
11 13:09:01 erp ziti-edge-tunnel.sh[28244]: (28248)[        0.000]    INFO ziti-sdk:ziti_enroll.c:92 ziti_enroll() Ziti C SDK version 0.33.4 @27bac90(HEAD) starting enrollment at (202


#journalctl -xe
--
-- Unit ziti-edge-tunnel.service has finished shutting down.
11 13:11:09 erp systemd[1]: Starting Ziti Edge Tunnel...
-- Subject: Unit ziti-edge-tunnel.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit ziti-edge-tunnel.service has begun starting up.
11 13:11:09 erp ziti-edge-tunnel.sh[28391]: (28395)[        0.000]    INFO ziti-sdk:utils.c:188 ziti_log_set_level() set log level: root=3/INFO
11 13:11:09 erp ziti-edge-tunnel.sh[28391]: (28395)[        0.000]    INFO ziti-sdk:utils.c:188 ziti_log_set_level() set log level: root=3/INFO
11 13:11:09 erp ziti-edge-tunnel.sh[28391]: (28395)[        0.000]    INFO ziti-sdk:ziti_enroll.c:92 ziti_enroll() Ziti C SDK version 0.33.4 @27bac90(HEAD) starting enrollment at (2023-09-11T10:11:09.369)
11 13:11:24 erp ziti-edge-tunnel.sh[28391]: (28395)[       15.010]   ERROR ziti-sdk:ziti_ctrl.c:154 ctrl_resp_cb() ctrl[openziti] request failed: -110(connection timed out)
11 13:11:24 erp ziti-edge-tunnel.sh[28391]: (28395)[       15.010]   ERROR ziti-sdk:ziti_enroll.c:222 well_known_certs_cb() /github/workspace/build/_deps/ziti-sdk-c-src/library/ziti_enroll.c:141 - ZITI_JWT_VERIFICATION_FAILED => -7 (JWT verificatio
11 13:11:24 erp ziti-edge-tunnel.sh[28391]: (28395)[       15.010]   ERROR ziti-edge-tunnel:ziti-edge-tunnel.c:2137 enroll_cb() enrollment failed: CONTROLLER_UNAVAILABLE(-7)
11 13:11:24 erp ziti-edge-tunnel.sh[28391]: ERROR: failed to enroll erp.jwt in /opt/openziti/etc/identities
11 13:11:24 erp systemd[1]: ziti-edge-tunnel.service: Control process exited, code=exited status=1
11 13:11:24 erp systemd[1]: ziti-edge-tunnel.service: Failed with result 'exit-code'.
11 13:11:24 erp systemd[1]: Failed to start Ziti Edge Tunnel.
-- Subject: Unit ziti-edge-tunnel.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit ziti-edge-tunnel.service has failed.
--
-- The result is RESULT.
11 13:11:27 erp systemd[1]: ziti-edge-tunnel.service: Service hold-off time over, scheduling restart.
11 13:11:27 erp systemd[1]: ziti-edge-tunnel.service: Scheduled restart job, restart counter is at 27.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit ziti-edge-tunnel.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
11 13:11:27 erp systemd[1]: Stopped Ziti Edge Tunnel.
-- Subject: Unit ziti-edge-tunnel.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit ziti-edge-tunnel.service has finished shutting down.
11 13:11:27 erp systemd[1]: Starting Ziti Edge Tunnel...
-- Subject: Unit ziti-edge-tunnel.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit ziti-edge-tunnel.service has begun starting up.
11 13:11:27 erp ziti-edge-tunnel.sh[28408]: (28412)[        0.000]    INFO ziti-sdk:utils.c:188 ziti_log_set_level() set log level: root=3/INFO
11 13:11:27 erp ziti-edge-tunnel.sh[28408]: (28412)[        0.000]    INFO ziti-sdk:utils.c:188 ziti_log_set_level() set log level: root=3/INFO
11 13:11:27 erp ziti-edge-tunnel.sh[28408]: (28412)[        0.000]    INFO ziti-sdk:ziti_enroll.c:92 ziti_enroll() Ziti C SDK version 0.33.4 @27bac90(HEAD) starting enrollment at (2023-09-11T10:11:27.614)
~


System default target and [Install] section

#systemctl get-default
graphical.target

#vi /lib/systemd/system/ziti-edge-tunnel.service
...
[Install]
WantedBy=multi-user.target

Thank you

Hello, and thanks for letting us know that you ran into this!

I tried installing on ubuntu 18, and I see the same thing. I'm not sure if this is the fix that we'll go with in the next release of the package, but I discovered that I was able to work around the issue by replacing the unit file /lib/systemd/system/ziti-edge-tunnel.service which is a symlink with an actual file.

Here's what I did:

sudo mv /lib/systemd/system/ziti-edge-tunnel.service /lib/systemd/system/ziti-edge-tunnel.service.symlink
sudo cp /lib/systemd/system/ziti-edge-tunnel.service.symlink /lib/systemd/system/ziti-edge-tunnel.service
sudo systemctl daemon-reload
sudo systemctl enable --now ziti-edge-tunnel

I'll do some more digging to figure out why the symlink is a problem and let you know what I find. Hopefully we can get an updated package out in a day or two.

Hi,
Thank you very much.
Ah, may be the symlink was not created properly during installation.
Thank you so much for your help.

The symlink seems correct. At least it's possible to systemctl cat ziti-edge-tunnel while the symlink is in place. I think the issue is that the version of systemd on ubuntu 18 (possibly older also?) is fussy about symlinks and/or unit file location. Brings to mind this issue: After disable the service, the service can no longer be enabled ยท Issue #603 ยท openziti/ziti-tunnel-sdk-c ยท GitHub

1 Like
1 Like

Thank you very mush for explanation.
Most of the systems I think were upgraded to 20 and 22 LTS but few systems can't be upgraded (for obvious reasons). So that is why I tested Edge client on 18.
Thank you again.