Solution for WssdAgent service entering stopped state
Intro
If we encounter errors in Azure Portal when trying to perform an operation towards our Azure Local stack (start VM, stop VM e.g.) and the error code is similar to this one: Error while dialing: dial tcp. :45000 i/o timeout. No Connection could be made because the target machine active refused it. Code 34. MOC resource has error.
It is likely because the service WssdAgent (MOC NodeAgent Service) is not running on all nodes in the Azure Local Stack.
WssdAgent service not running
If we try to start the service with command start-service -name wssdagent it will not start the service and output a generic error.
In application log in Event Viewer, we see error from this service with the generic messsage: incorrect function
And if we try to start the application for the service C:\Program Files\AksHci\wssdagent.exe, we might get a long error message, and at the bottom of this message we see these lines:
Failed to join CloudAgent : Login failed with error: rpc error: code = Unauthenticated desc = Valid Token Required: Token is expired false. Retrying … 2026/03/09 04:24:34 into invalid token Login failed with error: rpc error: code = Unauthenticated desc = Valid Token Required: Token is expired 2026/03/09 04:24:34 Unable to login to cloudagent Login failed with error: rpc error: code = Unauthenticated desc = Valid Token Required: Token is expired. Login failed with error: rpc error: code = Unauthenticated desc = Valid Token Required: Token is expired
Note that we see a message about token is expired. So the real issue is that MOC operator tokens has expired, likely due to not updating the Azure Local stack every month. MOC operator tokens expires after 90 days, but they are rotated as part of updates. But we cannot update now and fix the issue because the MOC is not working.
Solution and recommendations
On one of the nodes (sign in with Remote Desktop Services, Remote PowerShell is not recommended for this task), execute this command to fix the MOC:
Repair-MOC
The command takes a few minutes to complete.
Now wait 10-15 minutes before trying to perform a new operation from Azure portal.
Final remark: remember to keep all your Azure Local stacks up to date. Patching every month would overcome this experience.
Have feedback on this post?
Send me a message and I'll get back to you.