UiPath CE Job Faulted : Invalid handle

( Installer: Exe, CE 2019.7.0 )

Hello,

I am able to run a workflow from platform.uipath.com whitout any problem when a remote connection desktop is open on the target machine, but i got an error as soon as is it closed.

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


The workflow (ok):

  1. Open website, login, download .ica, logoff, close
  2. Open .ica (wait image disapear on loading citrix app windows), click 3 image on the opened citrix (navigation and export file)
  3. Wait preparation and transfert of file (4min), close citrix app
  4. Upload file on FTP, remove local file

I have used a remote desktop connection from my workstation to the target Windows Server 2012R2, then installed UiPath Studio 2019.7.0 CE + robot from .exe, user is local admin of target server.
I encountered no real issues related to the workflow or the dev.
I got problem setting up the robot to behave as expected.

The error is always on the first “click image” activity after launching the citrix app.
I got no issue launching the job from Orchestrator when the remote desktop connection is Open (from workstation to target server) ; success.
I got an error launching the job from Orchestrator when the remote desktop connection is Closed (user not logged off, just disconnected) ; error : the handle is invalid.
When reconnecting the rdp i got the citrix app opened in the first expected state, just before the click image (half of the workflow done).


I have simplified the workflow to only 1 activty, the first “click image” on the citrix app, i have the same behavior.
RDP Opened on target : success.
RPD Closed on target : faulted : The handle is invalid.

I’ve done some search:
UiPath Robt: Robot is not working when remote desktop disconnected (not resolved)
https://docs.uipath.com/orchestrator/docs/frequently-encountered-orchestrator-errors#section--the-handle-is-invalid-

This error is displayed in the following cases:
A. Projects containing UI Automation - when a RDP connection already exists in the background (minimized).

I tried (with and without screenX/Y set to 1920*1080 in the orchestrator robot settings):

  • development licence + rdp on : success
  • develoment licence + rdp off : faulted
  • development licence + user logged off : robot not connected to orchestrator
  • unattended licence + rdp on : success
  • unattended licence + rdp off : faulted
  • unattended licence + user logged off : robot not connected to orchestrator

I went around the .msi installer, with enterprise trial 2019.4.4 and the robot service, without more success. I had some sort of conflict between the 2 UiPath instances after, some studio crashes when executing robot, ended up uninstalling both UiPath instances, reboot and reinstall 2019.7.0 CE, back to start.


I’d like to be able to run (manual or sheduled) my job (single "click image " activity) from orchestrator, when the remote desktop connection is closed or when the user is logged off (getting around error : “The handle is invalid”).
Can you help me figure it out ?

Kind Regards,
Ulysse

Same we are facing please can you please help us?