I am trying to update the states of alarms on a Corporate 2017 R1 system:
alarmClient.UpdateAlarm(alarm.EventHeader.ID, "Operator changed to InProgress", 4, 1, DateTime.UtcNow, "");
This works fine when logged in with windows authentication using current user.
But it throws the following exception when logged in using basic authentication (user is added to administrators role):
Exception thrown: ‘System.ServiceModel.FaultException`1’ in VideoOS.Platform.dll
This can also be recreated with the AlarmViewer example. Thanks for any help,
Regards Michael
I tried to reproduce but was unsuccesful.
Please supply the exception with stack trace information..
If you test with the same user logged in with Smart Client, does updating the state of alarms work as expected?
What version is the MIP SDK?
Exception:
Message = “Invalid authentication”
Source = “mscorlib”
StackTrace = “Server stack trace: \r\n bei System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)\r\n bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)\r\n bei System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)\r\n bei System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)\r\n\r\nException rethrown at [0]: \r\n bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)\r\n bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)\r\n bei VideoOS.Platform.Proxy.Alarm.IAlarmCommandToken.UpdateAlarm(String token, Guid id, String text, Int32 state, Int32 priority, DateTime time, String assignedTo)\r\n bei VideoOS.Platform.Proxy.AlarmClient.AlarmClientToken.UpdateAlarm(Guid id, String text, Int32 state, Int32 priority, DateTime time, String assignedTo)\r\n bei MilestoneDrv.MilestoneVMS.changeAlarmState(AlarmState state, Guid alarmid) in [C:\\…](file:C://…)”
Its MIP SDK 2017 R1. Using the basic user with SMart Client works as expected, no exceptions.
This is a mystery.
Is this correctly understood? -The exception happens not when you first create the alarmClient, but when you do the UpdateAlarm?
(AlarmViewer does a retrieve of alarms etc. before the button to set state to InProgress can be used, the exception happens with the line of code you list? Please confirm.)
If you make a brand new basic user in the administrators role, and test with that user, do you still see same issue?
Is there anything extra in the MIP logs? ([C:\ProgramData\Milestone\MIPSDK, C](file:C:/ProgramData/Milestone/MIPSDK,%C2%A0C):\ProgramData\Milestone\XProtect Event Server\logs and [C:\ProgramData\Milestone\XProtect](file:C:/ProgramData/Milestone/XProtect) Event Server\logs\MIPLogs)
Let me see the logs (just one day covering your testing).
Hi Bo,
today i did a new test with the AlarmViewer example and the exception now occurs on line 57 (GetAlarmLines).
AlarmLine[] alarms = alarmClient.GetAlarmLines(0, 10, new VideoOS.Platform.Proxy.Alarm.AlarmFilter()
But the stack trace is almost the same as in my post above:
“\r\nServer stack trace: \r\n bei System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)\r\n bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)\r\n bei System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)\r\n bei System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)\r\n\r\nException rethrown at [0]: \r\n bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)\r\n bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)\r\n bei VideoOS.Platform.Proxy.Alarm.IAlarmCommandToken.GetAlarmLines(String token, Int32 from, Int32 maxCount, AlarmFilter filter)\r\n bei VideoOS.Platform.Proxy.AlarmClient.AlarmClientToken.GetAlarmLines(Int32 from, Int32 maxCount, AlarmFilter filter)\r\n bei AlarmViewer.MainForm.OnLoad(Object sender, EventArgs e) in [C:\\Program](file:C://Program) Files[\\Milestone\\MIPSDK\\ComponentSamples\\AlarmViewer\\MainForm.cs](file://Milestone//MIPSDK//ComponentSamples//AlarmViewer//MainForm.cs):Zeile 57.”
I checked all the log files you named and the MIPSDK log containes lots of exceptions (attached it to the post). There seems to be a problem in the wcf message part, which throws an exception every 30 seconds.
UPDATE: A simple restart of the server machine solved the issue. Lets see if this problem occurs again after some time of usage.
Do you have any idea what could trigger this? Might it be a laptop that has been off the domain or changed profile? Has it happen before? In your experience, do you know if the restart will only be a temporary solution?
Perhaps I can invite you to open a Support Case and submit further logs?..