Page MenuHomeVyOS Platform

Can't load archived configs as they are gzipped
Open, Requires assessmentPublic

Description

The current implementation of the config archive stores archived configs in /config/archive, where all but the latest config are gzipped. Trying to load one from config mode results in an error:

vyos@vyos# load /config/archive/config.boot.1.gz
Traceback (most recent call last):
  File "/usr/libexec/vyos/vyos-load-config.py", line 59, in <module>
    with open(canonical_path, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/opt/vyatta/etc/config//config/archive/config.boot.1.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/libexec/vyos/vyos-load-config.py", line 64, in <module>
    config_file = f.read()
  File "/usr/lib/python3.7/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte
[edit]

vyos@vyos# load archive/config.boot.1.gz
Traceback (most recent call last):
  File "/usr/libexec/vyos/vyos-load-config.py", line 60, in <module>
    config_file = f.read()
  File "/usr/lib/python3.7/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte
[edit]

This is because vyos-load-config.py expects a plaintext file so it needs to be manually extracted first.

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Behavior change

Event Timeline

jjakob created this task.Mar 19 2020, 4:21 PM
jjakob created this object in space S1 VyOS Public.
jestabro claimed this task.Mar 19 2020, 5:20 PM
pasik added a subscriber: pasik.Mar 20 2020, 12:48 PM