Rcc.exe runnng >900x when using VS Code

I’m using VS Code with the robocorp extension to develop my robots.
When I press the play icon on the left of my tasks my CPU spikes to 100%
In task manager I see more than 900 instances of rcc.exe

The robot is only opening a selenium browser, loading 1 page, and scraping a table.
then it uses 3 python functions to concatenate some strings.
(and the robot finishes processing successfully )

Maybe this is useful:

I also have RCC in my own PATH variable, that is rcc v11.9.10

Command in vs code after pressing ‘play’:
d:; cd ‘d:\4. Projects\robotic.li\framework-robot’; & ‘C:\Users\brian\AppData\Local\robocorp\temp\4d65822107fda546\rf-ls-run\run_env_00_98j83q_m.bat’ ‘-u’ ‘c:\Users\brian.vscode\extensions\robocorp.robotframework-lsp-0.47.2\src\robotframework_debug_adapter\run_robot__main__.py’ ‘–port’ ‘57792’ ‘–no-debug’ ‘–listener=robotframework_debug_adapter.events_listener.EventsListenerV2’ ‘–listener=robotframework_debug_adapter.events_listener.EventsListenerV3’ ‘–pythonpath’ ‘d:\4. Projects\robotic.li\framework-robot.’ ‘–prerunmodifier=robotframework_debug_adapter.prerun_modifiers.FilteringTestsSuiteVisitor’ ‘d:\4. Projects\robotic.li\framework-robot\tasks.robot’

Contents of run_env_00_98j83q_m.bat
@echo off

SET “RFLS_PRERUN_FILTER_TESTS={“include”:[[“d:\4. Projects\robotic.li\framework-robot\tasks.robot”,“Default Tasks”]],“exclude”:[]}”
SET “PYTHON_EXE=C:\Users\brian\AppData\Local\robocorp\holotree\b1f3c244e_1c0bc041\python.exe”
SET “CONDA_DEFAULT_ENV=rcc”
SET “CONDA_PREFIX=C:\Users\brian\AppData\Local\robocorp\holotree\b1f3c244e_1c0bc041”
SET “CONDA_PROMPT_MODIFIER=(rcc)”
SET “CONDA_SHLVL=1”
SET “PYTHONHOME=”
SET “PYTHONSTARTUP=”
SET “PYTHONEXECUTABLE=”
SET “PYTHONNOUSERSITE=1”
SET “PYTHONDONTWRITEBYTECODE=x”
SET “PYTHONPYCACHEPREFIX=C:\Users\brian\AppData\Local\robocorp\temp\4d65822107fda546”
SET “ROBOCORP_HOME=C:\Users\brian\AppData\Local\robocorp”
SET “RCC_ENVIRONMENT_HASH=46bdf15bc8739ed1”
SET “RCC_INSTALLATION_ID=50a36c50-9c77-afe1-7b6c-e23db91babb1”
SET “RCC_TRACKING_ALLOWED=false”
SET “RCC_VERSION=v11.9.16”
SET “TEMP=C:\Users\brian\AppData\Local\robocorp\temp\4d65822107fda546”
SET “TMP=C:\Users\brian\AppData\Local\robocorp\temp\4d65822107fda546”
SET “PATH=d:\4. Projects\robotic.li\framework-robot;C:\Users\brian\AppData\Local\robocorp\holotree\b1f3c244e_1c0bc041;C:\Users\brian\AppData\Local\robocorp\holotree\b1f3c244e_1c0bc041\Library\mingw-w64\bin;C:\Users\brian\AppData\Local\robocorp\holotree\b1f3c244e_1c0bc041\Library\usr\bin;C:\Users\brian\AppData\Local\robocorp\holotree\b1f3c244e_1c0bc041\Library\bin;C:\Users\brian\AppData\Local\robocorp\holotree\b1f3c244e_1c0bc041\Scripts;C:\Users\brian\AppData\Local\robocorp\holotree\b1f3c244e_1c0bc041\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\libnvvp;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\ProgramData\ComposerSetup\bin;C:\Program Files\nodejs;C:\Program Files\CMake\bin;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\NVIDIA Corporation\Nsight Compute 2022.1.1;C:\Program Files\Git\cmd;C:\Program Files\MySQL\MySQL Shell 8.0\bin;C:\Users\brian\AppData\Local\Microsoft\WindowsApps;C:\Users\brian\AppData\Local\Programs\Microsoft VS Code\bin;D:\tools;D:\tools\php;C:\Users\brian\AppData\Roaming\Composer\vendor\bin;C:\Users\brian\AppData\Roaming\npm;C:\Program Files\nodejs;C:\Program Files\NVIDIA Corporation\CUDNN\v 8.4;d:\4. Projects\robotic.li\framework-robot”
SET “MAMBA_ROOT_PREFIX=C:\Users\brian\AppData\Local\robocorp”
SET “MAMBA_SSL_VERIFY=false”
SET “PYTHONPATH=d:\4. Projects\robotic.li\framework-robot;c:\Users\brian.vscode\extensions\robocorp.robotframework-lsp-0.47.2\src;c:\Users\brian.vscode\extensions\robocorp.robotframework-lsp-0.47.2\src\robotframework_ls\vendored”
SET “ROBOT_ROOT=d:\4. Projects\robotic.li\framework-robot”
SET “ROBOT_ARTIFACTS=d:\4. Projects\robotic.li\framework-robot\output”
SET “RPA_OUTPUT_WORKITEM_PATH=d:\4. Projects\robotic.li\framework-robot\devdata\work-items-out\run-1\work-items.json”
SET “RPA_WORKITEMS_ADAPTER=RPA.Robocorp.WorkItems.FileAdapter”
C:\Users\brian\AppData\Local\robocorp\holotree\b1f3c244e_1c0bc041\python.exe %*

I also tried pre-release version v0.32.1

Having all those RCC instances alive seems really odd (it’s probably some process leak which shouldn’t happen).

Can you provide the command lines that they’re actually running so that it may be possible to diagnose what’s causing the leak?

For that you can run the command:

wmic process get commandline > processes.txt

and then attach the processes.txt file here.

p.s.: please take a look at processes.txt and remove any info that you think is sensitive prior to sharing.

The line in processes.txt that is repetative is:
c:\Users\brian\.vscode\extensions\robocorp.robocorp-code-0.32.0\bin\rcc.exe feedback metric -t vscode -n vscode.lsp.error -v HANDLE_DEBUG_SESSION_EVENT

That’s interesting, thanks.

That process should definitely not hang at that point… this is also an indication that something isn’t working when doing a launch/debug session.

Do you have any error in OUTPUT > Robot Framework or OUTPUT > Robocorp Code?

robot framework:

Error handling debug session event

    e.replace is not a function

    TypeError: e.replace is not a function

        at String.replaceAll (c:\Users\brian\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:144649)

        at handleLogMessage (c:\Users\brian\.vscode\extensions\robocorp.robotframework-lsp-0.47.2\vscode-client\out\testview.js:411:38)

        at c:\Users\brian\.vscode\extensions\robocorp.robotframework-lsp-0.47.2\vscode-client\out\testview.js:368:29

        at m.invoke (c:\Users\brian\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:58:145)

        at E.deliver (c:\Users\brian\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:58:2265)

        at v.fire (c:\Users\brian\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:58:1843)

        at E.$acceptDebugSessionCustomEvent (c:\Users\brian\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:90:16736)

        at runMicrotasks (<anonymous>)

        at processTicksAndRejections (node:internal/process/task_queues:96:5)

and in robocorp code:

Error executing: c:\Users\brian\.vscode\extensions\robocorp.robocorp-code-0.32.0\bin\rcc.exe feedback metric -t vscode -n vscode.lsp.error -v HANDLE_DEBUG_SESSION_EVENT

Error code: undefined

Error: error

Stderr: Tracking is disabled. Quitting.

Error executing: c:\Users\brian\.vscode\extensions\robocorp.robocorp-code-0.32.0\bin\rcc.exe feedback metric -t vscode -n vscode.lsp.error -v HANDLE_DEBUG_SESSION_EVENT

Error code: undefined

Error: error

Stderr: FATAL: could not lock C:\Users\brian\AppData\Local\robocorp\rcc.yaml.lck, reason The process cannot access the file because another process has locked a portion of the file.; ignored.

Tracking is disabled. Quitting.

Hi, @brian
Can you Submit an Issue from VS Code extension?

This way, we could get all the logs at the same time and see a bit better what is happening.
You may have now diagnostics disabled and you may have for example multiple LSP extensions installed that are colliding and causing all the error reports that are clogging up the system.

BR, Kari

@brian, I’ve published new version of pre-releases for Robocorp Code (0.32.3) and Robot Framework Language Server (0.47.8) which should’ve fixed the case for the multiple processes, but I still haven’t fixed the root cause, so, I’ve added more logging so that the root cause shows in OUTPUT > Robot Framework Language Server / OUTPUT > Robocorp Code.

I know it happens when dealing with log messages obtained from a launch when using the VSCode test view, so, I’d appreciate if you can upgrade to those pre-releases/work a bit/do some launches and provide any new output you have which is related there.