Openhabian install hangs on tailscale setup

I tried installing OpenHabian on a new PI4. On a PI3 it install flawless (same card, tried it two days ago), but on a PI4 is stalls. Tried it now four times and waited three hours. The last log I get is given below, after which there is no response. Is there anything I could try ?

 [90;01m$ apt-get update  [39;49;00m
+ apt-get update
Hit:1 http://davesteele.github.io/comitup/repo comitup InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:3 http://archive.raspberrypi.org/debian buster InRelease
Hit:4 https://deb.nodesource.com/node_12.x buster InRelease
Ign:5 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Get:6 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Get:7 https://pkgs.tailscale.com/stable/raspbian buster InRelease
Get:9 https://pkgs.tailscale.com/stable/raspbian buster/main armhf Packages [2,449 B]
Fetched 12.5 kB in 2s (5,091 B/s)
Reading package lists...
+ return 0
+ cond_redirect apt-get install --yes tailscale
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ apt-get install --yes tailscale \033[39;49;00m'

 [90;01m$ apt-get install --yes tailscale  [39;49;00m
+ apt-get install --yes tailscale
Reading package lists...
Building dependency tree...
Reading state information...
The following package was automatically installed and is no longer required:
  triggerhappy
Use 'apt autoremove' to remove it.
The following NEW packages will be installed:
  tailscale
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 12.7 MB of archives.
After this operation, 22.6 MB of additional disk space will be used.
Get:1 https://pkgs.tailscale.com/stable/raspbian buster/main armhf tailscale armhf 1.4.5 [12.7 MB]
Fetched 12.7 MB in 20s (648 kB/s)
Selecting previously unselected package tailscale.
(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 ... 46682 files and directories currently installed.)
Preparing to unpack .../tailscale_1.4.5_armhf.deb ...
Unpacking tailscale (1.4.5) ...
Setting up tailscale (1.4.5) ...
Created symlink /etc/systemd/system/multi-user.target.wants/tailscaled.service → /lib/systemd/system/tailscaled.service.
+ return 0
+ echo OK
OK
+ return 0
+ setup_tailscale
+ local preAuthKey=tskey-xxxxxxxxxxxxxxxxx
+ local consoleProperties=/var/lib/openhab/etc/org.apache.karaf.shell.cfg
+ local tailscaleIP
+ [[ -n 1 ]]
+ [[ -z tskey-xxxxxxxxxxxxxxxxx ]]
+ [[ -n '' ]]
+ tailscale up --authkey tskey-xxxxxxxxxxxxxxxxx

``` "

check if you have preauthkey un-commented in /boot/openhabian.conf or /etc/openhabian.conf.
Provide at least the full log of the tailscale install.

I gave it another try un-commenting preauthkey in openhabian.conf (before the first boot at the same time I set the DEBUG to maximum). Same result. I think this is the full log of the tailscale install is given below:

(ps. for every try I copied a fresh new image to my card)

++ date +%F_%T_%Z

echo '2021-03-11_08:19:12_CET [openHABian] Installing tailscale VPN… ’
2021-03-11_08:19:12_CET [openHABian] Installing tailscale VPN…
add_keys https://pkgs.tailscale.com/stable/raspbian/buster.gpg
local repoKey
++ mktemp /tmp/openhabian.XXXXX
repoKey=/tmp/openhabian.aC3DW
++ timestamp
++ date +%F_%T_%Z
echo -n '2021-03-11_08:19:12_CET [openHABian] Adding required keys to apt… ’
2021-03-11_08:19:12_CET [openHABian] Adding required keys to apt… + cond_redirect wget -qO /tmp/openhabian.aC3DW https://pkgs.tailscale.com/stable/raspbian/buster.gpg
[[ -n ‘’ ]]
echo -e ‘\n\033[90;01m$ wget -qO /tmp/openhabian.aC3DW https://pkgs.tailscale.com/stable/raspbian/buster.gpg \033[39;49;00m’
[90;01m$ wget -qO /tmp/openhabian.aC3DW https://pkgs.tailscale.com/stable/raspbian/buster.gpg [39;49;00m

wget -qO /tmp/openhabian.aC3DW https://pkgs.tailscale.com/stable/raspbian/buster.gpg
return 0
cond_redirect apt-key add /tmp/openhabian.aC3DW
[[ -n ‘’ ]]
echo -e ‘\n\033[90;01m$ apt-key add /tmp/openhabian.aC3DW \033[39;49;00m’
[90;01m$ apt-key add /tmp/openhabian.aC3DW [39;49;00m

apt-key add /tmp/openhabian.aC3DW
Warning: apt-key output should not be parsed (stdout is not a terminal)
OK

return 0

echo OK
OK

rm -f /tmp/openhabian.aC3DW

curl https://pkgs.tailscale.com/stable/raspbian/buster.list

tee /etc/apt/sources.list.d/tailscale.list
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
100 100 100 100 0 0 184 0 --:–:-- --:–:-- --:–:-- 184

Tailscale packages for raspbian buster
deb https://pkgs.tailscale.com/stable/raspbian buster main

cond_redirect apt-get update
[[ -n ‘’ ]]
echo -e ‘\n\033[90;01m$ apt-get update \033[39;49;00m’
[90;01m$ apt-get update [39;49;00m

apt-get update
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Hit:2 http://davesteele.github.io/comitup/repo comitup InRelease
Hit:3 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:4 https://deb.nodesource.com/node_12.x buster InRelease
Ign:5 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Get:6 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Get:7 https://pkgs.tailscale.com/stable/raspbian buster InRelease
Get:9 https://pkgs.tailscale.com/stable/raspbian buster/main armhf Packages [2,449 B]
Fetched 12.5 kB in 2s (5,553 B/s)
Reading package lists…
return 0
cond_redirect apt-get install --yes tailscale
[[ -n ‘’ ]]
echo -e ‘\n\033[90;01m$ apt-get install --yes tailscale \033[39;49;00m’
[90;01m$ apt-get install --yes tailscale [39;49;00m

apt-get install --yes tailscale
Reading package lists…
Building dependency tree…
Reading state information…
The following package was automatically installed and is no longer required:
triggerhappy
Use ‘apt autoremove’ to remove it.
The following NEW packages will be installed:
tailscale
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 12.7 MB of archives.
After this operation, 22.6 MB of additional disk space will be used.
Get:1 https://pkgs.tailscale.com/stable/raspbian buster/main armhf tailscale armhf 1.4.5 [12.7 MB]
Fetched 12.7 MB in 8s (1,608 kB/s)
Selecting previously unselected package tailscale.
(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 … 46682 files and directories currently installed.)
Preparing to unpack …/tailscale_1.4.5_armhf.deb …
Unpacking tailscale (1.4.5) …
Setting up tailscale (1.4.5) …
Created symlink /etc/systemd/system/multi-user.target.wants/tailscaled.service → /lib/systemd/system/tailscaled.service.
return 0
echo OK
OK
return 0
setup_tailscale
local preAuthKey=tskey-xxxxxxxxxxxxxxxxx
local consoleProperties=/var/lib/openhab/etc/org.apache.karaf.shell.cfg
local tailscaleIP
[[ -n 1 ]]
[[ -z tskey-xxxxxxxxxxxxxxxxx ]]
[[ -n ‘’ ]]
tailscale up --authkey tskey-xxxxxxxxxxxxxxxxx```

Use code fences.

And I meant you must comment-out the preauthkey line (put a # in front)

Sorry! I used block quote instead of preformatted text, I corrected it :frowning:

Since the preauthkey line is already comment-out by default, I thought I needed to uncomment the line. To be sure I did everything correct I downloaded openhabian-pi-raspios32-v1.6.3.img.xz again, flashed it with balenaEtcher ( 16 G SD card), edited openhab.cfg by changing debugmode=maximum (no other changes since preauthkey is already comment-out) and rebooted the PI4 (cable network).

Exactly same result…?.

(BTW thanks for your excellent package and support, never had problems so far !)

this is why it tries to install tailscale (and probably hangs because the key is bad).
It means the parameter preauthkey is set but that it should not be when it’s commented out.
Search the log for preauthkey where it gets set (somewhere at the beginning) and show the log before.

Try to “not set” with an explicit blank after the hash i.e. # preauthkey=tskey-......

Tried again, both on an old Raspberry Pi 3 and a new 4. I have no clue what’s going wrong, but none of the installs works anymore. To be sure I hard-formatted the SD card before.
The default value in the setup file is without the explicit blank after the hash, but I did remove that, i.e. … # preauthkey=tskey-......

Below are the parts where I found reference to preauthkey (line 832 of 2383)

+ [[ # Tailscale VPN =~ ^(#)?[a-zA-Z] ]]
+ echo '# Tailscale VPN'
+ read -r line
+ [[ #preauthkey=tskey-xxxxxxxxxxxxxxxxx =~ ^(#)?[a-zA-Z] ]]
+ parsed='#preauthkey=tskey-xxxxxxxxxxxxxxxxx'
+ [[ #preauthkey=tskey-xxxxxxxxxxxxxxxxx =~ ^#[a-zA-Z] ]]
+ parsed=preauthkey=tskey-xxxxxxxxxxxxxxxxx
++ echo preauthkey=tskey-xxxxxxxxxxxxxxxxx
++ cut -d= -f1
+ param=preauthkey
+ [[ -v preauthkey ]]
+ echo '#preauthkey=tskey-xxxxxxxxxxxxxxxxx'
+ eval preauthkey=tskey-xxxxxxxxxxxxxxxxx
++ preauthkey=tskey-xxxxxxxxxxxxxxxxx

And here (line 1947 of 2383)

+ install_tailscale install
+ local 'installText=We will install the tailscale VPN client on your system. Use it to securely interconnect multiple openHAB(ian) instances.\nSee https://tailscale.com/blog/how-tailscale-works/ for a comprehensive explanation how it creates a secure VPN. For personal use, you can get a free solo service from tailscale.com.'
+ local 'removeText=We will remove the tailscale VPN client from your system.\n\nDouble-check ~/.ssh/authorized_keys and eventually remove the admin key.'
+ local serviceTargetDir=/lib/systemd/system
+ [[ -n 1 ]]
+ [[ ! -v preauthkey ]]
+ [[ install == \r\e\m\o\v\e ]]
+ [[ install != \i\n\s\t\a\l\l ]]

and here (2375 of 2383)

+ setup_tailscale
+ local preAuthKey=tskey-xxxxxxxxxxxxxxxxx
+ local consoleProperties=/var/lib/openhab/etc/org.apache.karaf.shell.cfg
+ local tailscaleIP
+ [[ -n 1 ]]
+ [[ -z tskey-xxxxxxxxxxxxxxxxx ]]
+ [[ -n '' ]]
+ tailscale up --authkey tskey-xxxxxxxxxxxxxxxxx

The only thing I notice (I have limited programming skills) is that in the last section caps are used in the word preAuthKey.

I am using the default img.xz file, without any changes. I appreciate your help. Any thoughts ?

Try again, I’ve updated the sources to have that extra blank
your first log block shows something’s wrong with parsing there

main branch only of course

That did the trick ! Thanks ! It works again. One thing I noticed when I created a new image on my SD card is that there is also a directory called: overlays . I never saw that before. It works, but maybe that are some “leftovers” . Thanks again, I will start rebuilding my system in OH3