WireGuard / wireguard-vyatta-ubnt

WireGuard for Ubiquiti Devices
https://www.wireguard.com/
GNU General Public License v3.0
1.46k stars 68 forks source link

Upgrade to Wireguard 1.0.20201221 failed on USG3 if description field is used #63

Closed yubiuser closed 3 years ago

yubiuser commented 3 years ago

I tried to upgrade from 20201112-1 to 20201221 on my USG3 via this script.

It always failed

marburger@USG:/config/scripts/post-config.d$ ./wireguard.sh upgrade    
Upgrading WireGuard...
Checking latest release for ugw3...
Downloading ugw3-v1-v1.0.20201221-v1.0.20200827.deb...
Disabling wg0...
Unloading kernel module...
Installing ugw3-v1-v1.0.20201221-v1.0.20200827.deb...
(Reading database ... 33317 files and directories currently installed.)
Preparing to replace wireguard 1.0.20201112-1 (using .../ugw3-v1-v1.0.20201221-v1.0.20200827.deb) ...
Unpacking replacement wireguard ...
Setting up wireguard (1.0.20201221-1) ...
Purging previous cache...
Caching installer to /config/user-data/wireguard/cache...
Reloading configuration...
Loading configuration from '/config/config.boot'...

Load complete.  Use 'commit' to make changes active.
[ interfaces wireguard wg0 description Remote Wireguard VPN ]
Cannot find device "wg0"

Commit failed

until I removed the description field from my config.gateway.json

                "peer": [{
                        "CDXXXXXXXXXXXXXXXXXXXXYIxs=": {
                            "allowed-ips": [
                                "10.0.40.2/32"
                            ],
                            "persistent-keepalive": 25,
                            "description": "X230"
                        }

                    },

Immediately the update worked

Upgrading WireGuard...
Checking latest release for ugw3...
Downloading ugw3-v1-v1.0.20201221-v1.0.20200827.deb...
Nothing to delete (the specified node does not exist)
Unloading kernel module...
Installing ugw3-v1-v1.0.20201221-v1.0.20200827.deb...
(Reading database ... 33315 files and directories currently installed.)
Preparing to replace wireguard 1.0.20201221-1 (using .../ugw3-v1-v1.0.20201221-v1.0.20200827.deb) ...
Unpacking replacement wireguard ...
Setting up wireguard (1.0.20201221-1) ...
Purging previous cache...
Caching installer to /config/user-data/wireguard/cache...
Reloading configuration...
Loading configuration from '/config/config.boot'...
No configuration changes to commit
Upgrade complete!

Also others report issues with the description field.

Did anything change between those two versions regarding the description field?

FossoresLP commented 3 years ago

Hi @yubiuser, thank you for reporting this. The issue is caused by the update script pulling a pre-release version from GitHub. You and the other users experiencing the issue are basically unintentionally beta-testing the changes from #55. Please report this issue to the updater script since it just checks the date of the latest commit in the release. Also, thank you for the (unintentional) feedback regarding the changes. I will make sure they are addressed before pushing those to an actual release.

Also, whishing you a Merry Christmas in case you are celebrating.

whiskerz007 commented 3 years ago

@yubiuser You might consider using the script I created. It will not install pre-released packages by default.

yubiuser commented 3 years ago

@FossoresLP thanks for the reply.

I reported the issue to the script maintainer, which promised to fix it.

@whiskerz007 Thanks for your suggestion. However, I saw this issue, which looks like the wrong release was pulled as well?

P.S. Merry Christimas :-)

whiskerz007 commented 3 years ago

@yubiuser The op of the issue you referenced was using an older version of the script. The newest script will pull the official releases (not prerelease) according to the GitHub release page.

FossoresLP commented 3 years ago

This is now fixed in the pre-release, too. Closing.