Blue Prism - could not identify process owning the current foreground window

riderc1

Member
Hello - I am trying to run scheduled Blue Prism automations on our production server. It has login agent installed on this system. I specified that the Scheduler should run my automations.
If I right-click on the schedule and choose "run now" (while I'm logged in to the Runtime Resource (RR)), it works fine.
When I log out and let the Scheduler try to run the automations, it fails to complete and I receive the exception "could not identify process owning the current foreground window".
We are using Blue Prism 6.2.1. I've gone over the user guide for Login Agent and did not see any steps we missed during installation (including checking security/system policies). I've watched the videos posted by BusyPing and didn't really see any thing the video showed that we are not doing.
From the Control Center, I can see my RR system with the "key icon" indicating Login Agent is running. Any ideas on what to check?
 
Hello riderc, I cant help you with the solution as that is a problem I am facing as well, but I can tell you what is happening, the problem Is that when you ran the process using the scheduler but with a session that you started by your self and not by the login agent and you dont have the remote connection on screen then when your automation tries to activate a windows or an application the problem that you are facing triggers.
Blue Prism told this has something to do with the configuration of your remote connection or Virtual Machine, something related to VDI and whether it is persistent or not.
I am looking forward to know how to solve this as well.
 

riderc1

Member
I worked with our vendor today. I found out we did not have the BPRR.BAT file in our Startup folder on our RR server. When I moved the bat file in, at least Login Agent seems to be working correctly now. Our vendor said to have the Login process scheduled about 3 minutes before you want your regular schedule to run - it can take a while to login.
I still am having some issues but this was part of the problem I was having. If I make any additional progress, I will share my findings.
 

riderc1

Member
Hello - I am trying to run scheduled Blue Prism automations on our production server. It has login agent installed on this system. I specified that the Scheduler should run my automations.
If I right-click on the schedule and choose "run now" (while I'm logged in to the Runtime Resource (RR)), it works fine.
When I log out and let the Scheduler try to run the automations, it fails to complete and I receive the exception "could not identify process owning the current foreground window".
We are using Blue Prism 6.2.1. I've gone over the user guide for Login Agent and did not see any steps we missed during installation (including checking security/system policies). I've watched the videos posted by BusyPing and didn't really see any thing the video showed that we are not doing.
From the Control Center, I can see my RR system with the "key icon" indicating Login Agent is running. Any ideas on what to check?
After I fixed the Login Agent problem by putting BPRR.BAT in the Startup folder, my problem changed. I usually don't see the message that it could not identify the process in the current foreground window. Instead, I'm observing that my processes are not working correctly when Login Agent runs them.
In my Win32 client, it launches it. Logs in. Manipulates a few other screens (seemingly successful based on the Logs). However, there is a third screen that ends up timing out (my timer is set for 5 minutes - the screen usually takes no longer than 5 seconds to launch) and throwing an exception.
When I login and run the same process interactively (go to Schedule, right click, select "run now") - it works. I'm logged in as the same user that the Login Agent is using.
I'm puzzled over why it works interactively and not via Login Agent. I really wish Blue Prism had a way to record your session! This seems like it would be an obvious feature. (Not sure it would help, but at least we would have insight as to what its doing.)
 

riderc1

Member
Still not solved, but have some more testing ideas:
https://support.smartbear.com/testc...unning/via-rdp/keeping-computer-unlocked.html
The above article shows how to leave your system in Console and not the lock screen. For my problem, it doesn't help. If I'm logged in via remote desktop to the Resource PC and run the Schedule (or drag individual processes), they work fine.
When I have Login Agent do it, it fails. The trick above lets you not use Login Agent. So in theory, it should run the same as being logged in. In my case, it is having problems still.
I'm currently working with our system administrators to verify the Active Directory Global policies are set correctly. Local Policies are correct, but I don't have access to check Global.
The saga continues...
 

riderc1

Member
I got past the problem although I am somewhat confused as to why. This morning, a new problem occurred. My Win32 client has a combo box in which I was pressing the down arrow key a maximum of 30 times. If it found a string match, it pressed enter. If it pressed more than 30 down presses, it threw an exception so it didn't get stuck in a loop. Well, this morning it failed to find a match. (No clue why as I didn't make any changes here.)
I replaced my overly complicated part of the process of pressing down arrow keys/etc by directly entering the text and pressing Enter. I made the complicated section when I was still learning Blue Prism, so rookie mistake on this. Back to the point...this same screen has a Search button that was not getting clicked on by the Login Agent. I changed this from a button click to having the process use alt-s (the Win32 client supports it).
When I tested out the new way of inputting the report owner and pressing the button, my problem is resolved.
I worked with a consultant on this and he was baffled as to why it would cause the problems. I do not know if this will help anyone else as it could be a specific issue with the Win32 client I am using.
I did learn to review the log files of Blue Prism. The log file had a record of the exceptions and helped isolate where it was failing. I would also say another learning point is to keep it simple.
 
Hello - I am trying to run scheduled Blue Prism automations on our production server. It has login agent installed on this system. I specified that the Scheduler should run my automations.
If I right-click on the schedule and choose "run now" (while I'm logged in to the Runtime Resource (RR)), it works fine.
When I log out and let the Scheduler try to run the automations, it fails to complete and I receive the exception "could not identify process owning the current foreground window".
We are using Blue Prism 6.2.1. I've gone over the user guide for Login Agent and did not see any steps we missed during installation (including checking security/system policies). I've watched the videos posted by BusyPing and didn't really see any thing the video showed that we are not doing.
From the Control Center, I can see my RR system with the "key icon" indicating Login Agent is running. Any ideas on what to check?
Hi, also faced that issue. As I understood, it is somehow related with different login sessions on RR and if you restart that virtual PC and then try to login via Ligin Agent and run the process, you will see it works. At least it helped my team. So, every time you login to RR yourself you should keep in mind that restart is needed before you run you processes, otherwise bot is just stuck and does not “see” applications due to differen login sessions. Sure it is not a perfect solution and definitely there is something you can do in settings of your virtual machine, but I have no answere there. Thats what I know, hope it helps :)
 

riderc1

Member
Hi, also faced that issue. As I understood, it is somehow related with different login sessions on RR and if you restart that virtual PC and then try to login via Ligin Agent and run the process, you will see it works. At least it helped my team. So, every time you login to RR yourself you should keep in mind that restart is needed before you run you processes, otherwise bot is just stuck and does not “see” applications due to differen login sessions. Sure it is not a perfect solution and definitely there is something you can do in settings of your virtual machine, but I have no answere there. Thats what I know, hope it helps :)
Thank you for the reply. An imperfect solution that works is still a solution!
I am planning on trying to schedule a cleanup task before my automations run. The cleanup task will basically terminate the Win32 client Blue Prism is interacting with. For some reason, it doesn't always close out and then I get the error message. Blue Prism's "kill task" isn't working for this one.
My current thinking is to use Windows Task Scheduler, an hour before my Blue Prism scheduler runs, use PowerShell stop-process to end the task. I will also continue to research a better way. Maybe I'm not ending my task in the automations or similar.
 

Rajesh

New Member
I worked with our vendor today. I found out we did not have the BPRR.BAT file in our Startup folder on our RR server. When I moved the bat file in, at least Login Agent seems to be working correctly now. Our vendor said to have the Login process scheduled about 3 minutes before you want your regular schedule to run - it can take a while to login.
I still am having some issues but this was part of the problem I was having. If I make any additional progress, I will share my findings.


Can you help to understand what is in this BPRR.BAT file
 

riderc1

Member
Can you help to understand what is in this BPRR.BAT file
The BPRR.bat file starts the Blue Prism Runtime Resource. Our file has the following:
cd \Program Files\Blue Prism Limited\Blue Prism Automate\automate.exe /resourcepc /public
I don't know if this is part of the standard installation process or if your system administrator created it?
 

riderc1

Member
I did get past the problem. For my program, Login Agent would not work reliably by itself - but my processes worked if I was logged in.
I feel embarrassed, but it turns out I did not specify the domain for the Login Agent user! When you login interactively, it prompts you for the domain. After that was corrected, I now the Blue Prism running several processes every day without any problems.
 

pdyna

New Member
Hi All,

I faced the same issue this week and this forum helped me doing the RCA on the above issue and I finally found a solution that works perfectly for me. Also found some interesting reads on Blue Prism portal that helped me debug this issue.

The issue is mainly caused when Blue Prism tries to ask the operating system for the current foreground window token. The Windows operating system keeps a track of which window currently has the token which designates it as the current foregrounded window. So when the call to Activate Application action is made, Blue Prism asks the OS for this token. Due to the way various applications respond to such requests, or the permission levels for eg on VMs or bitness, Blue Prism is prevented from getting this token. Hence Blue Prism tells you it could not identify the current foreground process window that owns this token.

The solution is
  1. Use "Verify" or "Focus" actions on the application instead of "Activate Application". This highlights the application that you want to foreground.
  2. Make the application run mode to Foreground
With the above two steps my application is running perfectly fine.

Hope this helps :)
 

Hema__rao

New Member
Hi, I am launching notepad and closing notepad to keep the screen active but I see this foreground error comes up when the screen is active too. could you please help me??
 
Top