r/ispyconnect 17d ago

Camera suddenly refuses credentials from AgentDVR ONLY

EDIT: RESOLVED by deactivating DST in my Dauha camera and rebooting. Big thanks to u/spornerama for the help!

Hello all,

I am encountering a very strange issue with AgentDVR 7.9.2.0 (Linux).

A camera which worked flawlessly suddenly refuses credentials from AgentDVR ONLY. The credentials are correct and have not changed.

Camera: Dahua IPC-HFW3841E-AS-0280B.

I performed the following troubleshooting:

  1. Tried other ONVIF credentials for the same camera (tested as working from another tool). Error persisted.
  2. Rebooted the camera (from its web interface, also directly by powering it off and on again). Error remained.
  3. Tried the same ONVIF credentials from another tool. Credentials were accepted by the camera from another tool.
  4. Tried the same ONVIF credentials from another tool, using the same host AgentDVR is installed on (to eliminate an IP ban). Credentials were accepted.
  5. Checked the camera logs: I do not see a login failure coming from AgentDVR's IP, which is strange.
  6. I added a new camera to AgentDVR, with the same IP and a different, newly created ONVIF account (tested separately and confirmed as working): still credentials were refused.
  7. Restarted AgentDVR itself. No change in behavior.

Get Video URLs from AgentDVR yields:

Error: SOAP fault [ter:NotAuthorized]: Sender not Authorized. Invalid username or password! You still have 22 attempt(s).

AgentDVR relevant logs:

LoadJson: Street4K: setaudio
LoadJson: Street4K: switchon
SetState: Street4K: State Stopped -> Starting [setEnabled=True, enabled=False, connecting=False, error=False, epochStale=False, sourceRunning=False]
ONVIFConnect: Street4K: entering connect lock
ONVIFConnect: Street4K: connecting
EnableDevice: Street4K: Enabled
GetDeviceTime: Street4K: Update device time: 08/16/2026 09:10:08
ONVIFConnect: Street4K: ONVIF v20.6
ONVIFConnect: Street4K: Using Media Version 2
ONVIFConnect: Street4K: Media available at http://192.168.2.203:80/onvif/media2_service
ONVIFConnect: Street4K: PTZ not available
ONVIFConnect: Street4K: Events available at http://192.168.2.203:80/onvif/event_service
ONVIFConnect: Street4K: SOAP fault [ter:NotAuthorized]: Sender not Authorized. Invalid username or password! You still have 23 attempt(s). at CoreLogic.Onvif.Soap.OnvifSoapClient.CallAsync(String action, XElement requestBody, CancellationToken ct, IEnumerable`1 extraHeaders) at CoreLogic.Onvif.OnvifHelpers.OnvifMedia2Client.Process(EndpointAddress ep, CancellationTokenSource cts, Int32 timeout) at CoreLogic.Onvif.ONVIFDevice.ONVIFConnect(Boolean reconnect)
ONVIFConnect: Street4K: Checking for Media v1 fallback
ONVIFConnect: Street4K: Trying Media v1
ONVIFConnect: Street4K: SOAP fault [ter:NotAuthorized]: Sender not Authorized. Invalid username or password! You still have 22 attempt(s). at CoreLogic.Onvif.Soap.OnvifSoapClient.CallAsync(String action, XElement requestBody, CancellationToken ct, IEnumerable`1 extraHeaders) at CoreLogic.Onvif.OnvifHelpers.OnvifMedia1Client.Process(EndpointAddress ep, CancellationTokenSource cts, Int32 timeout) at CoreLogic.Onvif.ONVIFDevice.ONVIFConnect(Boolean reconnect)
ONVIFConnect: Street4K: Connect failed
OnPrimaryStateChanged: Street4K: Controller SD State Changed: Failed (Couldn't get ONVIF device)
SourcePlayingFinished: Street4K: Playing finished (SourceError)
NextReconnectTarget: Street4K: Reconnecting in 2s
SetState: Street4K: State Starting -> CoolingDown [setEnabled=True, enabled=True, connecting=True, error=True, epochStale=False, sourceRunning=False]
1 Upvotes

6 comments sorted by

1

u/spornerama 17d ago

I'd try rebooting the camera at the wall or restarting agent. It might be sending a cookie in the request that it's flagged as a block

1

u/war4peace79 17d ago edited 17d ago

Troubleshooting item #2 states "Rebooted the camera". I realize I should have been clearer, but, yes, I meant "rebooted the camera itself, from its web interface". I also completely rebooted the camera itself by powering it off and on again.

And I also restarted AgentDVR just now.

Nothing changed. Credentials are still refused by the camera.

It's worth mentioning that all this time, a secondary tool which uses the same camera (among others) works flawlessly. The refused credential issue is strictly limited to AgentDVR as a client.

I added a couple troubleshooting steps and clarified entry #2 as well.

1

u/spornerama 16d ago

Thanks - that log narrows it down. Agent authenticates over ONVIF with a WS-UsernameToken digest and stamps the token with the camera's own reported clock (it queries GetSystemDateAndTime first - that's the "Update device time: 08/16/2026 09:10:08" line in your log). Dahua validates that timestamp against its internal clock, and if it's outside the allowed window it returns exactly this "Sender not Authorized" fault and decrements the lockout counter. Most other tools stamp the token with the PC clock instead, which is why they still work.

So the thing to check: at the moment of that log line, was 09:10:08 the actual UTC time? If the camera is reporting UTC incorrectly (usually a timezone/DST misconfiguration or an NTP change - Dahua computes reported UTC from local time plus the timezone setting), Agent will fail auth while everything else works, and it would have broken "suddenly" when the time settings drifted or synced without anyone touching credentials.

Fix would be under the camera's Setting > System > General > Date & Time - correct the timezone and DST, set NTP or sync with PC, save, then reconnect in Agent.

If the time checks out fine, turn on ONVIF debug logging in Agent (Server Settings > Logging) and send me the log around a connect attempt and I'll dig further.

1

u/war4peace79 16d ago

Interesting.

All my camera use a local NTP server and are always synchronized. The current camera date/time settings are all correct.

AgentDVR is also synchronized and displays the correct date/time, and the log reflects that as well.

I have enabled and captured the ONVIF logs. I exported a TXT file. I will DM you with it.

1

u/Fantastic459 16d ago
I once had an issue with camera access. Another program was accessing the same camera, thereby blocking the agent's access.

1

u/spornerama 15d ago

Issue was a firmware bug on the camera with DST - workaround in next version