Page MenuHomeVyOS Platform

vyos-hostd unable to hostfile-update
Needs testing, Requires assessmentPublicBUG

Description

Nov 09 16:55:01 fw-1 vyos-hostsd[1130]:   File "/usr/libexec/vyos/services/vyos-hostsd", line 373, in validate_schema
Nov 09 16:55:01 fw-1 vyos-hostsd[1130]:     schema(data)
Nov 09 16:55:01 fw-1 vyos-hostsd[1130]:   File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 272, in __call__
Nov 09 16:55:01 fw-1 vyos-hostsd[1130]:     return self._compiled([], data)
Nov 09 16:55:01 fw-1 vyos-hostsd[1130]:   File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 594, in validate_dict
Nov 09 16:55:01 fw-1 vyos-hostsd[1130]:     return base_validate(path, iteritems(data), out)
Nov 09 16:55:01 fw-1 vyos-hostsd[1130]:   File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
Nov 09 16:55:01 fw-1 vyos-hostsd[1130]:     raise er.MultipleInvalid(errors)
Nov 09 16:55:01 fw-1 vyos-hostsd[1130]: voluptuous.error.MultipleInvalid: expected a list for dictionary value @ data['data']['dhcp-server-192.168.12.12']['Bedroom.scr1.rabbito.tech']['address']
Nov 09 16:55:01 fw-1 vyos-hostsd[1130]: Sent response: {'data': {'message': 'Applied 4 changes'}, 'error': "Invalid message: expected a list for dictionary value @ data['data']['dhcp-server-192.168.12.12']['Bedroom.scr1.rabbito.tech']['address']"}
Nov 09 16:55:30 fw-1 vyos-hostsd[1130]: Request data: {"type": "hosts", "op": "add", "data": {"dhcp-server-192.168.10.10": {"DESKTOP-CJJN36R.scr1.rabbito.tech": {"address": "192.168.10.10", "aliases": []}}}}
Nov 09 16:55:30 fw-1 vyos-hostsd[1130]: Invalid message: expected a list for dictionary value @ data['data']['dhcp-server-192.168.10.10']['DESKTOP-CJJN36R.scr1.rabbito.tech']['address']
Nov 09 16:55:30 fw-1 vyos-hostsd[1130]: Traceback (most recent call last):
Nov 09 16:55:30 fw-1 vyos-hostsd[1130]:   File "/usr/libexec/vyos/services/vyos-hostsd", line 603, in <module>
Nov 09 16:55:30 fw-1 vyos-hostsd[1130]:     validate_schema(msg)
Nov 09 16:55:30 fw-1 vyos-hostsd[1130]:   File "/usr/libexec/vyos/services/vyos-hostsd", line 373, in validate_schema
Nov 09 16:55:30 fw-1 vyos-hostsd[1130]:     schema(data)
Nov 09 16:55:30 fw-1 vyos-hostsd[1130]:   File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 272, in __call__
Nov 09 16:55:30 fw-1 vyos-hostsd[1130]:     return self._compiled([], data)
Nov 09 16:55:30 fw-1 vyos-hostsd[1130]:   File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 594, in validate_dict
Nov 09 16:55:30 fw-1 vyos-hostsd[1130]:     return base_validate(path, iteritems(data), out)
Nov 09 16:55:30 fw-1 vyos-hostsd[1130]:   File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
Nov 09 16:55:30 fw-1 vyos-hostsd[1130]:     raise er.MultipleInvalid(errors)
Nov 09 16:55:30 fw-1 vyos-hostsd[1130]: voluptuous.error.MultipleInvalid: expected a list for dictionary value @ data['data']['dhcp-server-192.168.10.10']['DESKTOP-CJJN36R.scr1.rabbito.tech']['address']
Nov 09 16:55:30 fw-1 vyos-hostsd[1130]: Sent response: {'data': {'message': 'Applied 4 changes'}, 'error': "Invalid message: expected a list for dictionary value @ data['data']['dhcp-server-192.168.10.10']['DESKTOP-CJJN36R.scr1.rabbito.tech']['address']"}
Nov 09 16:55:33 fw-1 vyos-hostsd[1130]: Request data: {"type": "hosts", "op": "add", "data": {"dhcp-server-192.168.12.11": {"806-Living-Room.scr1.rabbito.tech": {"address": "192.168.12.11", "aliases": []}}}}
Nov 09 16:55:33 fw-1 vyos-hostsd[1130]: Invalid message: expected a list for dictionary value @ data['data']['dhcp-server-192.168.12.11']['806-Living-Room.scr1.rabbito.tech']['address']
Nov 09 16:55:33 fw-1 vyos-hostsd[1130]: Traceback (most recent call last):
Nov 09 16:55:33 fw-1 vyos-hostsd[1130]:   File "/usr/libexec/vyos/services/vyos-hostsd", line 603, in <module>
Nov 09 16:55:33 fw-1 vyos-hostsd[1130]:     validate_schema(msg)
Nov 09 16:55:33 fw-1 vyos-hostsd[1130]:   File "/usr/libexec/vyos/services/vyos-hostsd", line 373, in validate_schema
Nov 09 16:55:33 fw-1 vyos-hostsd[1130]:     schema(data)
Nov 09 16:55:33 fw-1 vyos-hostsd[1130]:   File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 272, in __call__
Nov 09 16:55:33 fw-1 vyos-hostsd[1130]:     return self._compiled([], data)
Nov 09 16:55:33 fw-1 vyos-hostsd[1130]:   File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 594, in validate_dict
Nov 09 16:55:33 fw-1 vyos-hostsd[1130]:     return base_validate(path, iteritems(data), out)
Nov 09 16:55:33 fw-1 vyos-hostsd[1130]:   File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
Nov 09 16:55:33 fw-1 vyos-hostsd[1130]:     raise er.MultipleInvalid(errors)
Nov 09 16:55:33 fw-1 vyos-hostsd[1130]: voluptuous.error.MultipleInvalid: expected a list for dictionary value @ data['data']['dhcp-server-192.168.12.11']['806-Living-Room.scr1.rabbito.tech']['address']
Nov 09 16:55:33 fw-1 vyos-hostsd[1130]: Sent response: {'data': {'message': 'Applied 4 changes'}, 'error': "Invalid message: expected a list for dictionary value @ data['data']['dhcp-server-192.168.12.11']['806-Living-Room.scr1.rabbito.tech']['address']"}
Nov 09 16:56:50 fw-1 vyos-hostsd[1130]: Request data: {"type": "hosts", "op": "add", "data": {"dhcp-server-192.168.12.10": {"ESP-D7CE04.scr1.rabbito.tech": {"address": "192.168.12.10", "aliases": []}}}}
Nov 09 16:56:50 fw-1 vyos-hostsd[1130]: Invalid message: expected a list for dictionary value @ data['data']['dhcp-server-192.168.12.10']['ESP-D7CE04.scr1.rabbito.tech']['address']
Nov 09 16:56:50 fw-1 vyos-hostsd[1130]: Traceback (most recent call last):
Nov 09 16:56:50 fw-1 vyos-hostsd[1130]:   File "/usr/libexec/vyos/services/vyos-hostsd", line 603, in <module>
Nov 09 16:56:50 fw-1 vyos-hostsd[1130]:     validate_schema(msg)
Nov 09 16:56:50 fw-1 vyos-hostsd[1130]:   File "/usr/libexec/vyos/services/vyos-hostsd", line 373, in validate_schema
Nov 09 16:56:50 fw-1 vyos-hostsd[1130]:     schema(data)
Nov 09 16:56:50 fw-1 vyos-hostsd[1130]:   File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 272, in __call__
Nov 09 16:56:50 fw-1 vyos-hostsd[1130]:     return self._compiled([], data)
Nov 09 16:56:50 fw-1 vyos-hostsd[1130]:   File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 594, in validate_dict
Nov 09 16:56:50 fw-1 vyos-hostsd[1130]:     return base_validate(path, iteritems(data), out)
Nov 09 16:56:50 fw-1 vyos-hostsd[1130]:   File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
Nov 09 16:56:50 fw-1 vyos-hostsd[1130]:     raise er.MultipleInvalid(errors)
Nov 09 16:56:50 fw-1 vyos-hostsd[1130]: voluptuous.error.MultipleInvalid: expected a list for dictionary value @ data['data']['dhcp-server-192.168.12.10']['ESP-D7CE04.scr1.rabbito.tech']['address']
Nov 09 16:56:50 fw-1 vyos-hostsd[1130]: Sent response: {'data': {'message': 'Applied 4 changes'}, 'error': "Invalid message: expected a list for dictionary value @ data['data']['dhcp-server-192.168.12.10']['ESP-D7CE04.scr1.rabbito.tech']['address']"}
Nov 09 16:57:00 fw-1 vyos-hostsd[1130]: Request data: {"type": "hosts", "op": "add", "data": {"dhcp-server-192.168.6.72": {"pats-iPhone.scr1.rabbito.tech": {"address": "192.168.6.72", "aliases": []}}}}
Nov 09 16:57:00 fw-1 vyos-hostsd[1130]: Invalid message: expected a list for dictionary value @ data['data']['dhcp-server-192.168.6.72']['pats-iPhone.scr1.rabbito.tech']['address']
Nov 09 16:57:00 fw-1 vyos-hostsd[1130]: Traceback (most recent call last):
Nov 09 16:57:00 fw-1 vyos-hostsd[1130]:   File "/usr/libexec/vyos/services/vyos-hostsd", line 603, in <module>
Nov 09 16:57:00 fw-1 vyos-hostsd[1130]:     validate_schema(msg)
Nov 09 16:57:00 fw-1 vyos-hostsd[1130]:   File "/usr/libexec/vyos/services/vyos-hostsd", line 373, in validate_schema
Nov 09 16:57:00 fw-1 vyos-hostsd[1130]:     schema(data)
Nov 09 16:57:00 fw-1 vyos-hostsd[1130]:   File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 272, in __call__
Nov 09 16:57:00 fw-1 vyos-hostsd[1130]:     return self._compiled([], data)
Nov 09 16:57:00 fw-1 vyos-hostsd[1130]:   File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 594, in validate_dict
Nov 09 16:57:00 fw-1 vyos-hostsd[1130]:     return base_validate(path, iteritems(data), out)
Nov 09 16:57:00 fw-1 vyos-hostsd[1130]:   File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
Nov 09 16:57:00 fw-1 vyos-hostsd[1130]:     raise er.MultipleInvalid(errors)
Nov 09 16:57:00 fw-1 vyos-hostsd[1130]: voluptuous.error.MultipleInvalid: expected a list for dictionary value @ data['data']['dhcp-server-192.168.6.72']['pats-iPhone.scr1.rabbito.tech']['address']
Nov 09 16:57:00 fw-1 vyos-hostsd[1130]: Sent response: {'data': {'message': 'Applied 4 changes'}, 'error': "Invalid message: expected a list for dictionary value @ data['data']['dhcp-server-192.168.6.72']['pats-iPhone.scr1.rabbito.tech']['address']"}
Nov 09 16:57:02 fw-1 vyos-hostsd[1130]: Request data: {"type": "hosts", "op": "add", "data": {"dhcp-server-192.168.6.70": {"amazon-bafaee445.scr1.rabbito.tech": {"address": "192.168.6.70", "aliases": []}}}}

Details

Difficulty level
Unknown (require assessment)
Version
VyOS 1.4-rolling-202111090317
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

@anastrophe Describe please how to reproduce it?
Can be related to this commit d9b1c3df T2683

Indeed, this looks like the commit

A simple re-prdoucer is

    dhcp-server {
        hostfile-update
}

hostfile-update doesn't work at all.

cat /etc/hosts
### Autogenerated by VyOS ###
### Do not edit, your changes will get overwritten ###

# Local host
127.0.0.1       localhost
127.0.1.1       fw-1
# The following lines are desirable for IPv6 capable hosts
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

# From 'system static-host-mapping' and DHCP server
# system
10.5.0.2        cluster-0.scr1.rabbito.tech
10.45.0.0       cluster-0-ie.scr1.rabbito.tech

Only static-host-mappings are getting populated

I wish I understood this subsystem better as I'd love to get it fixed. I'm going to take a closer look tomorrow

I have a fix that will make it send a single item list and pass the validation check

Viacheslav changed the task status from Open to Needs testing.Mon, Nov 29, 10:51 PM
vyos@scr1-fw-1:~$ show ver

Version:          VyOS 1.4-rolling-202111290926
Release train:    sagitta

Built by:         autobuild@vyos.net
Built on:         Mon 29 Nov 2021 09:26 UTC
Build UUID:       3c772f2c-5530-46b0-ae93-a91e4b0066e9
Build commit ID:  ff15b6b63ecf87

Architecture:     x86_64
Boot via:         installed image
System type:      bare metal

Hardware vendor:  HP
Hardware model:   ProLiant DL360 Gen9
Hardware S/N:     CZJ8110KSD
Hardware UUID:    32353537-3935-5a43-4a38-3131304b5344

Copyright:        VyOS maintainers and contributors

It appears this change hasn't been picked up yet.

@anthr76 Try vyos-1.4-rolling-202112010318-amd64.iso

Sadly my firewall rules got wiped on upgrade and I'm a little nervous know about going backwards. I will try one going forward in a week or so.