"Pending chrome addon to connect" causes the workflow to stop

Hello @Allan_Zimmermann ,
In my workflow I have an infinite while loop along with a try catch, which stops the openrpa flow if what I am trying to do doesn’t work anymore. Specifically there is a list on a website of which on each cycle rpa opens the first record until there are no more left, and when it is unable to open the first record(because there are none anymore) it catches the error to stop the flow using Stop OpenRPA activity.
Now the problem is that even though everything works fine most of the time, sometimes it just randomly stops. In the logs I saw it say Pending chrome addon to connect, after which the flow stops in the middle of whatever it’s currently doing, even though the records haven’t run out.
I am guessing that is because the chrome extension has an issue and since it can not access the first record on that website the flow stops?
What is the cause of this and how can I fix it?

Thank you.

Hi,

I’d like to help you, but I’m not sure I have the complete picture of what you are doing.

“There is a list on the website … rpa opens the first record.”
Do you mean the list contains links to other webpages and you follow the first link on every page until a page doesn’t have a list of links anymore?

1 Like

Not particularly. Imagine a list on a page. You open the first item in the list, and do some stuff with it. In the end you change the status to specify that, that item in the list has already been open, and when you go back in the list it is not in there anymore and the first item now is the next one in the list etc. Once all of the items have their statuses changed to done and dissapear from the list, since there is nothing there anymore get element activity returns and error, and i catch that error and stop the openrpa flow since the job is done until new items appear in the list.

Thank you for the clarification.

The part where the chrome addon is pending to connect is not ideal. I’ve seen that happening when something has crashed a chrome thread and it doesn’t go away.
The thread may be hanging around but not respond to anything anymore. I’ve also seen problems with the Google Crash Manager which starts after a crash and sometimes doesn’t go away by itself or it takes longer than you are willing to wait. Until you kill that process, it can cause instability on the Chrome connection.

There are several approaches to make something more robust.

One thing you can do is try a refresh call on the page when you detect a problem. (not sure if that works if ‘pending addon to connect’): add
OpenRPA.NM.ExecuteScript node with location.reload(); in the body.

Next you can try to kill the Chrome application with brute force by adding an

OpenRPA.Utilities.StartProcess with
Filename: "C:\Windows\System32\taskkill.exe" and
Arguments: "/IM chrome.exe /T /F"

Then wait (delay) a second and try again. This will kill chrome, regardless connection state. It will not immediately get rid of the crashmanager if it has started. You can’t kill it without elevated privileges.

Another thing (not wrong but a matter of style/taste): I would use exception handling for exceptions and not for the normal ‘to-be-expected’ flow. The situation were all items are handled is to be expected.
Set the minimum results for the get-element on 0. Inside the get element assign an ‘ItemFound’ variable to True. Continue or stop the flow based on that variable.
I use execeptions a lot for workitems handling. At the end of the try block update the workitem with success; in the catch-part set workitem to ‘retry’.

Also, I didn’t quite get whether you are using workitems to get the thing you want done done. Workitems (queues) offer a lot of options w.r. retrying or start a completely separate process if something fails (or succeeds). You can configure when to retry or not retry at all if an unrecoverable error is detected. If you are not using it already, it’s probably worth taking a look at.

Thank you for your suggestions. I will try to implement whatever’s possible.

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