zerotier / ZeroTierOne

A Smart Ethernet Switch for Earth
https://zerotier.com
Other
14.38k stars 1.68k forks source link

Can't start on Ubuntu 18.04 #1050

Closed absudabsu closed 5 years ago

absudabsu commented 5 years ago

I've used Zerotier for a few years, and it has always worked flawlessly installing from the curl/bash script on the website. However, this time on Ubuntu I am having problems starting it up.

meohboy@mypc:~$ sudo systemctl status zerotier-one.service
● zerotier-one.service - ZeroTier One
   Loaded: loaded (/lib/systemd/system/zerotier-one.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2019-10-02 22:15:23 PDT; 6min ago
  Process: 15810 ExecStart=/usr/sbin/zerotier-one (code=exited, status=1/FAILURE)
 Main PID: 15810 (code=exited, status=1/FAILURE)

Oct 02 22:15:23 mypc systemd[1]: zerotier-one.service: Service hold-off time over, scheduling rest
Oct 02 22:15:23 mypc systemd[1]: zerotier-one.service: Scheduled restart job, restart counter is a
Oct 02 22:15:23 mypc systemd[1]: Stopped ZeroTier One.
Oct 02 22:15:23 mypc systemd[1]: zerotier-one.service: Start request repeated too quickly.
Oct 02 22:15:23 mypc systemd[1]: zerotier-one.service: Failed with result 'exit-code'.
Oct 02 22:15:23 mypc systemd[1]: Failed to start ZeroTier One.

Any ideas? How do I debug and find the cause?

absudabsu commented 5 years ago

Here's what happens when I call the program directly:

meohboy@mypc:~$ sudo /usr/sbin/zerotier-one
/usr/sbin/zerotier-one: fatal error: cannot bind to local control interface port

Now what?

janjaapbos commented 5 years ago

Looks like you have another program / service that binds to localhost port 9993. Check it with lsof -i :9993

janjaapbos commented 5 years ago

sudo lsof -i :9993

absudabsu commented 5 years ago

This is what I get:

$ sudo lsof -i :9993
COMMAND     PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
zerotier- 15762 root    6u  IPv4  192074      0t0  TCP localhost:9993 (LISTEN)
zerotier- 15762 root    7u  IPv6  192075      0t0  TCP ip6-localhost:9993 (LISTEN)
zerotier- 15762 root    8u  IPv4  227710      0t0  UDP mypc:9993 
zerotier- 15762 root   10u  IPv4 1053788      0t0  UDP mypc:9993 
zerotier- 15762 root   11u  IPv4 1053789      0t0  TCP mypc:9993 (LISTEN)
zerotier- 15762 root   21u  IPv4  227711      0t0  TCP mypc:9993 (LISTEN)

Looks reasonable? What now?

janjaapbos commented 5 years ago

Perhaps there is no problem, just systemd thinks there is? Or something else started zerotier-one, before systemd tried to do it?

Does zerotier-cli work correctly? Can you join networks?

absudabsu commented 5 years ago

Unfortunately, no. That's what got me to look at why the service wouldn't run:

$ sudo zerotier-cli
zerotier-cli: missing port and zerotier-one.port not found in /var/lib/zerotier-one
absudabsu commented 5 years ago

I don't see the zerotier network interface either, so maybe that's the problem?

$ ifconfig
gpd0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1400
        inet 172.21.1.206  netmask 255.255.255.255  destination 172.21.1.206
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 500  (UNSPEC)
        RX packets 36756347  bytes 49491711063 (49.4 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 20677788  bytes 1316701210 (1.3 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 26682  bytes 2525545 (2.5 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 26682  bytes 2525545 (2.5 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp59s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.60.101.97  netmask 255.255.252.0  broadcast 10.60.103.255
        inet6 fe80::ce54:7190:87dc:872c  prefixlen 64  scopeid 0x20<link>
        ether 40:74:e0:90:44:e9  txqueuelen 1000  (Ethernet)
        RX packets 1726785  bytes 1389179610 (1.3 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 20703477  bytes 3760551137 (3.7 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The first interface is a different VPN, and the last one is my wireless card.

janjaapbos commented 5 years ago

Check the full command of the zerotier-one proces you see with lsof. Using the PID (15762 in you case) lsof -a -d txt -p 15762

This will probably show: /usr/sbin/zerotier-one

Looks like you have a broken system. Perhaps the installation of zerotier-one was interrupted, or it is unable to create the /var/lib/zerotier-one directory / files, because of permission issues.

absudabsu commented 5 years ago

Hmm

$ sudo lsof -a -d txt -p 15762
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1547007615/gvfs
      Output information may be incomplete.
COMMAND     PID USER  FD   TYPE DEVICE SIZE/OFF NODE NAME
zerotier- 15762 root txt    REG   7,15  2021736   14 /snap/zerotier-one/64/usr/sbin/zerotier-one

What do you suggest? Try the bash script again, maybe inside as su ?

janjaapbos commented 5 years ago

..

janjaapbos commented 5 years ago

Oh, you have a snap version installed already

janjaapbos commented 5 years ago

So you should make sure you have the snap bin directory in your path

janjaapbos commented 5 years ago

Snap wil not use /var/lib/zerotier-one, but probably something like /var/snap/lib/zerotier-one.

Anyway, you have a snap version installed and your system user does not have snap in its path.

janjaapbos commented 5 years ago

you can get rid of the snap version with: sudo snap remove zeroteir-one and then install the regular way, as shown on the zerotier download page.

absudabsu commented 5 years ago

You are right! Looks like I might have made a mistake by installing via the Ubuntu software store. FWIW: the snap version does not seem to work properly for me even if installed on a fresh system.

Working now after installing via the bash script, thanks!

aalghooneh commented 2 years ago

Just encountered the same problem, follow everything the JanJaapBos said, and if still problem persist kill the PID and then try again

sushinectar commented 1 year ago

mine after following all the steps continues with the error:

"0 join"

after I try to join some network

szafranski commented 1 year ago

Found the solution: sudo apt remove zerotier* and then curl -s https://install.zerotier.com | sudo bash and then: zerotier-cli join <network_number>