cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sumeth_002
Regular Visitor

UI flows unattended issue

Annotation 2020-07-06 112743.png

hi guys , 
 i  am having the problem as you guys above picture , i cant access the unattended flow and error message show ( " There is a user session on the target machine. Cannot execute unattended UI Flow")  . but i tested that flow in attend mode its run successfully for me . 
thank you . 

32 REPLIES 32

@Anonymous have unattended flows ever worked for you?

Have attended flows ever worked for you?

Do you have a current license for unattended RPA?

Physical or virtual machine? If virtual, what hypervisor?

To be clear, you are getting the following error, right?

"There is a user session on the target machine. Cannot execute unattended UI Flow"


Your target machine is not configured to login automatically, right? Can you login to the target machine and manually run the flow –not even attended (cloud) or unattended (cloud)– but direct from PAD? Just open Power Automate Desktop and try to run the flow in question directly from the PAD console. What happens? Now sign out of all user accounts and try running unattended flow. But first, are you sure the correct machine/gateway is selected for the flow to run in? Have you configured it with correct credentials?

Do you have the Power Automate Desktop gateway application installed or do you have it configured as a PAD "machine" connection?

Can you provide the exact output from the action that triggers the error? (scrubbed for private info of course)

No one can help you beyond providing links to the documentation unless you provide some more details about your situation and the context of the error you're seeing.

Anonymous
Not applicable

Hi HEATFreight, thanks for the reply.

 

Both attended and unattended have worked and do sometimes work on this VM. It seems to be simply unreliable. I have placed my PAD flow in a loop so it will retry it like 10 times or until it runs successfully and oftentimes it makes it before the 10 are up.

Knowing that it works sometimes, I suppose most of your questions get answered but let me try anyway.

I believe it is a physical machine, I log into it via Remote Desktop Connection.

This is the exact error. I don't think it'll let me see more details:

Jsalaz1989_1-1643128764308.png

I have been able to run the flow on that machine both from PAD directly as well as from Power Automate in attended mode (and again, unreliably as unattended as well).


To make sure nobody is signed in, I restart the machine and shortly after try to run the flow. Due to the aforementioned loop, it will then error out a couple of times until it finally is able to run successfully:

Jsalaz1989_2-1643129164423.png


It honestly just feels like unreliability of the Microsoft product but who knows.

 

Do you have physical access to the machine into which you are attempting to RDP? Does anyone else use that same machine besides yourself?

When you say 

I believe it is a physical machine, I log into it via Remote Desktop Connection.

that's the part you should stop doing!

Do not log into the machine via the remote desktop connection. Or if you need to login to verify the machine is running, then make sure to sign out of all user accounts on that machine before running the attended flow. Your remote desktop connection is blocking the "unattended" flow. The machine needs to be powered on but with no users signed in. No local users, no remote users, no users at all!


Anonymous
Not applicable

Of course not, I do not log in and then try to run the flow unattended, that would be dumb...

 

I'm saying that if and when I do want to check out the machine, I RDP into it. Then, to make sure nobody is logged in, I hit restart and a few minutes later (without logging back in obviously) I try to re-run my flow. I don't have physical access to it, but I'm pretty sure nobody else logs into it. 
I can say the unreliability is quite consistent, if that makes sense. Basically every time it will try to run it about 5-8 times, giving that error, until suddenly it manages to run it.

Once it runs successfully, do further runs also fail several times before succeeding? Or does it ever "hit its stride" so to speak, and run successfully several times in a row?

Is the Windows operating system on that machine fully patched and updated to the most current version? What about the PAD gateway / PAD app, are they both fully updated? Or do you use a PAD "Machine connection" rather than PAD gateway to connect to the machine on which to run unattended flows? I must admit some ignorance with regard to running unattended flows, but I feel like there could be some error I might be able to spot if I had all the details, because I run a ton of attended flows and I'm fairly proficient at working with those. Unattended can't be that much different, I wouldn't think.

But yeah it does sound like you know what you are doing and that you've done the right things to make this work. My guess is that the error is wrong. Maybe there is no other account signed in, but something else is causing that error to be generated. Maybe some Windows system credential in triggering as if it's a signed-in user. 

Can you open a Command Prompt and run

net user

and provide the output?

Or press ⊞Win+X and click Computer Management, then >Local Users and Groups >Users. What all sign-in accounts do you see?

I suggest following these instructions to verify that you are the only user signing in on that machine.

If no clear reason for issue, you should spool up a Hyper-V virtual machine on a machine that you do have physical access to, and attempt to run the unattended flows in that VM instead.

If issue persists, who knows... But if issue goes away, then you are probably not the only user on that machine you're currently trying to use.

Anonymous
Not applicable

IT maintains that machine. I have to assume it is patched and updated. I'm using a very recent PAD, perhaps the most recent, I can't imagine that it would fail just because it is one or two minor versions behind.

The two outputs:

Jsalaz1989_0-1643139832705.png

Jsalaz1989_1-1643139928894.png

Might have to get together with IT to check out the Event Viewer:

Jsalaz1989_3-1643140586319.png

And also to enable Hyper V.


I'm almost certain nobody else is using that machine, because (1) we're a tiny RPA team, (2) I run it in the morning in Europe and anybody who would try to use it would be in the US and I doubt they're logging in at 2 AM, (3) doesn't make sense that every time it consistently attempts to run a few times before finally succeeding, (4) there are many other posts out there claiming a similar issue, and (5) without wanting to muddy up the issue I am in parallel struggling with a similarly unreliable issue regarding a 'Could not attach to Edge' problem. Microsoft's official workaround for that problem is "make the action retry 20 times with 5 seconds in between". That workaround works half the time, the other half it attempts the 20 times and doesn't manage to attach and the entire flow fails. It just feels like an all-around unreliable product so I'm tempted to blame Microsoft rather than our infrastructure or code, but proving that feels harder than just putting up with the unreliability. 

Gauravmahajan
Frequent Visitor

@Anonymous Thank you for providing the level of detail that you have. Everything you've mentioned or are doing seems to be right. Also, we have been running unattended flows for a while now on multiple machines and have never faced this error unless of course there's an actual user session of some sorts on the machine.

 

So just an out of the ordinary thought here: Could it be that the loop is causing hanging sessions? A couple of things I can suggest:

1. Increase your allocation of unattended licenses to the environment and then test

2. Make sure multiple flows are not trying to run on that machine at the same time 

 

I would also recommend trying a clean test (you mentioned you have already tried this but I would also include steps 3 and 4 in your tests):

1. I would recommend first removing the for-loops removed from your calling cloud flow

2. Restart the machine

3. Login to it and make sure that all the windows services have started correctly  (power automate services and the on-prem data gateway service) 

4. log out of the machine 

5. now run your unattended flow

 

That's the only thing at least I can think of.

 

Failing all this, you (ideally) or your IT should be able to create a support ticket through the Power Platform admin center

 

Thank you and hope this helps 

Yeah it definitely looks possible that you have other accounts which could be trying to sign on to that system simultaneous to your attempted flow runs, but hard to verify without more info from IT.

I agree with @Gauravmahajan that simplifying the flow to avoid the loop and possible simultaneous flow runs might help you troubleshoot the issue. We use attended flows, so not exact same situation as you, but we had to implement a "flow running" flag to check flow activity before starting any new flows. We have a .txt file saved on the machine which is set to 0 if no flow is running, and before running any PAD flows we use a File System connector in Power Automate cloud flow to change that value to 1. Then after that flag has been set to 1, the cloud flow triggers the desktop flow, which also immediately writes 1 to flag .txt file, just in case by unlucky timing another flow has somehow set the flag back to 0 after the new flow's cloud trigger had already written 1. When the desktop flow finishes running, the last thing it does before exiting is reset the .txt file to 0 so that any other flows in queue can then run as well. Before each PAD flow runs, there is a loop running in the cloud flow to check for flag value of 0. Once value of 0 is returned, the loop exits. The cloud flow then sets the flag to 1 and launches the next PAD flow, which also writes 1... and so on.

This prevents the timeout error timer from starting until the flow is actually launching for real. As far as we can tell, Power Automate starts counting the PAD flow run time from the moment that Power Automate cloud flow triggers it, rather than from the moment the PAD flow actually begins running. Without the "flow running" flag, multiple flows can be queued up on the same machine such that the error timeout for a queued flow starts counting before the previous flow has finished running, thus causing cascades of unnecessary timeout errors.

The flag value logic completely resolves the issue of multiple queued PAD flows causing subsequent PAD flows to time out, well except in unlucky cases where multiple PAD flows are triggered nearly simultaneously. In that case, they may both see the same flag value of 0 before the other has had a chance to update the flag to 1. Thus whichever PAD flow happens to queue up later will still be at risk of timing out (we use short timeout durations so that no flow can get hung up and cause other flows to fail to run on time).

Anyway, I say all this because the idea that one flow run could interfere with another and present you with this error is intriguing! Does a flow run count as an active user session? But isn't PAD supposed to just deal with the incoming queue of flows and run them sequentially? Lot of stuff I don't understand here...

HEATFreight_0-1643150257324.png


I think you should make the simplest possible PAD flow and launch it from the simplest possible cloud flow, and only test adding additional complexity only once you have the simple stuff working reliably.

Some additional thoughts:

Do you have any scripts or group policies that run periodically on that machine in the background?

Is it possible that there is some script or group policy which is executing some code that –while running– makes it appear to the Power Automate system as if a user is signed in?

Not a Windows expert, so unsure of whether the premise of this question is even reasonable or if I'm being totally nonsensical, but it seems to me that your machine is doing things you don't understand and don't have much visibility into and which could interfere with your flow runs. It seems to me that you don't have complete assurance that there are no other RDP sessions and that there are no other scripts or programs running on that machine which might produce an "active session" error. Seems to me that starting fresh in an environment with no possibility of unknown external interference from other users or background programs is your best bet, but guessing that's not an option for you. If you don't have such a system, Power Automate unattended RPA probably ain't for you. Not sure of better alternatives. All I know is you either need the system all to yourself, or you need someone to orchestrate the management of exactly who might be RDPing into that system at any given time and to manage the execution of cloud flows that trigger PAD flows to coordinate resource usage among all users. Your IT folks probably need to spin up more resources if this one seems to be having conflicts between users.

Anonymous
Not applicable

Hi @HEATFreight and @Gauravmahajan, these are all good tips and it's definitely possible that one of them could reveal something about the machine I am not aware of. However, it seems like a lot of work to tease out the root cause so for the next few days I am going to shift gears a bit. I will try to just get Selenium (Python) running directly on that VM and see if it's a smoother experience. I understand you miss out on a lot of advantages of PAD when you roll your own stuff but you also avoid a lot of headaches. If I'm unsuccessful with this new strategy I'm sure I'll be back to test out your tips. Thanks for the help!

You ever figure it out?

I ended up building a sprawling canvas app to get rid of all the PAD flows I built to run browser automations on this janky legacy software we were stuck with, which tended to be slow and unreliable at times. Overall, a time-saver but still a massive boondoggle when things would fail for no apparent reason, where the usual culprit was probably the crappy website for said legacy software. Very difficult to track and correct errors from browser automations.

We went all-in on building a canvas app to fully replace the janky legacy software, and it's pretty sweet! Orders of magnitude improvement in runtime to complete the same tasks as well as in terms of development efficiency.

Anonymous
Not applicable

No, I ended up going that different route mentioned in my post so I never found out what the issue was with PAD.

this is still not functioning software.  I have paid for all the licenses needed to run automations in unattended mode and it still doesn't work.  i have followed all the BS resolution docs, read all the forums and still no solution to my problems.  i invested even more time than money into this software and it is an utter and complete waste of time.

If the error keeps coming up, it means that you have at least one user logged in.

The best way I have found to run unattended flows it's to restart the machine, even if it is a VM (I only use VM to run my flows).
Signin out of your use account, won't work. I have tested it and each time I sign out, the Power Automate Cloud tells me that there is a user session on the target machine.

 

My advise it's to restart the machine after every time you access it with your account (you don't need to restart it after the Power Automate Cloud ran a flow).

 

Hope this helps!

Helpful resources

Announcements

Community Roundup: A Look Back at Our Last 10 Tuesday Tips

As we continue to grow and learn together, it's important to reflect on the valuable insights we've shared. For today's #TuesdayTip, we're excited to take a moment to look back at the last 10 tips we've shared in case you missed any or want to revisit them. Thanks for your incredible support for this series--we're so glad it was able to help so many of you navigate your community experience!   Getting Started in the Community An overview of everything you need to know about navigating the community on one page!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Ranks and YOU Have you ever wondered how your fellow community members ascend the ranks within our community? We explain everything about ranks and how to achieve points so you can climb up in the rankings! Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Powering Up Your Community Profile Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile. Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Blogs--A Great Place to Start There's so much you'll discover in the Community Blogs, and we hope you'll check them out today!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Unlocking Community Achievements and Earning Badges Across the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. Check out some details on Community badges--and find out more in the detailed link at the end of the article! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Blogging in the Community Interested in blogging? Everything you need to know on writing blogs in our four communities! Get started blogging across the Power Platform communities today! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Subscriptions & Notifications We don't want you to miss a thing in the community! Read all about how to subscribe to sections of our forums and how to setup your notifications! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Getting Started with Private Messages & Macros Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Community User Groups Learn everything about being part of, starting, or leading a User Group in the Power Platform Community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Update Your Community Profile Today! Keep your community profile up to date which is essential for staying connected and engaged with the community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Thank you for being an integral part of our journey.   Here's to many more Tuesday Tips as we pave the way for a brighter, more connected future! As always, watch the News & Announcements for the next set of tips, coming soon!    

Calling all User Group Leaders and Super Users! Mark Your Calendars for the next Community Ambassador Call on May 9th!

This month's Community Ambassador call is on May 9th at 9a & 3p PDT. Please keep an eye out in your private messages and Teams channels for your invitation. There are lots of exciting updates coming to the Community, and we have some exclusive opportunities to share with you! As always, we'll also review regular updates for User Groups, Super Users, and share general information about what's going on in the Community.     Be sure to register & we hope to see all of you there!

April 2024 Community Newsletter

We're pleased to share the April Community Newsletter, where we highlight the latest news, product releases, upcoming events, and the amazing work of our outstanding Community members.   If you're new to the Community, please make sure to follow the latest News & Announcements and check out the Community on LinkedIn as well! It's the best way to stay up-to-date with all the news from across Microsoft Power Platform and beyond.    COMMUNITY HIGHLIGHTS   Check out the most active community members of the last month! These hardworking members are posting regularly, answering questions, kudos, and providing top solutions in their communities. We are so thankful for each of you--keep up the great work! If you hope to see your name here next month, follow these awesome community members to see what they do!   Power AppsPower AutomateCopilot StudioPower PagesWarrenBelzDeenujialexander2523ragavanrajanLaurensMManishSolankiMattJimisonLucas001AmikcapuanodanilostephenrobertOliverRodriguestimlAndrewJManikandanSFubarmmbr1606VishnuReddy1997theMacResolutionsVishalJhaveriVictorIvanidzejsrandhawahagrua33ikExpiscornovusFGuerrero1PowerAddictgulshankhuranaANBExpiscornovusprathyooSpongYeNived_Nambiardeeksha15795apangelesGochixgrantjenkinsvasu24Mfon   LATEST NEWS   Business Applications Launch Event - On Demand In case you missed the Business Applications Launch Event, you can now catch up on all the announcements and watch the entire event on-demand inside Charles Lamanna's latest cloud blog.   This is your one stop shop for all the latest Copilot features across Power Platform and #Dynamics365, including first-hand looks at how companies such as Lenovo, Sonepar, Ford Motor Company, Omnicom and more are using these new capabilities in transformative ways. Click the image below to watch today!   Power Platform Community Conference 2024 is here! It's time to look forward to the next installment of the Power Platform Community Conference, which takes place this year on 18-20th September 2024 at the MGM Grand in Las Vegas!   Come and be inspired by Microsoft senior thought leaders and the engineers behind the #PowerPlatform, with Charles Lamanna, Sangya Singh, Ryan Cunningham, Kim Manis, Nirav Shah, Omar Aftab and Leon Welicki already confirmed to speak. You'll also be able to learn from industry experts and Microsoft MVPs who are dedicated to bridging the gap between humanity and technology. These include the likes of Lisa Crosbie, Victor Dantas, Kristine Kolodziejski, David Yack, Daniel Christian, Miguel Félix, and Mats Necker, with many more to be announced over the coming weeks.   Click here to watch our brand-new sizzle reel for #PPCC24 or click the image below to find out more about registration. See you in Vegas!       Power Up Program Announces New Video-Based Learning Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram. These include a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the image below to find out more!   UPCOMING EVENTS Microsoft Build - Seattle and Online - 21-23rd May 2024 Taking place on 21-23rd May 2024 both online and in Seattle, this is the perfect event to learn more about low code development, creating copilots, cloud platforms, and so much more to help you unleash the power of AI.   There's a serious wealth of talent speaking across the three days, including the likes of Satya Nadella, Amanda K. Silver, Scott Guthrie, Sarah Bird, Charles Lamanna, Miti J., Kevin Scott, Asha Sharma, Rajesh Jha, Arun Ulag, Clay Wesener, and many more.   And don't worry if you can't make it to Seattle, the event will be online and totally free to join. Click the image below to register for #MSBuild today!   European Collab Summit - Germany - 14-16th May 2024 The clock is counting down to the amazing European Collaboration Summit, which takes place in Germany May 14-16, 2024. #CollabSummit2024 is designed to provide cutting-edge insights and best practices into Power Platform, Microsoft 365, Teams, Viva, and so much more. There's a whole host of experts speakers across the three-day event, including the likes of Vesa Juvonen, Laurie Pottmeyer, Dan Holme, Mark Kashman, Dona Sarkar, Gavin Barron, Emily Mancini, Martina Grom, Ahmad Najjar, Liz Sundet, Nikki Chapple, Sara Fennah, Seb Matthews, Tobias Martin, Zoe Wilson, Fabian Williams, and many more.   Click the image below to find out more about #ECS2024 and register today!     Microsoft 365 & Power Platform Conference - Seattle - 3-7th June If you're looking to turbo boost your Power Platform skills this year, why not take a look at everything TechCon365 has to offer at the Seattle Convention Center on June 3-7, 2024.   This amazing 3-day conference (with 2 optional days of workshops) offers over 130 sessions across multiple tracks, alongside 25 workshops presented by Power Platform, Microsoft 365, Microsoft Teams, Viva, Azure, Copilot and AI experts. There's a great array of speakers, including the likes of Nirav Shah, Naomi Moneypenny, Jason Himmelstein, Heather Cook, Karuana Gatimu, Mark Kashman, Michelle Gilbert, Taiki Y., Kristi K., Nate Chamberlain, Julie Koesmarno, Daniel Glenn, Sarah Haase, Marc Windle, Amit Vasu, Joanne C Klein, Agnes Molnar, and many more.   Click the image below for more #Techcon365 intel and register today!     For more events, click the image below to visit the Microsoft Community Days website.      

Tuesday Tip | Update Your Community Profile Today!

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   We're excited to announce that updating your community profile has never been easier! Keeping your profile up to date is essential for staying connected and engaged with the community.   Check out the following Support Articles with these topics: Accessing Your Community ProfileRetrieving Your Profile URLUpdating Your Community Profile Time ZoneChanging Your Community Profile Picture (Avatar)Setting Your Date Display Preferences Click on your community link for more information: Power Apps, Power Automate, Power Pages, Copilot Studio   Thank you for being an active part of our community. Your contributions make a difference! Best Regards, The Community Management Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Super User of the Month | Ahmed Salih

We're thrilled to announce that Ahmed Salih is our Super User of the Month for April 2024. Ahmed has been one of our most active Super Users this year--in fact, he kicked off the year in our Community with this great video reminder of why being a Super User has been so important to him!   Ahmed is the Senior Power Platform Architect at Saint Jude's Children's Research Hospital in Memphis. He's been a Super User for two seasons and is also a Microsoft MVP! He's celebrating his 3rd year being active in the Community--and he's received more than 500 kudos while authoring nearly 300 solutions. Ahmed's contributions to the Super User in Training program has been invaluable, with his most recent session with SUIT highlighting an incredible amount of best practices and tips that have helped him achieve his success.   Ahmed's infectious enthusiasm and boundless energy are a key reason why so many Community members appreciate how he brings his personality--and expertise--to every interaction. With all the solutions he provides, his willingness to help the Community learn more about Power Platform, and his sheer joy in life, we are pleased to celebrate Ahmed and all his contributions! You can find him in the Community and on LinkedIn. Congratulations, Ahmed--thank you for being a SUPER user!

Top Solution Authors
Users online (5,837)