posit-dev / positron

Positron, a next-generation data science IDE
Other
2.56k stars 80 forks source link

R encounters a crash when the help function is invoked on the remote machine. #4885

Open GladioFeng opened 2 weeks ago

GladioFeng commented 2 weeks ago

System details:

My local client operates on macOS 14, and I am employing a remote SSH connection to Ubuntu 22.04.

Positron and OS details:

Positron Version: 2024.09.0 (Universal) build 103

Interpreter details:

R 4.3.3

Describe the issue:

R encounters a crash when the help function is invoked on the remote machine.

Steps to reproduce the issue:

  1. open console
  2. type ?library

Expected or desired behavior:

Were there any error messages in the UI, Output panel, or Developer Tools console?

Image

timtmok commented 2 weeks ago

Thanks for flagging this! We appreciate your help improving Positron and we’ll address it when we’re working on the next release; keep an eye on this issue for updates 🚀.

If the Open Logs action has any logs, please attach them as they may help fix the issue.

GladioFeng commented 2 weeks ago

There are my Positron R Extension log output:

2024-10-05 18:27:04.754 [info] Log level: Debug
2024-10-05 18:27:06.068 [info] Refreshing testthat status
2024-10-05 18:27:08.315 [info] Not working in an R package
2024-10-05 18:27:08.315 [info] Context key 'testthatIsConfigured' is 'false'
2024-10-05 18:27:08.315 [info] Context key 'testthatHasTests' is 'false'
2024-10-05 18:27:09.016 [info] Possibly found R on PATH: /usr/bin/R.
2024-10-05 18:27:09.017 [info] Resolved R binary at /home/user/micromamba/envs/R/bin/R
2024-10-05 18:27:09.018 [info] Possibly found R on PATH: /usr/bin/R.
2024-10-05 18:27:09.018 [info] Resolved R binary at /home/user/micromamba/envs/R/bin/R
2024-10-05 18:27:09.020 [info] Candidate R binary at /home/user/micromamba/envs/R/bin/R
2024-10-05 18:27:09.020 [info] R installation discovered: {
  "valid": true,
  "supported": true,
  "binpath": "/home/user/micromamba/envs/R/bin/R",
  "homepath": "/home/user/micromamba/envs/R/lib/R",
  "semVersion": {
    "options": {},
    "loose": false,
    "includePrerelease": false,
    "raw": "4.3.3",
    "major": 4,
    "minor": 3,
    "patch": 3,
    "prerelease": [],
    "build": [],
    "version": "4.3.3"
  },
  "version": "4.3.3",
  "arch": "x86_64",
  "current": true,
  "orthogonal": true
}
2024-10-05 18:27:09.020 [info] Candidate R binary at /opt/R/4.3.3/bin/R
2024-10-05 18:27:09.020 [info] R installation discovered: {
  "valid": true,
  "supported": true,
  "binpath": "/opt/R/4.3.3/bin/R",
  "homepath": "/opt/R/4.3.3/lib/R",
  "semVersion": {
    "options": {},
    "loose": false,
    "includePrerelease": false,
    "raw": "4.3.3",
    "major": 4,
    "minor": 3,
    "patch": 3,
    "prerelease": [],
    "build": [],
    "version": "4.3.3"
  },
  "version": "4.3.3",
  "arch": "x86_64",
  "current": false,
  "orthogonal": true
}
2024-10-05 18:27:09.529 [info] Creating Positron R 4.3.3 language client (port 54965)
2024-10-05 18:27:09.529 [info] ARK (R 4.3.3) language client state changed uninitialized => starting
2024-10-05 18:27:09.547 [info] ARK (R 4.3.3) language client init successful
2024-10-05 18:27:09.547 [info] ARK (R 4.3.3) language client state changed starting => running
2024-10-05 18:28:31.771 [info] ARK (R 4.3.3) language client state changed running => stopped
2024-10-05 18:28:31.771 [warning] ARK (R 4.3.3) language client error occurred (port 54965). 'Error' with message: This socket has been ended by the other party. This is error number 1.
2024-10-05 18:28:32.642 [info] Creating Positron R 4.3.3 language client (port 51234)
2024-10-05 18:28:32.642 [info] ARK (R 4.3.3) language client state changed uninitialized => starting
2024-10-05 18:28:32.665 [info] ARK (R 4.3.3) language client init successful
2024-10-05 18:28:32.665 [info] ARK (R 4.3.3) language client state changed starting => running
2024-10-05 18:29:04.116 [info] ARK (R 4.3.3) language client state changed running => stopped
2024-10-05 18:29:04.117 [warning] ARK (R 4.3.3) language client error occurred (port 51234). 'Error' with message: This socket has been ended by the other party. This is error number 1.
2024-10-05 18:29:04.901 [info] Creating Positron R 4.3.3 language client (port 57720)
2024-10-05 18:29:04.901 [info] ARK (R 4.3.3) language client state changed uninitialized => starting
2024-10-05 18:29:04.912 [info] ARK (R 4.3.3) language client init successful
2024-10-05 18:29:04.912 [info] ARK (R 4.3.3) language client state changed starting => running
2024-10-05 18:29:23.343 [info] Log level: Trace
2024-10-05 18:29:31.801 [info] ARK (R 4.3.3) language client state changed running => stopped
2024-10-05 18:29:31.801 [warning] ARK (R 4.3.3) language client error occurred (port 57720). 'Error' with message: This socket has been ended by the other party. This is error number 1.
2024-10-05 18:29:32.598 [info] Creating Positron R 4.3.3 language client (port 59922)
2024-10-05 18:29:32.598 [info] ARK (R 4.3.3) language client state changed uninitialized => starting
2024-10-05 18:29:32.608 [info] ARK (R 4.3.3) language client init successful
2024-10-05 18:29:32.608 [info] ARK (R 4.3.3) language client state changed starting => running
2024-10-05 18:29:42.176 [info] ARK (R 4.3.3) language client state changed running => stopped
2024-10-05 18:29:42.176 [warning] ARK (R 4.3.3) language client error occurred (port 59922). 'Error' with message: This socket has been ended by the other party. This is error number 1.
2024-10-05 18:29:42.945 [info] Creating Positron R 4.3.3 language client (port 43988)
2024-10-05 18:29:42.945 [info] ARK (R 4.3.3) language client state changed uninitialized => starting
2024-10-05 18:29:42.956 [info] ARK (R 4.3.3) language client init successful
2024-10-05 18:29:42.956 [info] ARK (R 4.3.3) language client state changed starting => running

Thanks for your help.

juliasilge commented 1 week ago

Thanks for sharing those logs! It looks like it may be using the R installed via micromamba rather than the one installed at /opt/R/4.3.3/bin/R, which may be a problem.

Can you try running help directly on the remote machine?

Do you observe any crashes?

GladioFeng commented 1 week ago

It works on remote machine. Image Image

jennybc commented 1 week ago

It catches my eye that both versions of R are 4.3.3. Somehow it feels more likely to get unintentional crosstalk between two installations that are the exact same version. But this could be a complete red herring (though still important to think about in general).

juliasilge commented 1 week ago

I'm going to move both of our issues on problems with REH/SSH + R Help to triage, although I note we are not able to reproduce either.

juliasilge commented 1 week ago

Thanks for confirming that help works on the remote machine @GladioFeng. If you are able, can you share some more logs?

Image

Image

INFO PositronHelpService language runtime server sent show help event for: http://127.0.0.1:60873/library/stats/html/lm.html

Unfortunately these logs and output channels are quite busy but more info would be helpful, as we cannot reproduce your problem currently.

GladioFeng commented 4 days ago

There are infor output when crash: kernel_output.txt console_output.txt Image