Doubts using paths from framework in python

Hello. I’m having a little doubt about Paths in robocorp.

I know that using the framework I can use the ${OUTPUT_DIR} to put my output files and I can found them in the controll room if I need.
But when I coding in python, how do I save files in a path that i can access with other task?

Hi,
If you need other steps in your process to access the files you are creating you need to look at Work Data Management.
So you need to add the file into a work item that gets passed to the next steps in your process.
So keyword would be Add Work Item File, but you should probably take a look at the producer-consumer examples and the cert. course III

The ${OUTPUT_DIR} and the more accurate %{ROBOT_ARTIFACTS} (defined in your robot.yaml) are only for artifacts which in concept are for debugging so the idea is “archeological digs find artifacts to figure out what happened”, so the artifacts are not really meant for active use during the process operation.

BR, Kari

1 Like

Ok, i did 2 bots, one create a work item with the file and other will consume. the first bot run but the second no.[2022-12-29T20:43:15.221]: Starting run with Robocorp Workforce Agent Core v6.20.9
[2022-12-29T20:43:15.221]: Running on: robocloud-runtime-191748e6-31a1-463e-8402-d072f23aeb0b-2022-12-29T20:43:09.108Z - linux - 4.14.294-220.533.amzn2.x86_64 - 0564efb8-4041-4c1c-a48f-2d8ef921ff6c - d00139b4-ea42-48ed-8d6e-4996a9ea5b29
[2022-12-29T20:43:15.221]: Process step: Freto → Main → attended process → Consumo Work Item
[2022-12-29T20:43:15.222]: Workspace URL: Control Room
[2022-12-29T20:43:15.222]: Run config: {“consoleMsgCharLimit”:500000,“consoleMsgCountLimit”:10000,“artifactUploadBatchSize”:1,“maxDurSeconds”:1200,“connLossTimeoutSeconds”:120,“executorTimeout”:180000,“videoEnabled”:false}
[2022-12-29T20:43:15.222]: -----------------------------------------------------------
[2022-12-29T20:43:15.222]: START execution of run 01600d1b-b432-48ee-87a1-9784e49feea6
[2022-12-29T20:43:15.222]: Agent Core new state: BUSY
[2022-12-29T20:43:15.222]: Sending heartbeat
[2022-12-29T20:43:15.222]: Sending state update
[2022-12-29T20:43:15.223]: > {“action”:“stateUpdate”,“roboworkerId”:“0564efb8-4041-4c1c-a48f-2d8ef921ff6c”,“agentSessionId”:“d00139b4-ea42-48ed-8d6e-4996a9ea5b29”,“seqNo”:2,“localTime”:“2022-12-29T20:43:15.223Z”,“state”:“BUSY”,“info”:{“currentRun”:{“processName”:“attended process”,“activityName”:“Consumo Work Item”,“processId”:“821f1b11-b15f-4021-bee5-c72eaeb949cd”,“runNo”:16},“metrics”:{“memoryUsage”:{“total”:33068552192,“free”:12820746240},“cpuUsage”:[{“model”:“AMD EPYC 7571”,“speed”:2549,“times”:{“user”:0,“nice”:0,“sys”:0,“idle”:700,“irq”:0}},{“model”:“AMD EPYC 7571”,“speed”:2548,“times”:{“user”:0,“nice”:0,“sys”:0,“idle”:700,“irq”:0}},{“model”:“AMD EPYC 7571”,“speed”:2547,“times”:{“user”:0,“nice”:0,“sys”:0,“idle”:700,“irq”:0}},{“model”:“AMD EPYC 7571”,“speed”:2544,“times”:{“user”:10,“nice”:0,“sys”:0,“idle”:710,“irq”:0}},{“model”:“AMD EPYC 7571”,“speed”:2549,“times”:{“user”:0,“nice”:0,“sys”:0,“idle”:710,“irq”:0}},{“model”:“AMD EPYC 7571”,“speed”:2548,“times”:{“user”:0,“nice”:0,“sys”:0,“idle”:710,“irq”:0}},{“model”:“AMD EPYC 7571”,“speed”:2548,“times”:{“user”:20,“nice”:0,“sys”:0,“idle”:690,“irq”:0}},{“model”:“AMD EPYC 7571”,“speed”:2547,“times”:{“user”:0,“nice”:0,“sys”:0,“idle”:700,“irq”:0}}],“diskSpaceInfo”:[{“fs”:“overlay”,“type”:“overlay”,“size”:21474836480,“used”:65536,“available”:21474770944,“use”:0,“mount”:“/”},{“fs”:“/dev/nvme1n1”,“type”:“xfs”,“size”:299853516800,“used”:13767667712,“available”:286085849088,“use”:4.59,“mount”:“/etc/hosts”}]}}}
[2022-12-29T20:43:15.223]: Setting connection loss timeout to: 120s
[2022-12-29T20:43:15.224]: > {“action”:“runEvent”,“eventType”:“START”,“roboworkerId”:“0564efb8-4041-4c1c-a48f-2d8ef921ff6c”,“agentSessionId”:“d00139b4-ea42-48ed-8d6e-4996a9ea5b29”,“seqNo”:1,“localTime”:“2022-12-29T20:43:15.224Z”,“runId”:“01600d1b-b432-48ee-87a1-9784e49feea6”,“data”:{“workDir”:“/home/worker/instance/runs/01600d1b-b432-48ee-87a1-9784e49feea6”}}
[2022-12-29T20:43:15.224]: Starting run with Robocorp Workforce Agent Core v6.20.9
[2022-12-29T20:43:15.224]: Loading activity package…
[2022-12-29T20:43:15.224]: - Downloading to: /home/worker/instance/runs/01600d1b-b432-48ee-87a1-9784e49feea6/package.zip
[2022-12-29T20:43:15.224]: > {“action”:“runEvent”,“eventType”:“BUNDLE_DL_START”,“roboworkerId”:“0564efb8-4041-4c1c-a48f-2d8ef921ff6c”,“agentSessionId”:“d00139b4-ea42-48ed-8d6e-4996a9ea5b29”,“seqNo”:2,“localTime”:“2022-12-29T20:43:15.224Z”,“runId”:“01600d1b-b432-48ee-87a1-9784e49feea6”,“data”:{“fileName”:“/home/worker/instance/runs/01600d1b-b432-48ee-87a1-9784e49feea6/package.zip”}}
[2022-12-29T20:43:15.297]: Return callback result: null
[2022-12-29T20:43:15.298]: > {“action”:“runEvent”,“eventType”:“BUNDLE_DL_END”,“roboworkerId”:“0564efb8-4041-4c1c-a48f-2d8ef921ff6c”,“agentSessionId”:“d00139b4-ea42-48ed-8d6e-4996a9ea5b29”,“seqNo”:3,“localTime”:“2022-12-29T20:43:15.298Z”,“runId”:“01600d1b-b432-48ee-87a1-9784e49feea6”,“data”:null}
[2022-12-29T20:43:15.300]: > {“action”:“runEvent”,“eventType”:“BUNDLE_INFO”,“roboworkerId”:“0564efb8-4041-4c1c-a48f-2d8ef921ff6c”,“agentSessionId”:“d00139b4-ea42-48ed-8d6e-4996a9ea5b29”,“seqNo”:4,“localTime”:“2022-12-29T20:43:15.300Z”,“runId”:“01600d1b-b432-48ee-87a1-9784e49feea6”,“data”:{“fileSize”:175582,“sha256”:“0bfa65004f980b003f33acc6c932053dcc6f05db7f5dfc02ad06ddff35bfee20”}}
[2022-12-29T20:43:15.300]: - Extracting to: /home/worker/instance/runs/01600d1b-b432-48ee-87a1-9784e49feea6/package
[2022-12-29T20:43:15.300]: > {“action”:“runEvent”,“eventType”:“BUNDLE_UNPACK_START”,“roboworkerId”:“0564efb8-4041-4c1c-a48f-2d8ef921ff6c”,“agentSessionId”:“d00139b4-ea42-48ed-8d6e-4996a9ea5b29”,“seqNo”:5,“localTime”:“2022-12-29T20:43:15.300Z”,“runId”:“01600d1b-b432-48ee-87a1-9784e49feea6”,“data”:{“destDir”:“/home/worker/instance/runs/01600d1b-b432-48ee-87a1-9784e49feea6/package”}}
[2022-12-29T20:43:15.363]: > {“action”:“runEvent”,“eventType”:“BUNDLE_UNPACK_END”,“roboworkerId”:“0564efb8-4041-4c1c-a48f-2d8ef921ff6c”,“agentSessionId”:“d00139b4-ea42-48ed-8d6e-4996a9ea5b29”,“seqNo”:6,“localTime”:“2022-12-29T20:43:15.363Z”,“runId”:“01600d1b-b432-48ee-87a1-9784e49feea6”,“data”:null}
[2022-12-29T20:43:15.363]: Activity package loaded
[2022-12-29T20:43:15.364]: Validating package configuration…
[2022-12-29T20:43:15.364]: Searching robot.yaml in: /home/worker/instance/runs/01600d1b-b432-48ee-87a1-9784e49feea6/package
[2022-12-29T20:43:15.365]: - minDepth = 7
[2022-12-29T20:43:15.365]: - packageYamlPath = /home/worker/instance/runs/01600d1b-b432-48ee-87a1-9784e49feea6/package/robot.yaml
[2022-12-29T20:43:15.366]: Rcc activity execution
[2022-12-29T20:43:15.366]: prepareEnvVariablesFromCloud()
[2022-12-29T20:43:15.366]: Injecting variables…
[2022-12-29T20:43:15.367]: - RC_ORGANIZATION_ID
[2022-12-29T20:43:15.367]: - RC_WORKSPACE_ID
[2022-12-29T20:43:15.367]: - RC_RUNTIME_ID
[2022-12-29T20:43:15.367]: - RC_PROCESS_ID
[2022-12-29T20:43:15.367]: - RC_PROCESS_NAME
[2022-12-29T20:43:15.368]: - RC_PROCESS_RUN_ID
[2022-12-29T20:43:15.368]: - RC_PROCESS_RUN_NUMBER
[2022-12-29T20:43:15.368]: - RC_ACTIVITY_ID
[2022-12-29T20:43:15.368]: - RC_ACTIVITY_NAME
[2022-12-29T20:43:15.368]: - RC_ACTIVITY_RUN_ID
[2022-12-29T20:43:15.368]: - RC_WORKITEM_ID
[2022-12-29T20:43:15.369]: - RC_API_SECRET_HOST
[2022-12-29T20:43:15.369]: - RC_API_SECRET_TOKEN
[2022-12-29T20:43:15.369]: - RC_API_WORKITEM_HOST
[2022-12-29T20:43:15.369]: - RC_API_WORKITEM_TOKEN
[2022-12-29T20:43:15.369]: - RC_API_PROCESS_HOST
[2022-12-29T20:43:15.369]: - RC_API_PROCESS_TOKEN
[2022-12-29T20:43:15.370]: - RPA_HEADLESS_MODE
[2022-12-29T20:43:15.370]: Sending env description of /home/worker/instance/runs/01600d1b-b432-48ee-87a1-9784e49feea6/package/conda.yaml to https://api.eu1.robocloud.eu/rcc-v1/cache?token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXlJZCI6InRva2VuX3ZlbmRvcl8wIiwiY2FwYWJpbGl0aWVzIjp7InJjY0NhY2hlIjp7IndyaXRlIjp0cnVlfX0sInNlcnZpY2VOYW1lIjoiZXUxLXJjLXJ1bnRpbWUtcHJvdmlzaW9uZXIiLCJpYXQiOjE2NzIzNDY1ODksImV4cCI6MTY3MjM1MDE4OSwiaXNzIjoicm9ib2NvcnAvdG9rZW4tdmVuZG9yIn0.MEUCICPoeztnB9nCTzl77UOHWVQsuQH6H8ZIqr5sOgTYeufAAiEAw_tgCG8yhWrOqMVXj_6rDoXjLzjlI4hWPG4jPDOluRg
[2022-12-29T20:43:15.374]: Start task execution…
[2022-12-29T20:43:15.375]: - Running in Cloud container
[2022-12-29T20:43:15.375]: Setting run timeout: 1230s
[2022-12-29T20:43:15.375]: executeRun()
[2022-12-29T20:43:15.375]: - command: “/home/worker/bin/rcc” task run --space workforce --no-outputs --timeline --robot “/home/worker/instance/runs/01600d1b-b432-48ee-87a1-9784e49feea6/package/robot.yaml” --task “Consumo Work Item” --liveonly --controller agent.core.container
[2022-12-29T20:43:15.375]: - execDir: /home/worker/instance/runs/01600d1b-b432-48ee-87a1-9784e49feea6
[2022-12-29T20:43:15.375]: - output: /home/worker/instance/runs/01600d1b-b432-48ee-87a1-9784e49feea6/package/output
[2022-12-29T20:43:15.376]: Spawning new subprocess: Execute run
[2022-12-29T20:43:15.376]: - command: “/home/worker/bin/rcc” task run --space workforce --no-outputs --timeline --robot “/home/worker/instance/runs/01600d1b-b432-48ee-87a1-9784e49feea6/package/robot.yaml” --task “Consumo Work Item” --liveonly --controller agent.core.container
[2022-12-29T20:43:15.379]: Process: Execute run (72) added
[2022-12-29T20:43:15.389]: “/home/worker/instance/runs/01600d1b-b432-48ee-87a1-9784e49feea6/package/robot.yaml” as robot.yaml is:
[2022-12-29T20:43:15.420]: # For more details on the format and content:
[2022-12-29T20:43:15.420]: # rcc/recipes.md at master · robocorp/rcc · GitHub
[2022-12-29T20:43:15.420]:
[2022-12-29T20:43:15.420]: tasks:
[2022-12-29T20:43:15.421]: # Task names here are used when executing the bots, so renaming these is recommended.
[2022-12-29T20:43:15.421]: Main Belgo:
[2022-12-29T20:43:15.421]: shell: python main_portal_belgo.py
[2022-12-29T20:43:15.421]:
[2022-12-29T20:43:15.421]: Main KMM:
[2022-12-29T20:43:15.422]: shell: python main_portal_kmm.py
[2022-12-29T20:43:15.422]:
[2022-12-29T20:43:15.422]: Main Belgo2:
[2022-12-29T20:43:15.422]: shell: python portal_belgo_2.py
[2022-12-29T20:43:15.422]:
[2022-12-29T20:43:15.423]: Criacao Work Item:
[2022-12-29T20:43:15.423]: shell: python criacao_work_item_teste.py
[2022-12-29T20:43:15.423]:
[2022-12-29T20:43:15.423]: Consumo Work Item:
[2022-12-29T20:43:15.423]: shell: python consumo_work_item_teste.py
[2022-12-29T20:43:15.423]:
[2022-12-29T20:43:15.424]:
[2022-12-29T20:43:15.424]: condaConfigFile: conda.yaml
[2022-12-29T20:43:15.424]:
[2022-12-29T20:43:15.424]: environmentConfigs:
[2022-12-29T20:43:15.424]: - environment_windows_amd64_freeze.yaml
[2022-12-29T20:43:15.424]: - environment_linux_amd64_freeze.yaml
[2022-12-29T20:43:15.425]: - environment_darwin_amd64_freeze.yaml
[2022-12-29T20:43:15.425]: - conda.yaml
[2022-12-29T20:43:15.425]:
[2022-12-29T20:43:15.425]: artifactsDir: output
[2022-12-29T20:43:15.425]:
[2022-12-29T20:43:15.426]: PATH:
[2022-12-29T20:43:15.426]: - .
[2022-12-29T20:43:15.426]: PYTHONPATH:
[2022-12-29T20:43:15.426]: - .
[2022-12-29T20:43:15.426]: ignoreFiles:
[2022-12-29T20:43:15.427]: - .gitignore
[2022-12-29T20:43:15.427]:
[2022-12-29T20:43:15.427]: Environment setup start
[2022-12-29T20:43:15.427]: > {“action”:“runEvent”,“eventType”:“ENV_SETUP_START”,“roboworkerId”:“0564efb8-4041-4c1c-a48f-2d8ef921ff6c”,“agentSessionId”:“d00139b4-ea42-48ed-8d6e-4996a9ea5b29”,“seqNo”:7,“localTime”:“2022-12-29T20:43:15.427Z”,“runId”:“01600d1b-b432-48ee-87a1-9784e49feea6”,“data”:null}
[2022-12-29T20:43:15.428]: #### Progress: 01/13 v11.30.0 0.005s Fresh [private mode] holotree environment 78ae4d2a-6f34-fad1-407d-ae78830fce67.
[2022-12-29T20:43:15.428]: #### Progress: 02/13 v11.30.0 0.001s Holotree blueprint is “34f5bcfb72c9537b” [linux_amd64].
[2022-12-29T20:43:15.882]: #### Progress: 12/13 v11.30.0 0.492s Restore space from library [with 7 workers].
[2022-12-29T20:43:18.155]: Installation plan is: /home/worker/.robocorp/holotree/db8072d_b5db08f_79335166/rcc_plan.log
[2022-12-29T20:43:18.155]: Environment configuration descriptor is: /home/worker/.robocorp/holotree/db8072d_b5db08f_79335166/identity.yaml
[2022-12-29T20:43:18.156]: Environment setup end
[2022-12-29T20:43:18.156]: > {“action”:“runEvent”,“eventType”:“ENV_SETUP_END”,“roboworkerId”:“0564efb8-4041-4c1c-a48f-2d8ef921ff6c”,“agentSessionId”:“d00139b4-ea42-48ed-8d6e-4996a9ea5b29”,“seqNo”:8,“localTime”:“2022-12-29T20:43:18.156Z”,“runId”:“01600d1b-b432-48ee-87a1-9784e49feea6”,“data”:null}
[2022-12-29T20:43:18.156]: > {“action”:“runEvent”,“eventType”:“EXECUTE_START”,“roboworkerId”:“0564efb8-4041-4c1c-a48f-2d8ef921ff6c”,“agentSessionId”:“d00139b4-ea42-48ed-8d6e-4996a9ea5b29”,“seqNo”:9,“localTime”:“2022-12-29T20:43:18.156Z”,“runId”:“01600d1b-b432-48ee-87a1-9784e49feea6”,“data”:{“cmdline”:“"/home/worker/bin/rcc" task run --space workforce --no-outputs --timeline --robot "/home/worker/instance/runs/01600d1b-b432-48ee-87a1-9784e49feea6/package/robot.yaml" --task "Consumo Work Item" --liveonly --controller agent.core.container”}}
[2022-12-29T20:43:18.157]: #### Progress: 13/13 v11.30.0 2.273s Fresh holotree done [with 7 workers].
[2022-12-29T20:43:18.322]: Wanted Version Origin | No. | Available Version Origin | Status
[2022-12-29T20:43:18.322]: ------ ------- ------ + — + --------- ------- ------ + ------
[2022-12-29T20:43:18.322]: - - - | 1 | Authlib 1.2.0 pypi | N/A
[2022-12-29T20:43:18.323]: - - - | 2 | MouseInfo 0.1.3 pypi | N/A
[2022-12-29T20:43:18.323]: - - - | 3 | Pillow 9.3.0 pypi | N/A
[2022-12-29T20:43:18.323]: - - - | 4 | PyAutoGUI 0.9.53 pypi | N/A
[2022-12-29T20:43:18.323]: - - - | 5 | PyGetWindow 0.0.9 pypi | N/A
[2022-12-29T20:43:18.324]: - - - | 6 | PyJWT 2.6.0 pypi | N/A
[2022-12-29T20:43:18.324]: - - - | 7 | PyMsgBox 1.0.9 pypi | N/A
[2022-12-29T20:43:18.324]: - - - | 8 | PyPDF2 1.28.6 pypi | N/A
[2022-12-29T20:43:18.325]: - - - | 9 | PyQt5 5.15.7 pypi | N/A
[2022-12-29T20:43:18.325]: - - - | 10 | PyQt5-Qt5 5.15.2 pypi | N/A
[2022-12-29T20:43:18.325]: - - - | 11 | PyQt5-sip 12.11.0 pypi | N/A
[2022-12-29T20:43:18.325]: - - - | 12 | PyQtWebEngine 5.15.6 pypi | N/A
[2022-12-29T20:43:18.326]: - - - | 13 | PyQtWebEngine-Qt5 5.15.2 pypi | N/A
[2022-12-29T20:43:18.326]: - - - | 14 | PyRect 0.2.0 pypi | N/A
[2022-12-29T20:43:18.326]: - - - | 15 | PyScreeze 0.1.28 pypi | N/A
[2022-12-29T20:43:18.326]: - - - | 16 | PySocks 1.7.1 pypi | N/A
[2022-12-29T20:43:18.326]: - - - | 17 | PyYAML 5.4.1 pypi | N/A
[2022-12-29T20:43:18.326]: - - - | 18 | Pygments 2.13.0 pypi | N/A
[2022-12-29T20:43:18.326]: - - - | 19 | _libgcc_mutex 0.1 conda-forge | N/A
[2022-12-29T20:43:18.327]: - - - | 20 | _openmp_mutex 4.5 conda-forge | N/A
[2022-12-29T20:43:18.327]: - - - | 21 | async-generator 1.10 pypi | N/A
[2022-12-29T20:43:18.327]: - - - | 22 | attrs 22.2.0 pypi | N/A
[2022-12-29T20:43:18.327]: - - - | 23 | beautifulsoup4 4.11.1 pypi | N/A
[2022-12-29T20:43:18.327]: - - - | 24 | by 0.0.4 pypi | N/A
[2022-12-29T20:43:18.328]: - - - | 25 | bzip2 1.0.8 conda-forge | N/A
[2022-12-29T20:43:18.328]: - - - | 26 | ca-certificates 2022.12.7 conda-forge | N/A
[2022-12-29T20:43:18.328]: - - - | 27 | cached-property 1.5.2 pypi | N/A
[2022-12-29T20:43:18.328]: - - - | 28 | certifi 2022.12.7 pypi | N/A
[2022-12-29T20:43:18.328]: - - - | 29 | cffi 1.15.1 pypi | N/A
[2022-12-29T20:43:18.328]: - - - | 30 | chardet 3.0.4 pypi | N/A
[2022-12-29T20:43:18.328]: - - - | 31 | charset-normalizer 2.1.1 pypi | N/A
[2022-12-29T20:43:18.329]: - - - | 32 | click 8.1.3 pypi | N/A
[2022-12-29T20:43:18.329]: - - - | 33 | cryptography 37.0.4 pypi | N/A
[2022-12-29T20:43:18.329]: - - - | 34 | decorator 5.1.1 pypi | N/A
[2022-12-29T20:43:18.329]: - - - | 35 | defusedxml 0.7.1 pypi | N/A
[2022-12-29T20:43:18.329]: - - - | 36 | dnspython 2.2.1 pypi | N/A
[2022-12-29T20:43:18.330]: - - - | 37 | docutils 0.19 pypi | N/A
[2022-12-29T20:43:18.330]: - - - | 38 | et-xmlfile 1.1.0 pypi | N/A
[2022-12-29T20:43:18.330]: - - - | 39 | exceptiongroup 1.1.0 pypi | N/A
[2022-12-29T20:43:18.330]: - - - | 40 | exchangelib 4.9.0 pypi | N/A
[2022-12-29T20:43:18.330]: - - - | 41 | fonttools 4.38.0 pypi | N/A
[2022-12-29T20:43:18.330]: - - - | 42 | fpdf2 2.6.0 pypi | N/A
[2022-12-29T20:43:18.330]: - - - | 43 | furl 2.1.3 pypi | N/A
[2022-12-29T20:43:18.330]: - - - | 44 | graphviz 0.13.2 pypi | N/A
[2022-12-29T20:43:18.331]: - - - | 45 | h11 0.14.0 pypi | N/A
[2022-12-29T20:43:18.331]: - - - | 46 | html5lib 1.1 pypi | N/A
[2022-12-29T20:43:18.331]: - - - | 47 | htmldocx 0.0.6 pypi | N/A
[2022-12-29T20:43:18.331]: - - - | 48 | hubspot-api-client 4.0.6 pypi | N/A
[2022-12-29T20:43:18.331]: - - - | 49 | idna 3.4 pypi | N/A
[2022-12-29T20:43:18.332]: - - - | 50 | importlib-metadata 4.13.0 pypi | N/A

[2022-12-29T20:43:18.332]: - - - | 51 | isodate 0.6.1 pypi | N/A
[2022-12-29T20:43:18.332]: - - - | 52 | java-access-bridge-wrapper 0.9.5 pypi | N/A
[2022-12-29T20:43:18.332]: - - - | 53 | jsonpath-ng 1.5.3 pypi | N/A
[2022-12-29T20:43:18.332]: - - - | 54 | jsonschema 4.17.3 pypi | N/A
[2022-12-29T20:43:18.332]: - - - | 55 | ld_impl_linux-64 2.39 conda-forge | N/A
[2022-12-29T20:43:18.332]: - - - | 56 | libffi 3.4.2 conda-forge | N/A
[2022-12-29T20:43:18.333]: - - - | 57 | libgcc-ng 12.2.0 conda-forge | N/A
[2022-12-29T20:43:18.333]: - - - | 58 | libgomp 12.2.0 conda-forge | N/A
[2022-12-29T20:43:18.333]: - - - | 59 | libnsl 2.0.0 conda-forge | N/A
[2022-12-29T20:43:18.333]: - - - | 60 | libsqlite 3.40.0 conda-forge | N/A
[2022-12-29T20:43:18.333]: - - - | 61 | libuuid 2.32.1 conda-forge | N/A
[2022-12-29T20:43:18.333]: - - - | 62 | libzlib 1.2.13 conda-forge | N/A
[2022-12-29T20:43:18.333]: - - - | 63 | lxml 4.9.2 pypi | N/A
[2022-12-29T20:43:18.333]: - - - | 64 | msal 1.20.0 pypi | N/A
[2022-12-29T20:43:18.334]: - - - | 65 | mss 6.1.0 pypi | N/A
[2022-12-29T20:43:18.334]: - - - | 66 | ncurses 6.3 conda-forge | N/A
[2022-12-29T20:43:18.334]: - - - | 67 | netsuitesdk 1.24.0 pypi | N/A
[2022-12-29T20:43:18.335]: - - - | 68 | notifiers 1.3.3 pypi | N/A
[2022-12-29T20:43:18.335]: - - - | 69 | ntlm-auth 1.5.0 pypi | N/A
[2022-12-29T20:43:18.335]: - - - | 70 | numpy 1.24.1 pypi | N/A
[2022-12-29T20:43:18.335]: - - - | 71 | oauthlib 3.2.2 pypi | N/A
[2022-12-29T20:43:18.335]: - - - | 72 | openpyxl 3.0.10 pypi | N/A
[2022-12-29T20:43:18.335]: - - - | 73 | openssl 3.0.7 conda-forge | N/A
[2022-12-29T20:43:18.335]: - - - | 74 | orderedmultidict 1.0.1 pypi | N/A
[2022-12-29T20:43:18.336]: - - - | 75 | outcome 1.2.0 pypi | N/A
[2022-12-29T20:43:18.336]: - - - | 76 | packaging 21.3 pypi | N/A
[2022-12-29T20:43:18.336]: - - - | 77 | pandas 1.5.1 pypi | N/A
[2022-12-29T20:43:18.336]: - - - | 78 | pdfminer.six 20201018 pypi | N/A
[2022-12-29T20:43:18.336]: - - - | 79 | pip 22.1.2 conda-forge | N/A
[2022-12-29T20:43:18.336]: - - - | 80 | platformdirs 2.6.1 pypi | N/A
[2022-12-29T20:43:18.336]: - - - | 81 | ply 3.11 pypi | N/A
[2022-12-29T20:43:18.337]: - - - | 82 | proxy-tools 0.1.0 pypi | N/A
[2022-12-29T20:43:18.337]: - - - | 83 | pycparser 2.21 pypi | N/A
[2022-12-29T20:43:18.337]: - - - | 84 | pynput-robocorp-fork 4.0.0 pypi | N/A
[2022-12-29T20:43:18.337]: - - - | 85 | pyotp 2.8.0 pypi | N/A
[2022-12-29T20:43:18.337]: - - - | 86 | pyparsing 3.0.9 pypi | N/A
[2022-12-29T20:43:18.337]: - - - | 87 | pyperclip 1.8.2 pypi | N/A
[2022-12-29T20:43:18.337]: - - - | 88 | pyrsistent 0.19.2 pypi | N/A
[2022-12-29T20:43:18.337]: - - - | 89 | python 3.9.13 conda-forge | N/A
[2022-12-29T20:43:18.338]: - - - | 90 | python-dateutil 2.8.2 pypi | N/A
[2022-12-29T20:43:18.338]: - - - | 91 | python-docx 0.8.11 pypi | N/A
[2022-12-29T20:43:18.338]: - - - | 92 | python-dotenv 0.21.0 pypi | N/A
[2022-12-29T20:43:18.338]: - - - | 93 | python-xlib 0.33 pypi | N/A
[2022-12-29T20:43:18.338]: - - - | 94 | python3-xlib 0.15 pypi | N/A
[2022-12-29T20:43:18.339]: - - - | 95 | pytweening 1.0.4 pypi | N/A
[2022-12-29T20:43:18.339]: - - - | 96 | pytz 2022.7 pypi | N/A
[2022-12-29T20:43:18.339]: - - - | 97 | pywebview 3.6.3 pypi | N/A
[2022-12-29T20:43:18.339]: - - - | 98 | readline 8.1.2 conda-forge | N/A
[2022-12-29T20:43:18.339]: - - - | 99 | requests 2.28.1 pypi | N/A
[2022-12-29T20:43:18.339]: - - - | 100 | requests-file 1.5.1 pypi | N/A
[2022-12-29T20:43:18.339]: - - - | 101 | requests-ntlm 1.1.0 pypi | N/A
[2022-12-29T20:43:18.340]: - - - | 102 | requests-oauthlib 1.3.1 pypi | N/A
[2022-12-29T20:43:18.340]: - - - | 103 | requests-toolbelt 0.10.1 pypi | N/A
[2022-12-29T20:43:18.340]: - - - | 104 | robocorp-dialog 0.5.3 pypi | N/A
[2022-12-29T20:43:18.340]: - - - | 105 | robotframework 5.0.1 pypi | N/A
[2022-12-29T20:43:18.340]: - - - | 106 | robotframework-pythonlibcore 3.0.0 pypi | N/A
[2022-12-29T20:43:18.340]: - - - | 107 | robotframework-requests 0.9.4 pypi | N/A
[2022-12-29T20:43:18.340]: - - - | 108 | robotframework-seleniumlibrary 6.0.0 pypi | N/A
[2022-12-29T20:43:18.340]: - - - | 109 | robotframework-seleniumtestability 2.0.0 pypi | N/A
[2022-12-29T20:43:18.340]: - - - | 110 | rpaframework 17.4.0 pypi | N/A
[2022-12-29T20:43:18.341]: - - - | 111 | rpaframework-core 10.0.4 pypi | N/A
[2022-12-29T20:43:18.341]: - - - | 112 | rpaframework-dialogs 4.0.0 pypi | N/A
[2022-12-29T20:43:18.341]: - - - | 113 | rpaframework-pdf 5.0.0 pypi | N/A
[2022-12-29T20:43:18.341]: - - - | 114 | selenium 4.7.2 pypi | N/A
[2022-12-29T20:43:18.341]: - - - | 115 | setuptools 65.6.3 conda-forge | N/A
[2022-12-29T20:43:18.342]: - - - | 116 | simple-salesforce 1.12.2 pypi | N/A
[2022-12-29T20:43:18.342]: - - - | 117 | six 1.16.0 pypi | N/A
[2022-12-29T20:43:18.342]: - - - | 118 | sniffio 1.3.0 pypi | N/A
[2022-12-29T20:43:18.342]: - - - | 119 | sortedcontainers 2.4.0 pypi | N/A
[2022-12-29T20:43:18.342]: - - - | 120 | soupsieve 2.3.2.post1 pypi | N/A
[2022-12-29T20:43:18.342]: - - - | 121 | sqlite 3.40.0 conda-forge | N/A
[2022-12-29T20:43:18.342]: - - - | 122 | tenacity 8.1.0 pypi | N/A
[2022-12-29T20:43:18.342]: - - - | 123 | tk 8.6.12 conda-forge | N/A
[2022-12-29T20:43:18.342]: - - - | 124 | tqdm 4.64.1 pypi | N/A
[2022-12-29T20:43:18.346]: - - - | 125 | trio 0.22.0 pypi | N/A
[2022-12-29T20:43:18.346]: - - - | 126 | trio-websocket 0.9.2 pypi | N/A
[2022-12-29T20:43:18.346]: - - - | 127 | tweepy 3.10.0 pypi | N/A
[2022-12-29T20:43:18.346]: - - - | 128 | tzdata 2022g conda-forge | N/A
[2022-12-29T20:43:18.346]: - - - | 129 | tzdata 2022.7 pypi | N/A
[2022-12-29T20:43:18.347]: - - - | 130 | tzlocal 2.1 pypi | N/A
[2022-12-29T20:43:18.347]: - - - | 131 | urllib3 1.26.13 pypi | N/A
[2022-12-29T20:43:18.347]: - - - | 132 | webdriver-manager 3.8.5 pypi | N/A
[2022-12-29T20:43:18.347]: - - - | 133 | webencodings 0.5.1 pypi | N/A
[2022-12-29T20:43:18.347]: - - - | 134 | wheel 0.38.4 conda-forge | N/A
[2022-12-29T20:43:18.347]: - - - | 135 | wrapt 1.14.1 pypi | N/A
[2022-12-29T20:43:18.348]: - - - | 136 | wsproto 1.2.0 pypi | N/A
[2022-12-29T20:43:18.348]: - - - | 137 | xlrd 2.0.1 pypi | N/A
[2022-12-29T20:43:18.348]: - - - | 138 | xlutils 2.0.0 pypi | N/A
[2022-12-29T20:43:18.348]: - - - | 139 | xlwt 1.3.0 pypi | N/A
[2022-12-29T20:43:18.348]: - - - | 140 | xz 5.2.6 conda-forge | N/A
[2022-12-29T20:43:18.348]: - - - | 141 | zeep 4.2.1 pypi | N/A
[2022-12-29T20:43:18.349]: - - - | 142 | zipp 3.11.0 pypi | N/A
[2022-12-29T20:43:18.349]: ------ ------- ------ + — + --------- ------- ------ + ------
[2022-12-29T20:43:18.349]: Wanted Version Origin | No. | Available Version Origin | Status
[2022-12-29T20:43:18.349]:
[2022-12-29T20:43:18.349]: –
[2022-12-29T20:43:20.225]: Traceback (most recent call last):
[2022-12-29T20:43:20.225]: File “/home/worker/instance/runs/01600d1b-b432-48ee-87a1-9784e49feea6/package/consumo_work_item_teste.py”, line 5, in
[2022-12-29T20:43:20.225]: import pyautogui
[2022-12-29T20:43:20.225]: File “/home/worker/.robocorp/holotree/db8072d_b5db08f_79335166/lib/python3.9/site-packages/pyautogui/init.py”, line 249, in
[2022-12-29T20:43:20.225]: import mouseinfo
[2022-12-29T20:43:20.226]: File “/home/worker/.robocorp/holotree/db8072d_b5db08f_79335166/lib/python3.9/site-packages/mouseinfo/init.py”, line 223, in
[2022-12-29T20:43:20.226]: _display = Display(os.environ[‘DISPLAY’])
[2022-12-29T20:43:20.226]: File “/home/worker/.robocorp/holotree/db8072d_b5db08f_79335166/lib/python3.9/os.py”, line 679, in getitem
[2022-12-29T20:43:20.226]: raise KeyError(key) from None
[2022-12-29T20:43:20.226]: KeyError: ‘DISPLAY’
[2022-12-29T20:43:20.460]: ---- rcc timeline ----
[2022-12-29T20:43:20.461]: # percent seconds event
[2022-12-29T20:43:20.461]: 1: 0.0% 0.002 Start [private mode].
[2022-12-29T20:43:20.461]: 2: 0.0% 0.002 | [“/home/worker/bin/rcc” “task” “run” “–space” “workforce” “–no-outputs” “–timeline” “–robot” “/home/worker/instance/runs/01600d1b-b432-48ee-87a1-9784e49feea6/package/robot.yaml” “–task” “Consumo Work Item” “–liveonly” “–controller” “agent.core.container”]
[2022-12-29T20:43:20.462]: 3: 0.0% 0.003 | temp recycling done
[2022-12-29T20:43:20.462]: 4: 0.0% 0.004 | task environment load started
[2022-12-29T20:43:20.462]: 5: 0.0% 0.004 | 1/13 Fresh [private mode] holotree environment 78ae4d2a-6f34-fad1-407d-ae78830fce67.
[2022-12-29T20:43:20.462]: 6: 0.1% 0.005 | 2/13 Holotree blueprint is “34f5bcfb72c9537b” [linux_amd64].
[2022-12-29T20:43:20.462]: 7: 0.1% 0.005 | holotree blueprint query
[2022-12-29T20:43:20.462]: 8: 0.1% 0.005 | holotree load “/home/worker/.robocorp/hololib/catalog/34f5bcfb72c9537bv12.linux_amd64”
[2022-12-29T20:43:20.462]: 9: 9.1% 0.462 | [2022-12-29T20:43:20.463]: 10: 9.1% 0.462 | holotree content check start [2022-12-29T20:43:20.463]: 11: 9.1% 0.462 | | holotree treetop sync start [2022-12-29T20:43:20.463]: 12: 9.8% 0.497 | |
[2022-12-29T20:43:20.463]: 13: 9.8% 0.497 | [2022-12-29T20:43:20.463]: 14: 9.8% 0.497 | 12/13 Restore space from library [with 7 workers]. [2022-12-29T20:43:20.463]: 15: 9.8% 0.497 | holotree space restore start [34f5bcfb72c9537b] [2022-12-29T20:43:20.463]: 16: 9.8% 0.497 | | holotree load "/home/worker/.robocorp/hololib/catalog/34f5bcfb72c9537bv12.linux_amd64" [2022-12-29T20:43:20.463]: 17: 15.3% 0.778 | |
[2022-12-29T20:43:20.463]: 18: 15.3% 0.779 | | holotree load “/home/worker/.robocorp/holotree/db8072d_b5db08f_79335166.meta”
[2022-12-29T20:43:20.464]: 19: 19.9% 1.012 | | [2022-12-29T20:43:20.464]: 20: 19.9% 1.012 | | holotree digest start ["2fabf9c4e4a82ae7" -> "34f5bcfb72c9537b"] [2022-12-29T20:43:20.464]: 21: 19.9% 1.012 | | | holotree treetop sync start [2022-12-29T20:43:20.464]: 22: 20.2% 1.027 | | |
[2022-12-29T20:43:20.464]: 23: 20.2% 1.027 | | [2022-12-29T20:43:20.464]: 24: 20.2% 1.027 | | mode: coverted space from "2fabf9c4e4a82ae7" to "34f5bcfb72c9537b" [2022-12-29T20:43:20.464]: 25: 20.2% 1.027 | | holotree make branches start [2022-12-29T20:43:20.464]: 26: 20.2% 1.027 | | | holotree treetop sync start [2022-12-29T20:43:20.464]: 27: 21.5% 1.092 | | |
[2022-12-29T20:43:20.464]: 28: 21.5% 1.092 | | [2022-12-29T20:43:20.464]: 29: 21.5% 1.092 | | holotree restore start [2022-12-29T20:43:20.465]: 30: 21.5% 1.092 | | | holotree dirs sync start [2022-12-29T20:43:20.465]: 31: 50.1% 2.545 | | |
[2022-12-29T20:43:20.465]: 32: 50.1% 2.545 | | [2022-12-29T20:43:20.465]: 33: 54.5% 2.771 | | - dirty 8588/20714 [2022-12-29T20:43:20.465]: 34: 54.5% 2.771 |
[2022-12-29T20:43:20.465]: 35: 54.5% 2.771 | 13/13 Fresh holotree done [with 7 workers].
[2022-12-29T20:43:20.465]: 36: 54.6% 2.773 | rcc.agent.core.container:rcc.cli.run = v11.30.0
[2022-12-29T20:43:20.465]: 37: 54.6% 2.773 | robot execution starts (simple=false).
[2022-12-29T20:43:20.465]: 38: 57.8% 2.936 | execution environment listing
[2022-12-29T20:43:20.465]: 39: 57.8% 2.937 | wait logs done
[2022-12-29T20:43:20.466]: 40: 58.4% 2.965 | exec “/home/worker/.robocorp/holotree/db8072d_b5db08f_79335166/bin/python3.9” started
[2022-12-29T20:43:20.466]: 41: 99.9% 5.075 | robot execution done.
[2022-12-29T20:43:20.466]: 42: 99.9% 5.076 | removing current temp: /home/worker/.robocorp/temp/4d65822107fcfd1a
[2022-12-29T20:43:20.466]: 43: 99.9% 5.076 `
[2022-12-29T20:43:20.466]: 44: 100.0% 5.076 Now.
[2022-12-29T20:43:20.466]: ---- rcc timeline ----
[2022-12-29T20:43:20.467]: Error: exit status 1
[2022-12-29T20:43:20.469]: Process (72) closed with code: 10; signal: null
[2022-12-29T20:43:20.469]: Process: Execute run (72) removed
[2022-12-29T20:43:20.469]: Clearing timeout
[2022-12-29T20:43:20.469]: Execution done: {“code”:10,“signal”:null}
[2022-12-29T20:43:20.469]: > {“action”:“runEvent”,“eventType”:“EXECUTE_END”,“roboworkerId”:“0564efb8-4041-4c1c-a48f-2d8ef921ff6c”,“agentSessionId”:“d00139b4-ea42-48ed-8d6e-4996a9ea5b29”,“seqNo”:10,“localTime”:“2022-12-29T20:43:20.469Z”,“runId”:“01600d1b-b432-48ee-87a1-9784e49feea6”,“data”:{“code”:10,“signal”:null}}
[2022-12-29T20:43:20.470]: Task execution completed

[2022-12-29T20:43:20.225]: File “/home/worker/instance/runs/01600d1b-b432-48ee-87a1-9784e49feea6/package/consumo_work_item_teste.py”, line 5, in
[2022-12-29T20:43:20.225]: import pyautogui
[2022-12-29T20:43:20.225]: File “/home/worker/.robocorp/holotree/db8072d_b5db08f_79335166/lib/python3.9/site-packages/pyautogui/init.py”, line 249, in
[2022-12-29T20:43:20.225]: import mouseinfo
[2022-12-29T20:43:20.226]: File “/home/worker/.robocorp/holotree/db8072d_b5db08f_79335166/lib/python3.9/site-packages/mouseinfo/init.py”, line 223, in
[2022-12-29T20:43:20.226]: _display = Display(os.environ[‘DISPLAY’])
[2022-12-29T20:43:20.226]: File “/home/worker/.robocorp/holotree/db8072d_b5db08f_79335166/lib/python3.9/os.py”, line 679, in getitem
[2022-12-29T20:43:20.226]: raise KeyError(key) from None
[2022-12-29T20:43:20.226]: KeyError: ‘DISPLAY’

This is main problem. You cannot use “pyautogui” library, because robot is running inside container, which does not have desktop, mouse or display. And here that “DISPLAY” access breaks your robot run. And that task then failed on error.

If you want to use Desktops, you should do one of self hosted versions. See this documentation: Find the correct setup for you | Robocorp documentation

2 Likes

Very thank you, but this part of the bot, i run in my machine, I run one step in RDP mode and the another part in container.
The pyautogui is used to take a print screen, and the first step did.

To my understanding, that “import pyautogui” problem happens inside Robocorp defined container, since “/home/worker/…” part is present. Since those containers do not have desktop, when “mouseinfo” module from “pyautogui” wants to get DISPLAY variable, it does not find it and fails there. And because it is written that way, you cannot/should not try to import pyautogui in container runs.

So here is ideas how to fix it:

  • write two separate robots, one for your own desktop (producer?), and one for container (consumer?)
  • import only those modules that can be used (and will be used) on those specific environment (desktop vs. container)
  • on container runs, do not use any desktop libraries, because there is no desktop (or windows or displays)
  • and on runs that do not have desktop/display, do not try to take screenshots, because there is nothing visible there (only processes running headless)
  • on containers, if you are using headless browsers, then use those libraries to take “web browsers screenshots” (that is separate functionality)

But my bots are separated in this way.
One is a producer tha runs in my desktop, and the consumer runs in a cloud.
The consumer just send a email

The producer creates the work item

And in the CR I’m using this way


the first step is the producer and the second whe consumer

Did you remember to update your robot in cloud? It looks it has different code what you are showing here. Traceback says that on line 5 on consumo_work_item_teste.py there is “import pyautogui” and that does not work in cloud containers.

2 Likes