Page MenuHomeVyOS Platform

show system updates doesnt seem to be working
Closed, ResolvedPublicBUG

Description

Executing "show system updates" but nothing seems to be happening.

When terminating the execution (ctrl+c) I get the following dump:

:...skipping...
Traceback (most recent call last):
  File "/usr/libexec/vyos/op_mode/system.py", line 87, in <module>
    res = vyos.opmode.run(sys.modules[__name__])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/opmode.py", line 263, in run
    res = func(**args)
          ^^^^^^^^^^^^
  File "/usr/libexec/vyos/op_mode/system.py", line 78, in show_update
    data = _compare_version_raw()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/libexec/vyos/op_mode/system.py", line 37, in _compare_version_raw
    remote_data = vyos.version.get_remote_version(url)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/version.py", line 137, in get_remote_version
    return remote_data.json()
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
                             ^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests/models.py", line 928, in text
    encoding = self.apparent_encoding
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests/models.py", line 793, in apparent_encoding
    return chardet.detect(self.content)["encoding"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/chardet/__init__.py", line 49, in detect
    detector.feed(byte_str)
  File "/usr/lib/python3/dist-packages/chardet/universaldetector.py", line 236, in feed
    if self._utf1632_prober.feed(byte_str) == ProbingState.FOUND_IT:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/chardet/utf1632prober.py", line 199, in feed
    self.position += 1
    ^^^^^^^^^^^^^
KeyboardInterrupt

Details

Version
VyOS 1.4-rolling-202307190317
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Related Objects

Event Timeline

It is not fully implemented.
You have to set the URL to a JSON file with System versions, which not exists for now (there is no permanent URL for it), so it will be in the future developments.

set system update-check url link_to_url_json_versions

PoC was implemented here https://vyos.dev/T3476 in PR https://github.com/vyos/vyos-1x/pull/1521

The tested JSON file

[
   {
      "arch":"amd64",
      "flavors":[
       "generic"
    ],
    "image":"vyos-rolling-latest.iso",
    "latest":true,
    "lts":false,
    "release_date":"2022-09-02",
    "release_train":"sagitta",
    "url":"http://s3-us.vyos.io/rolling/current/vyos-rolling-latest.iso",
    "version":"1.4-rolling-202209060217"
  }
]

Ooh, I thought update-check should point to the iso-file like so:

set system update-check url https://s3-us.vyos.io/rolling/current/vyos-rolling-latest.iso

I guess this case will be updated once there exists a permanent "image-versions.json" url to poll?

I can confirm by removing the incorrect update-check url like so:

delete system update-check url

then "show system updates" works as expected:

vyos@vyos:~$ show system updates 
system update-check not configured

What is the "system update-check url" supposed to be once its implemented?

vyos@r4:~$ 
vyos@r4:~$ show conf com | match upd
set system update-check auto-check
set system update-check url 'https://raw.githubusercontent.com/vyos/vyos-rolling-nightly-builds/main/version.json'
vyos@r4:~$ 
vyos@r4:~$ 
vyos@r4:~$ show system updates 
Current version: 1.5-rolling-202312220023

Update available: 1.5-rolling-202312260023
Update URL: https://github.com/vyos/vyos-rolling-nightly-builds/releases/download/1.5-rolling-202312260023/1.5-rolling-202312260023-amd64.iso
vyos@r4:~$
dmbaturin claimed this task.

It seems to be broken once again - at least for devices <=1G RAM.

manuel@mvr01:~$ show configuration commands | match update
set system update-check auto-check
set system update-check url 'https://raw.githubusercontent.com/vyos/vyos-rolling-nightly-builds/main/version.json'
manuel@mvr01:~$
manuel@mvr01:~$ show configuration commands | match 'http-client source-address'
set system option http-client source-address '10.13.0.3'
manuel@mvr01:~$
manuel@mvr01:~$ sudo curl --interface 10.13.0.3 https://raw.githubusercontent.com/vyos/vyos-rolling-nightly-builds/main/version.json
[
  {
    "url": "https://github.com/vyos/vyos-rolling-nightly-builds/releases/download/1.5-rolling-202408250823/vyos-1.5-rolling-202408250823-generic-amd64.iso",
    "version": "1.5-rolling-202408250823",
    "timestamp": "2024-08-25T08:23:35Z"
  }
]manuel@mvr01:~$ 
manuel@mvr01:~$
manuel@mvr01:~$ show system updates 
Current version: 1.5-rolling-202408200849

Update available: 1.5-rolling-202408250823
Update URL: https://github.com/vyos/vyos-rolling-nightly-builds/releases/download/1.5-rolling-202408250823/vyos-1.5-rolling-202408250823-generic-amd64.iso
manuel@mvr01:~$ add system image latest 
Redirecting to https://objects.githubusercontent.com/github-production-release-asset-2e65be/674742659/4c0d25d3-0f2f-41f1-b424-1cc06026ef15?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20240825%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240825T162615Z&X-Amz-Expires=300&X-Amz-Signature=662e551cd9bcca80c98c9c3a3eccec620308e0bb2a6d551eac9f491387455d26&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=674742659&response-content-disposition=attachment%3B%20filename%3Dvyos-1.5-rolling-202408250823-generic-amd64.iso&response-content-type=application%2Foctet-stream
The file is 462.000 MiB.
[#########################################################################################################________]  93%

… after that, my SSH session hung, and the router was not reachable anymore. I had to reset it manually by connecting with the VM cloud-console. It also took VERY long (a couple of minutes).

image.png (307×623 px, 72 KB)

After rebooting it, everything was normal again.

show system updates works as intended, but it takes VERY long (about 10 mins).

Downloading and installing manually works like it used to. Any other VyOS functions also works normally (Wireguard, NAT, Openvpn, IPSec, routing, etc).

manuel@mvr01:~$ sudo wget https://github.com/vyos/vyos-rolling-nightly-builds/releases/download/1.5-rolling-202408250823/vyos-1.5-rolling-202408250823-generic-amd64.iso
[…] wget took 18sec
manuel@mvr01:~$ add system image ./vyos-1.5-rolling-202408250823-generic-amd64.iso
Validating image compatibility
[…]
Cleaning up
Unmounting target filesystems
Removing temporary files
manuel@mvr01:~$ reboot now