Cannot build new host when locations hav been enabled and then disabled.
I was testing the use of locations in our foreman 1.8.0 dev server. I created 2 locations and assigned some hosts to them. I disabled locations as it was not of value to us at this time.
After upgrading ( what appeared to be successfully ) to foreman 1.8.1 I could no longer build a new host, I was simply returned to the submit page again.
When looking at the Interfaces tab I saw a red banner indicating a network config error but there was nothing highlighted in the dialog box.
In the production.log I saw "Failed to save: Subnet is not defined for host's location."
I re-enabled locations and added all subnets to the first location and was able to build a new host, on disabling locations again new hosts failed with the same error
As a hack I manually edited the foreman database and removed location references in hosts, taxable_taxonomies and taxonomies, I was then able to build new hosts with locations disabled.