Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent install on 4.x OS #92

Open
surfingbytes opened this issue Jul 3, 2024 · 20 comments
Open

Persistent install on 4.x OS #92

surfingbytes opened this issue Jul 3, 2024 · 20 comments

Comments

@surfingbytes
Copy link

Can we please have support for 4.x firmware? I mean, it works, but I have to reinstall it after every update. Is there a way to make it persistent across updates?

@guentherwieser
Copy link

Upvoting, I just lost connectivity again and was wondering what happened. Btw, great software/project! Helps a lot!

@notheotherben
Copy link
Member

Will take a look once I have some time to do so, in general adding support for persistent updates is a lot of work as you need to find ways to work around UniFi's updates wiping the system partition (which isn't always easy). It's on my list, but may take some time.

@guentherwieser
Copy link

As this was my first time seeing this behavior after an update (my Dream Machine SE is brand spanking new), I feared that I need to do all the setup again, but fortunately it's just executing the curl command and running "tailscale up", all the settings seem to be persistent which is great!

@mastier
Copy link

mastier commented Jul 9, 2024

I see you ask for posting this, so I am doing it :-) @notheotherben
Nothink was wiped during the update yet, it did not start at boot

# /data/tailscale/manage.sh update
Unsupported UniFi OS version (v4).
Please provide the following information to us on GitHub:
# /usr/bin/ubnt-device-info firmware_detail
4.0.6
# /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

@notheotherben
Copy link
Member

Hi @mastier, thanks for posting that - the latest release does include support for UniFi OS 4.x and if you were running an older release of this script then you would receive that error. Updating should take care of it for you.

@mastier
Copy link

mastier commented Jul 10, 2024

Indeed. Thank you

@HaxNobody
Copy link

UniFi OS 4.x is now GA, did anything change between now and the beta release or is it still working as expected? I was just holding off before trying it myself in production.

@notheotherben
Copy link
Member

I've been running it on my local UDM without issues on 4.x, no issues so far.

@surfingbytes
Copy link
Author

Sorry but this doesn't work. Just updated to 4.0.20 and got disconnected from Tailscale and had to reinstall this.

@HaxNobody
Copy link

Sorry but this doesn't work. Just updated to 4.0.20 and got disconnected from Tailscale and had to reinstall this.

Same, 2 different UDM SE units are offline after OS updates.

@yourfriendaaron
Copy link

Oddly, on my Cloud Gateway Ultra, it didn't require a reinstall after updating to 4.0.20 just now. Tailscale survived that and the reboot.

@guentherwieser
Copy link

Need to confirm that on my Dream Machine SE Tailscale went missing with the latest firmware update.

@guentherwieser
Copy link

Update tonight to 4.0.21 on my DreamMachine SE, tailscale's gone....

@surfingbytes
Copy link
Author

@mastier , can this be re-open please, as it still doesn't work?

@notheotherben
Copy link
Member

notheotherben commented Nov 20, 2024

Can re-open this, but unfortunately without a repro (which I haven't been able to achieve) or more information on why this is being removed (i.e. from what version to which other version, which files are still present, what is the status of the install tasks, etc) it's effectively impossible for me to do anything to help.

Information Which May Be Helpful

# Run the following and attach the output BEFORE re-installing Tailscale UDM

echo "ubnt-device-info summary"
ubnt-device-info summary
echo

echo "Install Services"
systemctl status tailscale-install.timer
systemctl status tailscale-install.service
echo

echo "Tailscale UDM Directory"
ls -al /data/tailscale/
echo

The trouble is that if you were running an older version of Tailscale UDM, there's a good chance persistence after update would not work, but newer versions should - similarly, if there's something breaking the systemd install services then that would also cause update persistence to fail, but without more information it's hard to triage.

As others have observed, re-running the insall script should resolve the issue without losing any of your data.

@notheotherben notheotherben reopened this Nov 20, 2024
@surfingbytes
Copy link
Author

To have it here for next time UDM release an update. Currently, I have UDM SE on 4.0.21.

ubnt-device-info
Usage:
ubnt-device-info OPTION
Allowed OPTION values:
summary - some summary of device information
subsystem_id - 16-bit device identifier
model - device model name
model_short - device model name in short form
family - device family name
family_short - device family name in short form
firmware - installed firmware version
firmware_detail - installed firmware detailed version
firmware_discovery - installed firmware ubnt-discovery version
mac - device default MAC address
ipv4 - device default IPv4 address

Install Services
● tailscale-install.timer - Ensure that Tailscale is updated automatically on your device.
Loaded: loaded (/ssd1/.data/tailscale/tailscale-install.timer; enabled; vendor preset: enabled)
Active: inactive (dead)
Trigger: n/a
Triggers: ● tailscale-install.service
● tailscale-install.service - Ensure that Tailscale is installed on your device
Loaded: loaded (/ssd1/.data/tailscale/tailscale-install.service; enabled; vendor preset: enabled)
Active: inactive (dead)
TriggeredBy: ● tailscale-install.timer

Tailscale UDM Directory
total 64
drwx------ 3 root root 4096 Oct 29 20:37 ./
drwxr-xr-x 14 root root 4096 May 30 18:37 ../
-rw-r--r-- 1 root root 1058 May 3 2024 LICENSE
-rw------- 1 root root 12691 Oct 29 20:37 derpmap.cached.json
drwx------ 3 root root 4096 May 30 18:39 files/
-rwxr-xr-x 1 root root 4033 May 3 2024 manage.sh*
-rw-r--r-- 1 root root 132 May 3 2024 tailscale-env
-rw-r--r-- 1 root root 278 May 3 2024 tailscale-install.service
-rw-r--r-- 1 root root 192 May 3 2024 tailscale-install.timer
-rw------- 1 root root 2814 Oct 10 12:45 tailscaled.state
-rw-r--r-- 1 root root 2917 May 3 2024 unios_1.x.sh
-rw-r--r-- 1 root root 4667 May 3 2024 unios_2.x.sh

Then I've run these 2 commands to make sure it's up to date, which you can see it is:

curl -sSLq https://raw.github.com/SierraSoftworks/tailscale-udm/main/install.sh | sh
Tailscale is already installed and running, if you wish to update it, run '/data/tailscale/manage.sh update'
If you wish to force a reinstall, run '/data/tailscale/manage.sh install!'
Tailscaled started successfully
Run tailscale up to configure the interface.

/data/tailscale/manage.sh update
Tailscale is already up to date

@surfingbytes
Copy link
Author

As others have observed, re-running the insall script should resolve the issue without losing any of your data.

Yes, that is true. However, that means you need to have auto updates off, and only manually update when you are on the location, to be able to ssh in and install tailscale again.

@surfingbytes
Copy link
Author

surfingbytes commented Jan 7, 2025

Today I updated Unifi OS to new version (4.1.13) and Tailscale is gone. Here is output of the commands:

ubnt-device-info
Usage:
ubnt-device-info OPTION
Allowed OPTION values:
summary - some summary of device information
subsystem_id - 16-bit device identifier
model - device model name
model_short - device model name in short form
family - device family name
family_short - device family name in short form
firmware - installed firmware version
firmware_detail - installed firmware detailed version
firmware_discovery - installed firmware ubnt-discovery version
mac - device default MAC address
ipv4 - device default IPv4 address

Install Services
● tailscale-install.timer - Ensure that Tailscale is updated automatically on your device.
Loaded: loaded (/ssd1/.data/tailscale/tailscale-install.timer; enabled; vendor preset: enabled)
Active: inactive (dead)
Trigger: n/a
Triggers: ● tailscale-install.service

Jan 07 21:03:09 Dream-Machine-SE systemd[1]: tailscale-install.timer: Failed to open /ssd1/.data/tailscale/tailscale-in>
lines 1-7/7 (END)

tailscale-install.service: Failed to open /ssd1/.data/tailscale/tailscale->

Tailscale UDM Directory
total 64
drwx------ 3 root root 4096 Dec 14 02:10 ./
drwxr-xr-x 15 root root 4096 Jan 7 21:04 ../
-rw-r--r-- 1 root root 1058 May 3 2024 LICENSE
-rw------- 1 root root 13879 Dec 6 22:16 derpmap.cached.json
drwx------ 3 root root 4096 May 30 2024 files/
-rwxr-xr-x 1 root root 4033 May 3 2024 manage.sh*
-rw-r--r-- 1 root root 132 May 3 2024 tailscale-env
-rw-r--r-- 1 root root 278 May 3 2024 tailscale-install.service
-rw-r--r-- 1 root root 192 May 3 2024 tailscale-install.timer
-rw------- 1 root root 2850 Dec 14 02:10 tailscaled.state
-rw-r--r-- 1 root root 2917 May 3 2024 unios_1.x.sh
-rw-r--r-- 1 root root 4667 May 3 2024 unios_2.x.sh

@notheotherben
Copy link
Member

Thanks @surfingbytes - looks like the tailscale-install.timer failed to run successfully on your machine due to an inability to access the /ssd1/.data/tailscale directory - I'll see if there's something I can do to ensure it only runs after the filesystem is correctly mounted, as that could explain the problem.

Since the directory was obviously present when you ran the final ls command, I'm wondering whether running systemctl start tailscale-install.timer will work for you (if it does, then it's definitely a disk mounting issue during the initial run, if not then there's something else going on as well).

@HaxNobody
Copy link

I tested this. I had noticed that tailscale-install.timer was not running prior to the upgrade, so I had started it to see if that would fix the issue of tailscale not being reinstalled. After the upgrade, tailscale was still not automatically installed, however manually running systemctl start tailscale-install.timer worked and tailscale was immediately installed with the existing config and everything went back to normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants