Closed stephdl closed 6 months ago
In core 2.5.4-dev.1
The validator correctly checks if the VPN network value is a private network.
However the code does not handle a specific failure case: if I set "host bits" an unhandled error is returned. I'd expect the UI displays a specific error message, like "Not a network address: host bits must not be set".
Traceback (most recent call last):
File "/var/lib/nethserver/cluster/actions/create-cluster/50update", line 46, in <module>
ip_address = str(ipaddress.ip_network(network).network_address + NODE_ID)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/ipaddress.py", line 74, in ip_network
return IPv4Network(address, strict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/ipaddress.py", line 1517, in __init__
raise ValueError('%s has host bits set' % self)
ValueError: 10.5.4.2/16 has host bits set
VERIFIED
Steps to reproduce
Expected behavior
I expect an error to prevent to use this network, it is not a local private network
Actual behavior
The installation seems to succeed but when you try to install the samba account provider you have a failure certainly because it is not a private network but a public network
Components
core 2.5.3
See also
https://community.nethserver.org/t/ns8-create-domain-stuck-frozen/23004
thank Giancarlos Reyes Peralta