Error executing OpenSpreadsheetAction

I am constantly getting this error message while trying to complete the action highlighted in yellow in both RPA Recorder and CT. I modified more than 80% of the script to try to work around the error. It worked as intended for a week and then started acting up again. I added wait time in Advanced actions, increased the timeout period in the hub.json file to 900ms.

Error executing OpenSpreadsheetAction com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing OpenSpreadsheetAction[id=843,name=Optional[OpenSpreadsheetAction],parent=842,children=[844, 845],arguments=ActionArguments[delay=[1000],timeoutMs=[10000],filePath=[${str_output_template_path}],xsi:type=[recorder:OpenSpreadsheetAction, recorder:OpenSpreadsheetAction],pollingInterval=[300],active=[true],comment=[Open Template file],awaitTimeout=[5000]]]
at com.workfusion.studio.rpa.recorder.playback.action.OpenSpreadsheetAction.tryExecuteScript(OpenSpreadsheetAction.java:108)
at com.workfusion.studio.rpa.recorder.playback.action.OpenSpreadsheetAction.execute(OpenSpreadsheetAction.java:71)
at com.workfusion.studio.rpa.recorder.playback.action.OpenSpreadsheetAction.execute(OpenSpreadsheetAction.java:16)
at com.workfusion.studio.rpa.recorder.playback.player.ActionPlayer.next(ActionPlayer.java:81)
at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:154)
at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.run(PlaybackLogic.java:112)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.openqa.selenium.WebDriverException: Session [f6544517-ba37-4458-8130-6b9ca47985dd] was terminated due to TIMEOUT
Command duration or timeout: 0 milliseconds
Build info: version: ‘9.3.0.5’, revision: ‘63553f3f1c’, time: ‘2019-03-15T13:41:27.26Z’
System info: host: ‘GERI850’, ip: ‘192.168.205.243’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_121’
Driver info: com.freedomoss.crowdcontrol.webharvest.selenium.wrapper.RemoteDriverWrapper
Capabilities [{imageSimilarityThreshold=0.6, extra.executor.id={Name=RPA Recorder}, CLOSE_ALL_WINDOWS=false, browserName=universal, javascriptEnabled=true, extra.capabilities.context={“browserType”:“universal”,“startInPrivate”:false,“blockImages”:false,“maximizeOnStartup”:false,“customCapabilities”:{“platform”:“WINDOWS”,“javascriptEnabled”:true,“SEARCH_ALL_WINDOWS”:true,“CLOSE_ALL_WINDOWS”:false,“imageSimilarityThreshold”:“0.6”},“executorId”:{“Name”:“RPA Recorder”}}, platformName=WINDOWS, SEARCH_ALL_WINDOWS=true, platform=WINDOWS}]
Session ID: f6544517-ba37-4458-8130-6b9ca47985dd
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:41)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:82)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:45)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:741)
at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:677)
at com.workfusion.rpa.helpers.Excel.openExcel(Excel.java:48)
at sun.reflect.GeneratedMethodAccessor155.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrap.invoke(StaticMetaMethodSite.java:133)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:102)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:209)
at Script240.run(Script240.groovy:1)
at com.workfusion.studio.rpa.recorder.playback.shell.GroovyShellWrapper.executeScript(GroovyShellWrapper.java:48)
at com.workfusion.studio.rpa.recorder.playback.player.PlaybackContext.executeScript(PlaybackContext.java:108)
at com.workfusion.studio.rpa.recorder.playback.action.OpenSpreadsheetAction.tryExecuteScript(OpenSpreadsheetAction.java:99)
at com.workfusion.studio.rpa.recorder.playback.action.OpenSpreadsheetAction.execute(OpenSpreadsheetAction.java:71)
at com.workfusion.studio.rpa.recorder.playback.action.OpenSpreadsheetAction.execute(OpenSpreadsheetAction.java:16)
at com.workfusion.studio.rpa.recorder.playback.player.ActionPlayer.next(ActionPlayer.java:81)
at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:154)
at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.run(PlaybackLogic.java:112)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.openqa.grid.common.exception.GridException: Session [f6544517-ba37-4458-8130-6b9ca47985dd] was terminated due to TIMEOUT
at org.openqa.grid.internal.ActiveTestSessions.getExistingSession(ActiveTestSessions.java:105)
at org.openqa.grid.internal.Registry.getExistingSession(Registry.java:398)
at org.openqa.grid.web.servlet.handler.RequestHandler.getSession(RequestHandler.java:230)
at org.openqa.grid.web.servlet.handler.RequestHandler.process(RequestHandler.java:115)
at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:84)
at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:841)
at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.seleniumhq.jetty9.server.Server.handle(Server.java:564)
at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:317)
at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:251)
at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:110)
at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.seleniumhq.jetty9.util.thread.Invocable.invokePreferred(Invocable.java:128)
at org.seleniumhq.jetty9.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
at java.lang.Thread.run(Thread.java:745)

1 Like

Hi @gstoyanova in your script, do you open a website and then the browser is left open for a long time and you don’t execute any action in it?

As a matter of fact, I do. The reason for that is, I don’t need the sequence that is giving me trouble to be executed at all if the website is not available to scrape data from, so I have the actions nested but I I’ve tried it both ways: nested and as a separate sequence using an if statement with a boolean to determine if the excel actions need to be executed at all or not.

@gstoyanova thank you. According to our support, the website being inactive shouldn’t be an issue in this case. What is the size of the Excel file you open in this action? Also, does it fail every time you run the script or does it run correctly at first and start failing after executing several times?

Thanks @ashapkina. It’s an empty template file (8 KB in size) I need to open, so I can output the results of the 4 For Each loops I run beforehand. The first For Each loop you see in the screenshot iterates through a maximum (could be less, depending on the boolean results from IF statements I use) of 100 rows of data so it finds and collects specific rows I need to output in the empty file. The following 3 loops just aggregate the outputs from the first For Each loop into a single output table variable.

The interesting thing is that I use the same empty template spreadsheet throughout the script: f.ex. earlier in the script, I create a log file and a running work file from it but the bot has no issues opening it up for these actions.

I increased the memory the bot can operate with from the standard 1 GB to 8 GB. I nested Open Spreadsheet in a Retry action and spread the attempts out by 1000 ms but that didn’t work either. In the first For Each loop I have multiple nested IF statements. I thought that may be bogging it down so I un-nested them to no avail (eventually reverted to what you see in the screenshot).

And yes, it fails every time I run it. I also tried using two different template files, with one of them being dedicated just to this action (I don’t use it anywhere else in the script), thinking maybe excel didn’t close out properly during previous Open Spreadsheet actions but I got the error again.

Could you execute the script one more time, wait for it to fail and then send us these logs:
C:\RPAExpress\Studio\logs
C:\RPAExpress\RPA\logs

Please also share the script (you cans end it via a personal message).

Thank you.

@ashapkina the script is run on demand when certain conditions are met, so I may not be able to provide the info you need right away. Let’s keep this thread open. Thank you!

1 Like

Thank you @gstoyanova. Sure, we’ll be looking forward to the details from you.

Hi @ashapkina I’ll be closing this thread since the script is rarely run and I ended it up first creating the output spreadsheet from template, then reopen and save data in it. Previously, I had nested actions inside the Open Spreadsheet action, which always led to the situation I described above. Thanks for your time!

2 Likes