Page MenuHomeVyOS Platform

commit-archive source-address Interface Broken
Resolved (N/A)PublicBUG

Description

It looks like on 1.4, specifying an interface as a source is broken:

trae@cr01b-vyos# commit
Using source address lo
Archiving config...
  sftp://stor01z-rh8.int.trae32566.org:/int/cr01b-vyos Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/vyos/remote.py", line 287, in upload
    upload_sftp(local_path, url.hostname, url.path, username, password, port, source, progressbar)
  File "/usr/lib/python3/dist-packages/vyos/remote.py", line 166, in upload_sftp
    transfer_sftp('upload', *args, **kwargs)
  File "/usr/lib/python3/dist-packages/vyos/remote.py", line 143, in transfer_sftp
    sock.bind((source, 0))
socket.gaierror: [Errno -5] No address associated with hostname
trae@cr01b-vyos# show commit-archive 
 location sftp://USER:PASSWORD@stor01z-rh8.int.trae32566.org:/int/cr01b-vyos
 source-address lo

Details

Difficulty level
Unknown (require assessment)
Version
1.4-rolling-202106151212
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Related Objects

Event Timeline

trae32566 renamed this task from commit-archive source-address interface Broken to commit-archive source-address Interface Broken.Jun 16 2021, 7:03 AM
erkin changed the task status from Open to In progress.Jun 20 2021, 3:48 PM
erkin triaged this task as Normal priority.

This is still broken on the most recent rolling release:

trae@cr01a-vyos# commit
Using source address lo
Archiving config...
  sftp://stor01z-rh8.int.trae32566.org:/int/cr01a-vyos Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/vyos/remote.py", line 315, in upload
    upload_sftp(local_path, url.hostname, url.path, username, password, port, source, progressbar)
  File "/usr/lib/python3/dist-packages/vyos/remote.py", line 190, in upload_sftp
    transfer_sftp('upload', *args, **kwargs)
  File "/usr/lib/python3/dist-packages/vyos/remote.py", line 162, in transfer_sftp
    sock.connect((hostname, port))
OSError: [Errno 22] Invalid argument
[edit protocols bgp]
erkin changed the task status from Open to In progress.Jul 7 2021, 9:03 AM

@trae32566 I can't replicate this. Can you post your config?

trae@cr01a-vyos# show system config-management 
 commit-archive {
     location sftp://cr01a-vyos.int:<somePassword>@stor01z-rh8.int.trae32566.org:/int/cr01a-vyos
     source-address lo
 }
 commit-revisions 10000

The way sockets are handled in the last version should've fixed this once and for all.

Still broken:

trae@cr01b-vyos:~$ show conf com | grep arch
set service dhcp-server shared-network-name INT subnet 192.168.1.0/24 domain-search 'int.trae32566.org'
set service dhcp-server shared-network-name INT subnet 192.168.1.0/24 domain-search 'ipa.trae32566.org'
set service dhcp-server shared-network-name INT subnet 192.168.1.0/24 domain-search 'trae32566.org'
set system config-management commit-archive location 'sftp://USER:PASS@stor01z-rh8.int.trae32566.org:/int/cr01b-vyos'                                                                          
set system config-management commit-archive source-address 'lo'
set system domain-search domain 'int.trae32566.org'
set system domain-search domain 'ipa.trae32566.org'
set system domain-search domain 'trae32566.org'
trae@cr01b-vyos:~$ configure
[edit]
trae@cr01b-vyos# set system host-name temp
[edit]
trae@cr01b-vyos# commit
Using source address lo
Archiving config...
  sftp://stor01z-rh8.int.trae32566.org:/int/cr01b-vyos Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/vyos/remote.py", line 312, in upload
    urlc(urlstring, *args, **kwargs).upload(local_path)
  File "/usr/lib/python3/dist-packages/vyos/remote.py", line 202, in upload
    with self._establish() as ssh, ssh.open_sftp() as sftp:
  File "/usr/lib/python3/dist-packages/vyos/remote.py", line 189, in _establish
    sock = socket.create_connection((self.hostname, self.port), socket.getdefaulttimeout(), self.source)
  File "/usr/lib/python3.9/socket.py", line 843, in create_connection
    raise err
  File "/usr/lib/python3.9/socket.py", line 830, in create_connection
    sock.bind(source_address)
socket.gaierror: [Errno -5] No address associated with hostname
[edit]

This is on 1.4-rolling-202112160318

This comment was removed by trae32566.

I opened a new issue for this: T4090.