GetAlarmClient throws Alarm client not created exception

When I am calling the AlarmClientManager.GetAlarmClient I often get a MIPException with the message:

VideoOS.Platform.MIPException: Alarm Client not created: Unable to find EventServer via Registered Services

                IAlarmClient alarmClient = _alarmClientManager.GetAlarmClient(EnvironmentManager.Instance.MasterSite.ServerId);

It takes 60 seconds until the error occurs - so maybe it is some timeout that triggers the error. It also takes more than a minute to login and read the configuration when I run the XProtect Smart Client - is that normal?

When I finally get an alarm client without any errors, it will work fine and I can keep calling GetAlarmClient without any problems.

Is there anything I can do to make the AlarmClientManager work without these errors?

When I finally get an alarm client without any errors, it will work fine and I can keep calling GetAlarmClient without any problems.

Correction: The error actually reappears after some time, making the integration very unstable.

As the error mention the Registered Services, verify it is correct.

Management Client → Tools → Registerer Services, see following image.

The AlarmClient is hosted by the Event Server. Please troubleshoot if there are networking or firewall issues that might affect the network communication with the Event Server.

Finally; troubleshoot by examining the Event Server logs (at [C:\ProgramData\Milestone\XProtect](file:C:/ProgramData/Milestone/XProtect) Event Server\logs), you might find error mesages or similar in the logs that explains the issue.