API publicIpAddressId is null for some instances v1.6.14

I’ve been having problems with the API after upgrading from v1.0.2(?) to v1.6.14. I scan the API to create DNS records and Nginx load balancer routes to exposed ports based on the env-stack-service name.

This has started failing on some containers after the upgrade. I can see the port exposed in the UI and the port, indeed is open but the API is wrong. In the global list of ports and also in the list of ports assigned to an instance I’m seeing “publicIpAddressId”: null where I’d expect an ID to follow for the public IP address. This happens only on some instances and not others and I can’t work out what the trigger is. This is an example of one broken port record.

{
"id": "1p334",
"type": "port",
"links": {
"self": "…/v2-beta/projects/1a5/ports/1p334",
"account": "…/v2-beta/projects/1a5/ports/1p334/account",
"instance": "…/v2-beta/projects/1a5/ports/1p334/instance",
"privateIpAddress": "…/v2-beta/projects/1a5/ports/1p334/privateipaddress"
},
"actions": {
"update": "…/v2-beta/projects/1a5/ports/1p334/?action=update",
"deactivate": "…/v2-beta/projects/1a5/ports/1p334/?action=deactivate"
},
"baseType": "port",
"name": null,
"state": "active",
"accountId": "1a5",
"bindAddress": "0.0.0.0",
"created": "2018-02-25T11:48:42Z",
"createdTS": 1519559322000,
"description": null,
"instanceId": "1i308",
"kind": "userPort",
"privateIpAddressId": "1ia255",
"privatePort": 8084,
"protocol": "tcp",
"publicIpAddressId": null,
"publicPort": 8084,
"removed": null,
"transitioning": "no",
"transitioningMessage": null,
"transitioningProgress": null,
"uuid": "db9ed4ef-a0d5-4555-8371-f3dd7a3da537"
},