Tailscaled wont start on Pi4 openhabian

  • Platform information:

    • Hardware: CPUArchitecture/RAM/storage
    • OS: Linux openhabian 5.15.76-v7l+ #1597 SMP Fri Nov 4 12:14:58 GMT 2022 armv7l GNU/Linux
    • Java Runtime Environment:
      openjdk version “11.0.16” 2022-07-19
      OpenJDK Runtime Environment (build 11.0.16+8-post-Raspbian-1deb11u1)
      OpenJDK Server VM (build 11.0.16+8-post-Raspbian-1deb11u1, mixed mode)
    • openHAB version: 3.3.0
    • tailscale version - 1.34.1
  • Issue of the topic: Cannot get tailscale working
    The openhabian-config is largelly useless in installing as it wont tell a single error message, when going ant trying to enable the service and start by running

sudo systemctl enable tailscaled
sudo systemctl start tailscaled

then following appears in the logs. So where could I tweak the path for the service or better yet am I on old version of something where this is already fixed?

Dec 17 15:20:09 openhabian tailscaled[16409]: logtail started
Dec 17 15:20:09 openhabian tailscaled[16409]: Program starting: v1.34.1-t328b49c4d-g921b59a2e, Go 1.19.2-ts3fd24dee31: []string{“/usr/sbin/tailscaled”, “>
Dec 17 15:20:09 openhabian tailscaled[16409]: LogID: a6ecf5c2d40d4238cc4b1180898bc2bb2d540386187d50cda90ed4c2bec057f0
Dec 17 15:20:09 openhabian tailscaled[16409]: logpolicy: using $STATE_DIRECTORY, “/var/lib/tailscale”
Dec 17 15:20:09 openhabian tailscaled[16409]: dns: [resolved-ping=yes rc=resolvconf resolvconf=no ret=direct]
Dec 17 15:20:09 openhabian tailscaled[16409]: dns: using “direct” mode
Dec 17 15:20:09 openhabian tailscaled[16409]: dns: using *dns.directManager
Dec 17 15:20:09 openhabian tailscaled[16409]: flushing log.
Dec 17 15:20:09 openhabian tailscaled[16409]: logger closing down
Dec 17 15:20:10 openhabian systemd[1]: tailscaled.service: Failed with result ‘exit-code’.
Dec 17 15:20:10 openhabian systemd[1]: tailscaled.service: Scheduled restart job, restart counter is at 127.
Dec 17 15:20:10 openhabian systemd[1]: Stopped Tailscale node agent.
Dec 17 15:20:10 openhabian systemd[1]: Starting Tailscale node agent…
Dec 17 15:20:10 openhabian tailscaled[16417]: logtail started
Dec 17 15:20:10 openhabian tailscaled[16417]: Program starting: v1.34.1-t328b49c4d-g921b59a2e, Go 1.19.2-ts3fd24dee31: []string{”/usr/sbin/tailscaled", “>
Dec 17 15:20:10 openhabian tailscaled[16417]: LogID: a6ecf5c2d40d4238cc4b1180898bc2bb2d540386187d50cda90ed4c2bec057f0
Dec 17 15:20:10 openhabian tailscaled[16417]: logpolicy: using $STATE_DIRECTORY, “/var/lib/tailscale”
Dec 17 15:20:10 openhabian tailscaled[16417]: dns: [resolved-ping=yes rc=resolvconf resolvconf=no ret=direct]
Dec 17 15:20:10 openhabian tailscaled[16417]: dns: using “direct” mode
Dec 17 15:20:10 openhabian tailscaled[16417]: dns: using *dns.directManager
Dec 17 15:20:10 openhabian tailscaled[16417]: flushing log.
Dec 17 15:20:10 openhabian tailscaled[16417]: logger closing down
Dec 17 15:20:11 openhabian tailscaled[16424]: logtail started
Dec 17 15:20:11 openhabian tailscaled[16424]: Program starting: v1.34.1-t328b49c4d-g921b59a2e, Go 1.19.2-ts3fd24dee31: []string{”/usr/sbin/tailscaled", ">
Dec 17 15:20:11 openhabian tailscaled[16424]: LogID: a6ecf5c2d40d4238cc4b1180898bc2bb2d540386187d50cda90ed4c2bec057f0
Dec 17 15:20:11 openhabian tailscaled[16424]: logpolicy: using $STATE_DIRECTORY, “/var/lib/tailscale”
Dec 17 15:20:11 openhabian systemd[1]: Started Tailscale node agent.
Dec 17 15:20:11 openhabian tailscaled[16424]: wgengine.NewUserspaceEngine(tun “tailscale0”) …
Dec 17 15:20:11 openhabian tailscaled[16424]: wgengine.NewUserspaceEngine(tun “tailscale0”) error: creating router: exec: “iptables”: executable file not>
Dec 17 15:20:11 openhabian tailscaled[16424]: flushing log.
Dec 17 15:20:11 openhabian tailscaled[16424]: logger closing down
Dec 17 15:20:11 openhabian tailscaled[16424]: getLocalBackend error: createEngine: creating router: exec: “iptables”: executable file not found in $PATH
Dec 17 15:20:11 openhabian systemd[1]: tailscaled.service: Main process exited, code=exited, status=1/FAILURE

This message seems to be not complete

Nevertheless I would interpret it that it cannot find the executable iptables.
That means that the package iptables seems not to be installed.
Install it and try again.

My experience is different …

  • openhabian-config shows an error message in case a package cannot be installed
  • it might be necessary to run openhabian-config with extended debugging enabled to get the whole story about what is causing the problem. If that would be enabled per default a user would not see anything at all - it would not be easily to read and interpret if installation was going ok or wrong. So what did the installation show ? In case there was no error then the dependency on iptables seems not to be part of the tailscale package itself. Here it would be not fair to plead guilty against openhabian-config

Seems to be related to CentOS 8 Installation - Missing "iptables" command · Issue #233 · tailscale/tailscale · GitHub

What I can see is that according to the tailscale project page the startup on Bullseye versus Centos seems to be different.

Raspbian Bullseye (for Raspberry Pi)

Add Tailscale’s GPG key sudo mkdir -p --mode=0755 /usr/share/keyrings curl -fsSL https://pkgs.tailscale.com/stable/raspbian/bullseye.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null # Add the tailscale repository curl -fsSL https://pkgs.tailscale.com/stable/raspbian/bullseye.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list # Install Tailscale sudo apt-get update && sudo apt-get install tailscale # Start Tailscale! sudo tailscale up

CentOS 8

Add the tailscale repository sudo dnf config-manager --add-repo https://pkgs.tailscale.com/stable/centos/8/tailscale.repo # Install Tailscale sudo dnf install tailscale # Enable and start tailscaled sudo systemctl enable --now tailscaled # Start Tailscale! sudo tailscale up

This is what openhabian-config is following. So I would expect that all these is the reason for the problems you see.

Just to finally close this one, looks like the tailscale shipped together with openhabian is not complete in its dependencies.

Yes, you can go the route of setting a better apt source for tailscale and then hoping for the best, which did not work for me. Looked liked the dependency fix was still not available for that flavour of builds for ‘buster’ at that time.

Eventually manually installing nftables did the trick and I could start the tailscale service

sudo apt-get install nftables

You didn’t tell you were using buster.
openHABian is no longer based on and not supported on buster in more than a year now so blaming it for that this combo doesn’t work rather than admitting you ignored the prerequisites ain’t fair.

Just installed openHABian latest image, nftables is there by default. So that just isn’t true.

This all nice and I am happy to be wrong, but I just went and used Raspbi imager, selected 32bit image and the image not only does not actually work and fails to start openhabian itself (3.4.1) (which is another topic and lets skip that for now) but it does list following in apt sources:

deb [signed-by=/usr/share/keyrings/tailscale.gpg] https://pkgs.tailscale.com/stable/raspbian buster main

So the the whole “buster” topic is not something I deliberately chose made up myself. Anyway, this is all very interestingly obscure and I will do more clean install testing before I will say anything decisive.