When `enable-ha` is passed existing juju machines to use as new controllers/mongodb hosts, the agents on those machines break with a panic trying to read from a nil state field.
To reproduce
1. Add two new machines to a newly bootstrapped environment (`juju add-machine`)
2. Enable HA using these two new machines (`juju enable-ha --to 1,2`)
* The Juju agents on these two new machines will have stopped, or at least not have restarted
* juju-mongodb* will not be installed on the new machines, though rs.config() will show them expected in the replica set and unreachable
3. Manually restart the agents on the new machines
* The agents will start and run for a while
* juju-mongodb* will be installed on each new node and rs.config() will show a good replica set
* The agents will soon die with a panic in the machine log when MongoInfo() fails to access a state object
* agent.conf will be updated on the new machines, but not with `stateaddresses` or `statepassword`
I've seen this using the manual provider and reproduced using gce with a build from ef17f71281d245540a9e5ed54a00095610ac0797.
As a work-around, adding the `stateaddresses` (`- localhost:37017`) and `statepassword` (same value as apipassword) fields to agent.conf before restarting the agents sees them restart without error.
Related to bug 1648375.