Validation doesn't prevent "invalid address" error when creating subnets
When adding a subnet in the provisiong and having accidently a whitespace in front of the Network: eg " 192.168.16.0" instead of "192.168.16.0" I get this error:
Oops, we're sorry but something went wrong
x invalid address
If you feel this is an error with Foreman itself, please open a new issue with Foreman ticketing system, You would probably need to attach the Full trace and relevant log entries.
It appears when doing this for the first subnet.
I can add other subnets but I can not modify them, since this page shows where I would expect to see the already defined subnets
fixes #2285 - subnet validation - length of addresses, strip whitespace and fix common typos
#1 Updated by Dominic Cleal about 6 years ago
- Subject changed from problem with creating subnets to Validation doesn't prevent "invalid address" error when creating subnets
- Category set to Web Interface
There are validators for the various IP addresses, but it looks like they won't prevent execution of the IPAddr.new calls, which then throw exceptions with invalid IPs.
#6 Updated by Dominic Cleal almost 6 years ago
- Status changed from Assigned to Ready For Testing
#8 Updated by Dominic Cleal almost 6 years ago
Joseph Magen wrote:
Joost, I assume that the reason that you can create, but not edit, subnets is because of your role/permissions defined in foreman.
I think it's simply the exception being thrown breaking the UI. If you created an invalid subnet, the index page wouldn't be displayed as the to_label would throw exceptions from IPAddr.new when rendering the CIDR notation.