Page MenuHomeVyOS Platform

Backtrace for config-archive when netwofrk is not configured
Open, Requires assessmentPublicBUG

Description

We have to add additional check to commit-archive command to prevent backtrace when network is not configured.

[email protected]# run show interfaces 
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface        IP Address                        S/L  Description
---------        ----------                        ---  -----------
eth0             -                                 u/u  
eth1             -                                 u/u  
eth2             -                                 u/u  
eth3             -                                 u/u  
lo               127.0.0.1/8                       u/u  
                 ::1/128                                
[edit]
[email protected]# set system config-management commit-archive location scp://[email protected]@192.168.255.11:/tmp/
[edit]
[email protected]# commit
Use of uninitialized value $source_address in concatenation (.) or string at /etc/commit/post-hooks.d/02vyatta-commit-push.pl line 78.
Archiving config...
  scp://192.168.255.11:/tmp/ Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/vyos/remote.py", line 294, in upload
    urlc(urlstring, *args, **kwargs).upload(local_path)
  File "/usr/lib/python3/dist-packages/vyos/remote.py", line 187, in upload
    with self._establish() as ssh, ssh.open_sftp() as sftp:
  File "/usr/lib/python3/dist-packages/vyos/remote.py", line 174, in _establish
    sock = socket.create_connection((self.hostname, self.port), socket.getdefaulttimeout(), self.source)
  File "/usr/lib/python3.7/socket.py", line 727, in create_connection
    raise err
  File "/usr/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
OSError: [Errno 101] Network is unreachable

Details

Difficulty level
Normal (likely a few hours)
Version
1.3.0
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

The similar issue and for the 1.3.1-S1

[email protected]# run show version 

Version:          VyOS 1.3.1-S1
Release train:    equuleus
...

[email protected]#  set system config-management commit-archive location scp://[email protected]:/tmp/
[edit]
[email protected]# commit
Archiving config...
  scp://192.168.255.11:/tmp/ Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/vyos/remote.py", line 293, in upload
    urlc(urlstring, *args, **kwargs).upload(local_path)
  File "/usr/lib/python3/dist-packages/vyos/remote.py", line 186, in upload
    with self._establish() as ssh, ssh.open_sftp() as sftp:
  File "/usr/lib/python3/dist-packages/vyos/remote.py", line 173, in _establish
    sock = socket.create_connection((self.hostname, self.port), socket.getdefaulttimeout(), self.source)
  File "/usr/lib/python3.7/socket.py", line 727, in create_connection
    raise err
  File "/usr/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
OSError: [Errno 101] Network is unreachable