robocorp / robotframework-lsp

Robocorp extensions for VS Code: Robocorp Code and RFW LSP
https://robocorp.com/docs/developer-tools/visual-studio-code
Apache License 2.0
206 stars 93 forks source link

Robocorp activation is running for ever #732

Closed itexpertshire closed 2 years ago

itexpertshire commented 2 years ago

Describe the bug Robocorp activation step is not completing and running post install scripts phase forever.

To Reproduce Steps to reproduce the behavior:

  1. Install Robocorp Code and Robot Framework extension
  2. Open sample tasks.robot file
  3. activation automatically started. However, it doesn't complete.

Expected behavior It should complete and allow me to run sample tasks.robot file

Screenshots image

Versions:

Logs Add the logs obtained when reproducing the issue. Output> Robocorp Code

Activating Robocorp Code extension.
Waiting for Robocorp Code (python) language server to finish activating...
Executing: c:\Users\akm\.vscode\extensions\robocorp.robocorp-code-0.36.0\bin\rcc.exe configure longpaths
Windows long paths support enabled
ROBOCORP_HOME: C:\Robocorp
Executing: c:\Users\akm\.vscode\extensions\robocorp.robocorp-code-0.36.0\bin\rcc.exe configure diagnostics -j --controller RobocorpCode
RCC Diagnostics:
Stdout:
{
  "details": {
    "RCC_VERBOSE_ENVIRONMENT_BUILDING": "false",
    "ROBOCORP_HOME": "C:\\Robocorp",
    "ROBOCORP_OVERRIDE_SYSTEM_REQUIREMENTS": "false",
    "config-active-profile": "default",
    "config-http-proxy": "",
    "config-https-proxy": "",
    "config-micromambarc-used": "false",
    "config-piprc-used": "false",
    "config-settings-yaml-used": "false",
    "config-ssl-no-revoke": "false",
    "config-ssl-verify": "true",
    "controller": "rcc.robocorpcode",
    "cpus": "8",
    "executable": "c:\\Users\\akm\\.vscode\\extensions\\robocorp.robocorp-code-0.36.0\\bin\\rcc.exe",
    "hololib-catalog-location": "c:\\ProgramData\\robocorp\\ht\\lib\\catalog",
    "hololib-library-location": "c:\\ProgramData\\robocorp\\ht\\lib\\library",
    "hololib-location": "c:\\ProgramData\\robocorp\\ht\\lib",
    "holotree-location": "c:\\ProgramData\\robocorp\\ht",
    "holotree-shared": "true",
    "holotree-user-id": "5fdbf96",
    "installationId": "ad5fca8d-eb3d-6fea-698c-441af26b0e7e",
    "micromamba": "0.23.2",
    "os": "windows_amd64",
    "os-holo-location": "c:\\ProgramData\\robocorp\\ht",
    "rcc": "v11.14.5",
    "stats": "2 requests, 0 merges, 0 hits, 0 dirty, 0 misses, 0 failures | ad5fca8d-eb3d-6fea-698c-441af26b0e7e",
    "telemetry-enabled": "true",
    "tempdir": "C:\\Users\\akm\\AppData\\Local\\Temp",
    "uid:gid": "S-1-5-21-3788725585-1706046440-3561743272-124748:S-1-5-21-3788725585-1706046440-3561743272-513",
    "user-agent": "rcc/v11.14.5 (windows amd64) rcc.robocorpcode",
    "user-cache-dir": "C:\\Users\\akm\\AppData\\Local",
    "user-config-dir": "C:\\Users\\akm\\AppData\\Roaming",
    "user-home-dir": "C:\\Users\\akm",
    "when": "2022-08-18T08:37:08-07:00 (PDT)",
    "working-dir": "c:\\Users\\akm\\.vscode\\extensions\\robocorp.robocorp-code-0.36.0\\bin"
  },
  "checks": [
    {
      "type": "OS",
      "status": "ok",
      "message": "\"c:\\\\ProgramData\\\\robocorp\\\\ht\" is shared, which is ok.",
      "url": "https://robocorp.com/docs/troubleshooting"
    },
    {
      "type": "OS",
      "status": "ok",
      "message": "\"c:\\\\ProgramData\\\\robocorp\\\\ht\\\\lib\" is shared, which is ok.",
      "url": "https://robocorp.com/docs/troubleshooting"
    },
    {
      "type": "OS",
      "status": "ok",
      "message": "\"c:\\\\ProgramData\\\\robocorp\\\\ht\\\\lib\\\\catalog\" is shared, which is ok.",
      "url": "https://robocorp.com/docs/troubleshooting"
    },
    {
      "type": "OS",
      "status": "ok",
      "message": "\"c:\\\\ProgramData\\\\robocorp\\\\ht\\\\lib\\\\library\" is shared, which is ok.",
      "url": "https://robocorp.com/docs/troubleshooting"
    },
    {
      "type": "RPA",
      "status": "ok",
      "message": "ROBOCORP_HOME (C:\\Robocorp) is good enough.",
      "url": "https://robocorp.com/docs/troubleshooting"
    },
    {
      "type": "OS",
      "status": "ok",
      "message": "PYTHONPATH is not set, which is good.",
      "url": "https://robocorp.com/docs/troubleshooting"
    },
    {
      "type": "OS",
      "status": "ok",
      "message": "PLAYWRIGHT_BROWSERS_PATH is not set, which is good.",
      "url": "https://robocorp.com/docs/troubleshooting"
    },
    {
      "type": "OS",
      "status": "ok",
      "message": "NODE_OPTIONS is not set, which is good.",
      "url": "https://robocorp.com/docs/troubleshooting"
    },
    {
      "type": "OS",
      "status": "ok",
      "message": "NODE_PATH is not set, which is good.",
      "url": "https://robocorp.com/docs/troubleshooting"
    },
    {
      "type": "OS",
      "status": "ok",
      "message": "Supports long enough paths.",
      "url": "https://robocorp.com/docs/troubleshooting/windows-long-path"
    },
    {
      "type": "network",
      "status": "ok",
      "message": "api.eu1.robocorp.com found: [46.137.38.8 108.128.34.128 34.254.87.150]",
      "url": "https://robocorp.com/docs/troubleshooting/firewall-and-proxies"
    },
    {
      "type": "network",
      "status": "ok",
      "message": "cloud.robocorp.com found: [34.249.245.73 99.80.113.73 34.254.80.145]",
      "url": "https://robocorp.com/docs/troubleshooting/firewall-and-proxies"
    },
    {
      "type": "network",
      "status": "ok",
      "message": "conda.anaconda.org found: [104.17.93.24 104.17.92.24]",
      "url": "https://robocorp.com/docs/troubleshooting/firewall-and-proxies"
    },
    {
      "type": "network",
      "status": "ok",
      "message": "downloads.robocorp.com found: [13.225.142.109 13.225.142.128 13.225.142.104 13.225.142.43]",
      "url": "https://robocorp.com/docs/troubleshooting/firewall-and-proxies"
    },
    {
      "type": "network",
      "status": "ok",
      "message": "files.pythonhosted.org found: [199.232.93.63]",
      "url": "https://robocorp.com/docs/troubleshooting/firewall-and-proxies"
    },
    {
      "type": "network",
      "status": "ok",
      "message": "github.com found: [140.82.113.4]",
      "url": "https://robocorp.com/docs/troubleshooting/firewall-and-proxies"
    },
    {
      "type": "network",
      "status": "ok",
      "message": "id.robocorp.com found: [99.84.192.19 99.84.192.2 99.84.192.104 99.84.192.86]",
      "url": "https://robocorp.com/docs/troubleshooting/firewall-and-proxies"
    },
    {
      "type": "network",
      "status": "ok",
      "message": "pypi.org found: [151.101.192.223 151.101.0.223 151.101.128.223 151.101.64.223]",
      "url": "https://robocorp.com/docs/troubleshooting/firewall-and-proxies"
    },
    {
      "type": "network",
      "status": "ok",
      "message": "robocorp.com found: [104.22.41.65 104.22.40.65 172.67.7.153]",
      "url": "https://robocorp.com/docs/troubleshooting/firewall-and-proxies"
    },
    {
      "type": "network",
      "status": "ok",
      "message": "telemetry.robocorp.com found: [52.48.131.148 54.194.99.96]",
      "url": "https://robocorp.com/docs/troubleshooting/firewall-and-proxies"
    },
    {
      "type": "network",
      "status": "ok",
      "message": "Canary download successful: https://downloads.robocorp.com/canary.txt",
      "url": "https://robocorp.com/docs/troubleshooting/firewall-and-proxies"
    },
    {
      "type": "network",
      "status": "ok",
      "message": "PyPI canary download successful: https://pypi.org/jupyterlab-pygments/",
      "url": "https://robocorp.com/docs/troubleshooting/firewall-and-proxies"
    },
    {
      "type": "network",
      "status": "ok",
      "message": "Conda canary download successful: https://conda.anaconda.org/conda-forge/linux-64/repodata.json",
      "url": "https://robocorp.com/docs/troubleshooting/firewall-and-proxies"
    },
    {
      "type": "Settings",
      "status": "ok",
      "message": "Toplevel settings are ok.",
      "url": ""
    }
  ]
}

Stderr:
OK.

Took 2.1s to obtain diagnostics.
Executing: c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852\python.exe -c import threading;print("OK")
Loading base environment from: C:\Robocorp\.robocorp_code\vscode-base-v01-e6a801\rcc_env_info.json
Took: 0.4s to update conda env.
Executing: c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852\python.exe c:\Users\akm\.vscode\extensions\robocorp.robocorp-code-0.36.0\bin\create_env\get_env_info.py
Took: 1.0s to collect python info.
Python executable: c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852\python.exe
Python version: 3,8,10,final,0
Robot Version: 4.1
Environment:
    PYTHONPATH: undefined
    APPDATA: C:\Users\akm\AppData\Roaming
    HOMEDRIVE: C:
    HOMEPATH: \Users\akm
    HOME: undefined
    ROBOT_ROOT: undefined
    ROBOT_ARTIFACTS: undefined
    RCC_INSTALLATION_ID: ad5fca8d-eb3d-6fea-698c-441af26b0e7e
    ROBOCORP_HOME: C:\Robocorp
    PROCESSOR_ARCHITECTURE: AMD64
    OS: Windows_NT
    PATH: c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852;c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852\Library\mingw-w64\bin;c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852\Library\usr\bin;c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852\Library\bin;c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852\Scripts;c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852\bin;c:\Users\akm\.vscode\extensions\robocorp.robocorp-code-0.36.0\bin;c:\Oracle\OracleODP64_12c;c:\Oracle\OracleODP64_12c\bin;c:\Oracle\OracleODP32_12c;c:\Oracle\OracleODP32_12c\bin;c:\Windows\system32\Ora12c;C:\Users\akm\AppData\Local\Microsoft\WindowsApps;C:\Soft\MicrosoftVSCode\bin;C:\Soft\Git\cmd;C:\Users\akm\.dotnet\tools;C:\Soft\liquibase;c:\Users\akm\.vscode\extensions\robocorp.robocorp-code-0.36.0\bin
Using python executable: c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852\python.exe
Starting Robocorp Code with args: c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852\python.exe -u c:\Users\akm\.vscode\extensions\robocorp.robocorp-code-0.36.0\src\robocorp_code\__main__.py -v
robocorp code: 2022-08-18 08:37:12 UTC pid: 1176 - MainThread - INFO - robocorp_code.__main__
Arguments: ['-v']

robocorp code: 2022-08-18 08:37:12 UTC pid: 1176 - MainThread - INFO - robocorp_code.__main__
Python: 3.8.10 | packaged by conda-forge | (default, Sep 13 2021, 21:12:34) [MSC v.1916 64 bit (AMD64)] - lsp: 0.36.0 (<module 'robocorp_code' from 'c:\\Users\\akm\\.vscode\\extensions\\robocorp.robocorp-code-0.36.0\\src\\robocorp_code\\__init__.py'>) - platform: win32 - sys.prefix: c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852 - sys.executable: c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852\python.exe

robocorp code: 2022-08-18 08:37:12 UTC pid: 1176 - MainThread - INFO - robocorp_ls_core.python_ls
Starting RobocorpLanguageServer IO language server. pid: 1176

robocorp code: 2022-08-18 08:37:12 UTC pid: 1176 - MainThread - INFO - robocorp_code.robocorp_language_server
Cache dir: C:\Users\akm\.robocorp-code\.cache

Took: 5.2s to initialize Robocorp Code Language Server.
Robocorp Code initialization finished. Took: 5.2s

Output>Robot Framework

Plugins dir: c:\Users\akm\.vscode\extensions\robocorp.robocorp-code-0.36.0\src\robocorp_code\plugins.
Getting language server Python executable.
Waiting for RobotFramework (python) Language Server to finish activating...
Language server Python executable gotten from robocorp.getLanguageServerPython.
Starting RobotFramework Language Server with args: c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852\python.exe,-u,c:\Users\akm\.vscode\extensions\robocorp.robotframework-lsp-1.0.6\src\robotframework_ls\__main__.py,-v
lsp: 2022-08-18 08:37:12 UTC pid: 15348 - MainThread - INFO - robotframework_ls.__main__
Arguments: ['-v']

lsp: 2022-08-18 08:37:12 UTC pid: 15348 - MainThread - INFO - robotframework_ls.__main__
Python: 3.8.10 | packaged by conda-forge | (default, Sep 13 2021, 21:12:34) [MSC v.1916 64 bit (AMD64)] - lsp: 1.0.6 (<module 'robotframework_ls' from 'c:\\Users\\akm\\.vscode\\extensions\\robocorp.robotframework-lsp-1.0.6\\src\\robotframework_ls\\__init__.py'>) - platform: win32 - sys.prefix: c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852 - sys.executable: c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852\python.exe

lsp: 2022-08-18 08:37:12 UTC pid: 15348 - MainThread - INFO - robocorp_ls_core.python_ls
Starting RobotFrameworkLanguageServer IO language server. pid: 15348

lsp: 2022-08-18 08:37:13 UTC pid: 15348 - MainThread - INFO - robotframework_ls.robotframework_ls_impl
Using watch implementation: watchdog (customize with ROBOTFRAMEWORK_LS_WATCH_IMPL environment variable)

lsp: 2022-08-18 08:37:13 UTC pid: 15348 - MainThread - INFO - robocorp_ls_core.remote_fs_observer_impl
Initializing Remote FS Observer with the following args: ['c:\\ProgramData\\robocorp\\ht\\5fdbf96_b1f3c24_da28c852\\python.exe', '-u', 'c:\\Users\\akm\\.vscode\\extensions\\robocorp.robotframework-lsp-1.0.6\\src\\robotframework_ls\\vendored\\robocorp_ls_core\\remote_fs_observer__main__.py', '-v']

remote_fs_observer: 2022-08-18 08:37:13 UTC pid: 11432 - MainThread - INFO - robocorp_ls_core.remote_fs_observer__main__

Arguments: ['-v']

remote_fs_observer: 2022-08-18 08:37:13 UTC pid: 11432 - MainThread - INFO - robocorp_ls_core.remote_fs_observer__main__

Python: 3.8.10 | packaged by conda-forge | (default, Sep 13 2021, 21:12:34) [MSC v.1916 64 bit (AMD64)] - lsp: <unable to get __version__> (<module 'robocorp_ls_core' from 'c:\\Users\\akm\\.vscode\\extensions\\robocorp.robotframework-lsp-1.0.6\\src\\robotframework_ls\\vendored\\robocorp_ls_core\\__init__.py'>) - platform: win32 - sys.prefix: c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852 - sys.executable: c:\ProgramData\robocorp\ht\5fdbf96_b1f3c24_da28c852\python.exe

Collecting environment info for c:\Users\akm\Codes\test-automation\example-1\conda.yaml in space: vscode-02
####  Progress: 01/13  v11.14.5     0.018s  Fresh [shared mode] holotree environment 538ee609-06b8-61de-264e-664ceceaeff5.
####  Progress: 02/13  v11.14.5     0.002s  Holotree blueprint is "342af3b0e695bff9" [windows_amd64].
####  Progress: 03/13  v11.14.5     0.000s  Cleanup holotree stage for fresh install.
####  Progress: 04/13  v11.14.5     6.682s  Build environment into holotree stage.
FINAL union conda environment descriptor:
---
channels:
- conda-forge
dependencies:
- python=3.8.10
- pip=20.1
- nodejs=16.14.2
- pip:
  - robotframework-browser==12.3.0
  - rpaframework==14.0.0
rccPostInstall:
- rfbrowser init
---
####  Progress: 05/13  v11.14.5     0.278s  Running micromamba phase.
####  Progress: 06/13  v11.14.5    59.569s  Running pip install phase.
####  Progress: 07/13  v11.14.5   248.647s  Post install scripts phase started.
fabioz commented 2 years ago

Humm, I think that the post install script would be: rfbrowser init

If you remove that line (actually the whole rccPostInstall: block) from the conda.yaml and restart VSCode, does it work?

itexpertshire commented 2 years ago

It failed with below error message after long time.

Command ["rfbrowser" "init"] at "c:\\ProgramData\\robocorp\\ht\\h5fdbf96_44412bd2016a11t":
Installing node dependencies...
Installing rfbrowser node dependencies at c:\programdata\robocorp\ht\h5fdbf96_44412bd2016a11t\lib\site-packages\Browser\wrapper
npm WARN old lockfile 

npm WARN old lockfile The package-lock.json file was created with an old version of npm,

npm WARN old lockfile so supplemental metadata must be fetched from the registry.

npm WARN old lockfile 

npm WARN old lockfile This is a one-time fix-up, please be patient...

npm WARN old lockfile 

npm WARN old lockfile FetchError: request to https://registry.npmjs.org/@babel%2fhighlight failed, reason: self signed certificate in certificate chain

npm WARN old lockfile     at ClientRequest.<anonymous> (c:\ProgramData\robocorp\ht\h5fdbf96_44412bd2016a11t\node_modules\npm\node_modules\minipass-fetch\lib\index.js:110:14)

npm WARN old lockfile     at ClientRequest.emit (node:events:526:28)

npm WARN old lockfile     at TLSSocket.socketErrorListener (node:_http_client:442:9)

npm WARN old lockfile     at TLSSocket.emit (node:events:538:35)

npm WARN old lockfile     at emitErrorNT (node:internal/streams/destroy:157:8)

npm WARN old lockfile     at emitErrorCloseNT (node:internal/streams/destroy:122:3)

npm WARN old lockfile     at processTicksAndRejections (node:internal/process/task_queues:83:21)

npm WARN old lockfile  Could not fetch metadata for @babel/highlight@7.13.8 FetchError: request to https://registry.npmjs.org/@babel%2fhighlight failed, reason: self signed certificate in certificate chain

npm WARN old lockfile     at ClientRequest.<anonymous> (c:\ProgramData\robocorp\ht\h5fdbf96_44412bd2016a11t\node_modules\npm\node_modules\minipass-fetch\lib\index.js:110:14)

npm WARN old lockfile     at ClientRequest.emit (node:events:526:28)

npm WARN old lockfile     at TLSSocket.socketErrorListener (node:_http_client:442:9)

npm WARN old lockfile     at TLSSocket.emit (node:events:538:35)

npm WARN old lockfile     at emitErrorNT (node:internal/streams/destroy:157:8)

npm WARN old lockfile     at emitErrorCloseNT (node:internal/streams/destroy:122:3)

npm WARN old lockfile     at processTicksAndRejections (node:internal/process/task_queues:83:21) {

npm WARN old lockfile   code: 'SELF_SIGNED_CERT_IN_CHAIN',

npm WARN old lockfile   errno: 'SELF_SIGNED_CERT_IN_CHAIN',

npm WARN old lockfile   type: 'system'

npm WARN old lockfile }
itexpertshire commented 2 years ago

Humm, I think that the post install script would be: rfbrowser init

If you remove that line (actually the whole rccPostInstall: block) from the conda.yaml and restart VSCode, does it work?

Yes, it's the issue with rfbrowser library. After removing this, it worked fine.

kariharju commented 2 years ago

Hi @itexpertshire, This error is not coming from the extension, but the NodeJS steps that are required by the Playwright setup. The error looks like you are behind a network proxy that breaks the HTTPS certificate chain, so your HTTPS_PROXY setting is probably pointing to a URL that starts with http://...

NodeJS has a way to ignore the certificate checking by setting an environment variable: NODE_TLS_REJECT_UNAUTHORIZED = 0 ..which should help your case.