Cannot bring the target application to the front because the Windows session is locked

Hi,
When you run the project from the studio - everything works. When run from the orchestrator, it gives an error:
Post source: Object
message: Click ‘TableRow’: Cannot bring the target application to the front because the Windows session is locked.
level: error
logType: Default

The same goes for the rest of the clicks. Maybe it’s a studio or orchestrator setting?
System.ComponentModel.Win32Exception (0x80004005): The handle is invalid
at System.Drawing.Graphics.CopyFromScreen(Int32 sourceX, Int32 sourceY, Int32 destinationX, Int32 destinationY, Size blockRegionSize, CopyPixelOperation copyPixelOperation)
at System.Drawing.Graphics.CopyFromScreen(Point upperLeftSource, Point upperLeftDestination, Size blockRegionSize, CopyPixelOperation copyPixelOperation)
at UiPath.Vision.UiImage.FromScreenRegion(Rectangle region)
at UiPath.Core.Image…ctor(Region screenRegion)

RemoteException wrapping UiPath.Core.ImageOperationException: System.ComponentModel.Win32Exception (0x80004005): The handle is invalid
at System.Drawing.Graphics.CopyFromScreen(Int32 sourceX, Int32 sourceY, Int32 destinationX, Int32 destinationY, Size blockRegionSize, CopyPixelOperation copyPixelOperation)
at System.Drawing.Graphics.CopyFromScreen(Point upperLeftSource, Point upperLeftDestination, Size blockRegionSize, CopyPixelOperation copyPixelOperation)
at UiPath.Vision.UiImage.FromScreenRegion(Rectangle region)
at UiPath.Core.Image…ctor(Region screenRegion) —> RemoteException wrapping System.ComponentModel.Win32Exception: The handle is invalid
at System.Drawing.Graphics.CopyFromScreen(Int32 sourceX, Int32 sourceY, Int32 destinationX, Int32 destinationY, Size blockRegionSize, CopyPixelOperation copyPixelOperation)
at System.Drawing.Graphics.CopyFromScreen(Point upperLeftSource, Point upperLeftDestination, Size blockRegionSize, CopyPixelOperation copyPixelOperation)
at UiPath.Vision.UiImage.FromScreenRegion(Rectangle region)
at UiPath.Core.Image…ctor(Region screenRegion)
— End of inner exception stack trace —
at UiPath.Core.Activities.ObsoleteTaskAsyncCodeActivity`1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at UiPath.Executor.BaseRunner.EndExecute(IAsyncResult result)
at UiPath.Executor.InProcessRunner.EndExecute(IAsyncResult result)
at UiPath.Core.Activities.ExecutorInvokeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

@111564 , Click the Simulate Click option in the Properties, it will work.

Thanks,
But I am getting this error:
Click ‘TableRow’: Click with ‘Simulate’ is not supported on this element. Use a different input method.

SendWindowMessages don’t work too

1 Like

did u solve it?

We are seeing this issue as well post upgrade to Orch 22.4.1. Did this begin with orch update for anyone else?

Any luck resolving this issue ? I am getting below error too.

Connect to the server with the service account and then SIGN OUT. Don’t just close the RDP window. SIGN OUT from the start menu. Don’t log into these servers manually, Orchestrator does that for you.

1 Like

No, there is no setting to avoid this. It’s how RDP sessions work. Users shouldn’t be logging into your bot servers at all. It interferes with Orchestrator. But yes, if anyone logs in with one of your robot accounts, they MUST SIGN OUT. Closing the RDP window leaves the session running which is explained in the popup you get when you close the RDP window.

image

2 Likes

Are you using the classic design? Maybe with the modern design you can use a browser application acvitity and use as input Chromium API, this works well on the background. also only unattended licenses work when it is locked

No they don’t. You should not be logging into your bot servers, and if for some reason you must log into it you must SIGN OUT completely from the start menu. Don’t just close the RDP window.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.