Page MenuHomeVyOS Platform

DHCP-server op-mode errors
Closed, ResolvedPublicBUG

Description

If dhcp server not configured.

sever@vyos-1.3-roll:~$ show dhcp server leases sort DHCP 
usage: show_dhcp.py [-h] [-l | -s | --allowed {pool,sort,state}] [-p POOL]
                    [-S {ip,hardware_address,state,start,end,remaining,pool,hostname}]
                    [-t {all,active,free,expired,released,abandoned,reset,backup} [{all,active,free,expired,released,abandoned,reset,backup} ...]]
                    [-j]
show_dhcp.py: error: argument -S/--sort: invalid choice: 'DHCP' (choose from 'ip', 'hardware_address', 'state', 'start', 'end', 'remaining', 'pool', 'hostname')

And all next commands

sever@vyos-1.3-roll:~$ show dhcp server leases sort 
Possible completions:
  configured.   Show DHCP server leases sorted by the specified key
  DHCP
  is
  not
  service

The same it true and for ipv6

sever@vyos-1.3-roll:~$ show dhcpv6 server leases sort DHCPv6 
usage: show_dhcpv6.py [-h] [-l | -s | --allowed {pool,sort,state}] [-p POOL]
                      [-S {ip,state,last_comm,expires,remaining,type,pool,iaid_duid}]
                      [-t {all,active,free,expired,released,abandoned,reset,backup} [{all,active,free,expired,released,abandoned,reset,backup} ...]]
                      [-j]
show_dhcpv6.py: error: argument -S/--sort: invalid choice: 'DHCPv6' (choose from 'ip', 'state', 'last_comm', 'expires', 'remaining', 'type', 'pool', 'iaid_duid')
sever@vyos-1.3-roll:~$

The same with "state"

sever@vyos-1.3-roll:~$ show dhcp server leases state DHCP 
usage: show_dhcp.py [-h] [-l | -s | --allowed {pool,sort,state}] [-p POOL]
                    [-S {ip,hardware_address,state,start,end,remaining,pool,hostname}]
                    [-t {all,active,free,expired,released,abandoned,reset,backup} [{all,active,free,expired,released,abandoned,reset,backup} ...]]
                    [-j]
show_dhcp.py: error: argument -t/--state: invalid choice: 'DHCP' (choose from 'all', 'active', 'free', 'expired', 'released', 'abandoned', 'reset', 'backup')

show dhcp server leases state DHCP

The second bug, "configured." displayed with a dot at the end command.

show dhcp server leases sort configured.

Details

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

Related Objects

StatusSubtypeAssignedTask
OpenBUGNone
ResolvedBUGjjakob

Event Timeline

Viacheslav updated the task description. (Show Details)Apr 18 2020, 10:26 AM
jjakob changed the task status from Open to Confirmed.Apr 18 2020, 12:12 PM
jjakob claimed this task.

https://github.com/vyos/vyos-1x/pull/356

vyos@rt-home:~$ show dhcp server leases sort ab
Invalid sort key, choose from: ['ip', 'hardware_address', 'state', 'start', 'end', 'remaining', 'pool', 'hostname']
vyos@rt-home:~$ show dhcp server leases state ab
Invalid lease state, choose from: ['all', 'active', 'free', 'expired', 'released', 'abandoned', 'reset', 'backup']
vyos@rt-home:~$ show dhc
dhcp    dhcpv6  
vyos@rt-home:~$ show dhcpv6 server leases 

WARNING: DHCPv6 server is configured but not started. Data may be stale.
IPv6 address    State    Last communication    Lease expiration    Remaining    Type    Pool    IAID_DUID
--------------  -------  --------------------  ------------------  -----------  ------  ------  -----------
vyos@rt-home:~$ show dhcpv6 server leases state ab
Invalid lease state, choose from: ['all', 'active', 'free', 'expired', 'released', 'abandoned', 'reset', 'backup']
vyos@rt-home:~$ show dhcpv6 server leases sort ab
Invalid sort key, choose from: ['ip', 'state', 'last_comm', 'expires', 'remaining', 'type', 'pool', 'iaid_duid']
vyos@rt-home:~$ show dhcpv6 server leases pool 
Possible completions:
  6lan          Show DHCPv6 server leases for a specific pool

vyos@rt-home:~$ show dhcpv6 server leases pool a

WARNING: DHCPv6 server is configured but not started. Data may be stale.
Pool a does not exist.
jjakob changed the task status from Confirmed to Needs testing.Apr 19 2020, 11:29 AM
jjakob triaged this task as Low priority.
jjakob moved this task from Need Triage to In Progress on the VyOS 1.3 Equuleus board.

show dhcp server leases now works, but I've found show dhcp server statistics is broken as well:

vyos@cr01b-vyos:~$ show dhcp server statistics
Traceback (most recent call last):
  File "/usr/libexec/vyos/op_mode/show_dhcp.py", line 243, in <module>
    leases = len(get_leases(lease_file, state='active', pool=p))
TypeError: get_leases() missing 1 required positional argument: 'leases'

vyos@cr01b-vyos:~$ show dhcp server leases

IP address    Hardware address    State    Lease start          Lease expiration     Remaining    Pool    Hostname
------------  ------------------  -------  -------------------  -------------------  -----------  ------  ----------------
1.1.1.2   00:00:00:00:00:00   active   2020/04/19 14:56:47  2020/04/20 14:56:47  2:09:00      INT
1.1.1.4   00:00:00:00:00:00   active   2020/04/19 18:22:15  2020/04/20 18:22:15  5:34:28      INT
1.1.1.7   00:00:00:00:00:00   active   2020/04/20 05:52:19  2020/04/21 05:52:19  17:04:32     INT     09AA01AC22160184
1.1.1.9   00:00:00:00:00:00   active   2020/04/20 12:16:32  2020/04/21 12:16:32  23:28:45     INT
1.1.1.10  00:00:00:00:00:00   active   2020/04/19 19:10:02  2020/04/20 19:10:02  6:22:15      INT     hubv3-3011345827
1.1.1.2   00:00:00:00:00:00   active   2020/04/20 09:27:38  2020/04/21 09:27:38  20:39:51     INT     TRAE-GS9
1.1.1.4   00:00:00:00:00:00   active   2020/04/20 11:59:47  2020/04/21 11:59:47  23:12:00     INT     tree01-c7
`

Yeah, I missed that one. Thanks for fixing it c-po.

That fixed it for me. Thanks!

Viacheslav closed this task as Resolved.Aug 12 2020, 8:20 AM
pasik added a subscriber: pasik.Aug 12 2020, 12:57 PM