There appears to be a bug in the API where it is possible to update the "main" property of an interface to "1" even if another primary interface of the same type exists. Here's how to replicate it:
Steps to reproduce:
1. Create a host that has two zabbix agent interfaces (one primary, the other secondary).
2. Through the API method "interfaceUpdate" set the secondary interface property "main" to "1".
What is expected:
This API call should fail. It should not be possible to have two primary interfaces of the same type.
What happens:
The secondary interface becomes another primary interface. The UI then fails to load the host configuration page (as seen in the screen shot).