Bot fails when virtual machine closes

Hello, i have installed workfusion on a vrtual machine and when I run a bot in the control tower and close the virtual machine the robot fails. How can i do to solve this?

the bot fails in a Read File command, which is in the middle of the code, i mean, the bot execute a lot of instructions but when it comes to read file it fails.

@egerolamieekoR what is the error message when the bot fails?

Step name ‘RobotAcreditaciones(1.0 Desarrollo)’ has failed. Reason: ‘[urn:uuid:79BFC7CF8B8FDE6B721547644055951111] robotics-flow executePlugin exception: [nodeId=http://127.0.0.1:15410] com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing TemplateAction[templateName=FileReadAction.ftl,id=588,name=Optional[FileReadAction],parent=-71,nextSibling=589,arguments=ActionArguments[path=[${direccion_carpeta_bot}\ConsultasBase${nombre_carpeta_destino}pg${planilla_pg_numero_fila}.txt],targetVariable=[resultado_consulta_procesado],delay=[0],xsi:type=[recorder:FileReadAction, recorder:FileReadAction],active=[true],actionDetails=[(’${direccion_ca…ero_fila}.txt’ to ${resultado_consulta_procesado})],encoding=[UTF-8]]]’

Please share the whole error text.

in the control room thats the whole error text

org.webharvest.exception.PluginException: [urn:uuid:79BFC7CF8B8FDE6B721547644055951111] robotics-flow executePlugin exception: [nodeId=http://127.0.0.1:15410] com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing TemplateAction[templateName=FileReadAction.ftl,id=588,name=Optional[FileReadAction],parent=-71,nextSibling=589,arguments=ActionArguments[path=[${direccion_carpeta_bot}\ConsultasBase\${nombre_carpeta_destino}_pg_${planilla_pg_numero_fila}.txt],targetVariable=[resultado_consulta_procesado],delay=[0],xsi:type=[recorder:FileReadAction, recorder:FileReadAction],active=[true],actionDetails=[('${direccion_ca...ero_fila}.txt' to ${resultado_consulta_procesado})],encoding=[UTF-8]]]
	at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.RoboticsFlowPlugin.executePlugin(RoboticsFlowPlugin.java:116)
	at org.webharvest.runtime.processors.WebHarvestPlugin.execute(WebHarvestPlugin.java:125)
	at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127)
	at org.webharvest.runtime.Scraper.execute(Scraper.java:169)
	at org.webharvest.runtime.Scraper.execute(Scraper.java:182)
	at com.freedomoss.crowdcontrol.webharvest.executor.LocalWebharvestTaskExecutor.executeWebHarvestTask(LocalWebharvestTaskExecutor.java:187)
	at com.freedomoss.crowdcontrol.webharvest.executor.LocalWebharvestTaskExecutor.executeWebHarvestTask(LocalWebharvestTaskExecutor.java:97)
	at com.workfusion.service.machine.BotRecordExecutionService.process(BotRecordExecutionService.java:168)
	at com.workfusion.service.machine.BotRecordExecutionService.process(BotRecordExecutionService.java:139)
	at com.workfusion.service.machine.BotRecordExecutionService.processSubmissionWithAllocationLogger(BotRecordExecutionService.java:118)
	at com.workfusion.service.machine.BotRecordExecutionService.lambda$processRecord$0(BotRecordExecutionService.java:97)
	at com.workfusion.utils.thread.NamedThreadTemplate.executeWithNamedThread(NamedThreadTemplate.java:10)
	at com.workfusion.service.machine.BotRecordExecutionService.processRecord(BotRecordExecutionService.java:97)
	at com.workfusion.service.machine.thread.RecordProcessThread.run(RecordProcessThread.java:28)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.webharvest.exception.PluginException: com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing TemplateAction[templateName=FileReadAction.ftl,id=588,name=Optional[FileReadAction],parent=-71,nextSibling=589,arguments=ActionArguments[path=[${direccion_carpeta_bot}\ConsultasBase\${nombre_carpeta_destino}_pg_${planilla_pg_numero_fila}.txt],targetVariable=[resultado_consulta_procesado],delay=[0],xsi:type=[recorder:FileReadAction, recorder:FileReadAction],active=[true],actionDetails=[('${direccion_ca...ero_fila}.txt' to ${resultado_consulta_procesado})],encoding=[UTF-8]]]
	at com.freedomoss.crowdcontrol.webharvest.plugin.recorder.RecorderPlugin.executePlugin(RecorderPlugin.java:109)
	at org.webharvest.runtime.processors.WebHarvestPlugin.execute(WebHarvestPlugin.java:125)
	at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127)
	at org.webharvest.runtime.processors.BodyProcessor.execute(BodyProcessor.java:27)
	at org.webharvest.runtime.processors.WebHarvestPlugin.executeBody(WebHarvestPlugin.java:246)
	at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.RoboticsFlowPlugin.executePlugin(RoboticsFlowPlugin.java:105)
	... 16 more
Caused by: com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing TemplateAction[templateName=FileReadAction.ftl,id=588,name=Optional[FileReadAction],parent=-71,nextSibling=589,arguments=ActionArguments[path=[${direccion_carpeta_bot}\ConsultasBase\${nombre_carpeta_destino}_pg_${planilla_pg_numero_fila}.txt],targetVariable=[resultado_consulta_procesado],delay=[0],xsi:type=[recorder:FileReadAction, recorder:FileReadAction],active=[true],actionDetails=[('${direccion_ca...ero_fila}.txt' to ${resultado_consulta_procesado})],encoding=[UTF-8]]]
	at com.workfusion.studio.rpa.recorder.playback.flow.StandardControlFlow.execute(StandardControlFlow.java:54)
	at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:28)
	at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:15)
	at com.workfusion.studio.rpa.recorder.playback.player.ActionPlayer.next(ActionPlayer.java:53)
	at com.freedomoss.crowdcontrol.webharvest.plugin.recorder.RecorderPlaybackProcess.start(RecorderPlaybackProcess.java:79)
	at com.freedomoss.crowdcontrol.webharvest.plugin.recorder.RecorderPlugin.play(RecorderPlugin.java:123)
	at com.freedomoss.crowdcontrol.webharvest.plugin.recorder.RecorderPlugin.executePlugin(RecorderPlugin.java:104)
	... 21 more
Caused by: org.openqa.selenium.WebDriverException: C:\Users\bolivera\Desktop\BOT\ConsultasBase\19-01-16-13-07_pg_14.txt
Command duration or timeout: 0 milliseconds
Build info: version: '9.0.0.4', revision: 'e6e278acd9', time: '2018-06-19T14:40:11.651Z'
System info: host: 'WIN-NL6JBCEU095', ip: '10.231.50.165', os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_121'
Driver info: com.freedomoss.crowdcontrol.webharvest.selenium.wrapper.RemoteDriverWrapper
Capabilities [{extra.start.in.private=false, extra.executor.id={run.name=RobotAcreditaciones(1.0 Desarrollo) Process, task.uuid=92cc4ddf-f984-4bbf-b519-6264355e6df9, task.name=RobotAcreditaciones(1.0 Desarrollo), context.path=/workfusion, host.name=http://localhost:15280, run.author.email=john@doe.ex, run.uuid=92cc4ddf-f984-4bbf-b519-6264355e6df9, run.author.fullname=John Doe}, CLOSE_ALL_WINDOWS=false, browserName=universal, maximize.on.startup=true, javascriptEnabled=true, extra.capabilities.context={"browserType":"universal","startInPrivate":false,"blockImages":false,"maximizeOnStartup":true,"customCapabilities":{"extra.start.in.private":false,"CLOSE_ALL_WINDOWS":false,"SEARCH_ALL_WINDOWS":true},"executorId":{"host.name":"http://localhost:15280","context.path":"/workfusion","task.uuid":"92cc4ddf-f984-4bbf-b519-6264355e6df9","run.name":"RobotAcreditaciones(1.0 Desarrollo) Process","run.uuid":"92cc4ddf-f984-4bbf-b519-6264355e6df9","run.author.fullname":"John Doe","run.author.email":"john@doe.ex","task.name":"RobotAcreditaciones(1.0 Desarrollo)"}}, platformName=WINDOWS, SEARCH_ALL_WINDOWS=true, platform=WINDOWS}]
Session ID: 2a350297-5e24-4011-ada0-2c0de016d9b1
	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:656)
	at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:592)
	at com.workfusion.rpa.helpers.RPA.executeScript(RPA.java:864)
	at com.workfusion.rpa.helpers.RPA.executeGroovyScript(RPA.java:930)
	at com.workfusion.rpa.helpers.Resource.read(Resource.java:102)
	at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
	at Script133_genScript_952.run(Script133_genScript_952.groovy:5)
	at com.workfusion.studio.rpa.recorder.playback.shell.GroovyShellWrapper.executeScript(GroovyShellWrapper.java:90)
	at com.workfusion.studio.rpa.recorder.playback.player.PlaybackContext.executeScript(PlaybackContext.java:65)
	at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.executeBehavior(TemplateAction.java:33)
	at com.workfusion.studio.rpa.recorder.playback.flow.StandardControlFlow.execute(StandardControlFlow.java:46)
	... 27 more
Caused by: java.nio.file.NoSuchFileException: C:\Users\bolivera\Desktop\BOT\ConsultasBase\19-01-16-13-07_pg_14.txt
	at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
	at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:230)
	at java.nio.file.Files.newByteChannel(Files.java:361)
	at java.nio.file.Files.newByteChannel(Files.java:407)
	at java.nio.file.Files.readAllBytes(Files.java:3152)
	at com.workfusion.desktop.driver.resource.Resource.read(Resource.java:59)
	at sun.reflect.GeneratedMethodAccessor43.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:93)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrap.invoke(StaticMetaMethodSite.java:133)
	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:91)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
	at Script1.run(Script1.groovy:1)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:585)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:623)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:594)
	at com.workfusion.autoit.driver.AutoItDriver.executeGroovyScript(AutoItDriver.java:239)
	at com.workfusion.autoit.driver.AutoItDriver.executeScript(AutoItDriver.java:207)
	at com.workfusion.autoit.driver.AutoItDriver.executeScript(AutoItDriver.java:183)
	at com.workfusion.universal.driver.UniversalDriver.executeScript(UniversalDriver.java:149)
	at org.openqa.selenium.remote.server.handler.ExecuteScript.call(ExecuteScript.java:54)
	at org.openqa.selenium.remote.server.handler.WebDriverHandler.handle(WebDriverHandler.java:41)
	at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:133)
	at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:203)
	at org.openqa.selenium.remote.server.InMemorySession.execute(InMemorySession.java:98)
	at org.openqa.selenium.remote.server.WebDriverServlet.lambda$handle$0(WebDriverServlet.java:231)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)

In Control Tower, you can download the error log as an Excel file.

image

When you keep the virtual machine window open, does this action work correctly?

Yes, it works fine

events_root_92cc4ddf-f984-4bbf-b519-6264355e6df9_2019-01-16 01_39_41.xlsx (6.5 KB)

Does this file exist on the desktop on the virtual machine?
C:\Users\bolivera\Desktop\BOT\ConsultasBase\19-01-16-13-07_pg_14.txt

That file is created by the Robot using a sql query trhough command line, it seems that some things doesnt work if the virtual machine is closed. I dont understand because the virual machine is closed not shutted down or session closed. For the bot it should be as if it was on.

So the file is not created when the window is closed, and the bot cannot find the file? Are there any image-based actions?

yes, there are some mouse clicks

Perhaps, the image-based actions fail when the window is not opened.
Could you send the workflow so we try to reproduce the error (with no sensitive data)?

i tried a different version of the bot without mouse clics and using keystrokes instead and still fails

The bot needs to have an active Windows UI session. So to solve your case you need to have Windows Server + RPA Express Pro. In that case your bot will start in an RDP window.