Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot find R with the latest version (2024.08.0-5) in windows (x64) #4280

Closed
ShiweiLin1991 opened this issue Aug 8, 2024 · 22 comments
Closed
Assignees
Labels
bug Something isn't working lang: r os-windows Windows issue regression

Comments

@ShiweiLin1991
Copy link

System details:

Positron and OS details:

Interpreter details:

Describe the issue:

Steps to reproduce the issue:

Expected or desired behavior:

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

@jennybc
Copy link
Member

jennybc commented Aug 8, 2024

Can you show us the content of the "Positron R Extension" output channel? That should be logging the effort to discover your R installations.

@ShiweiLin1991
Copy link
Author

sorry, i don't know how to find "Positron R Extension", I am just learn to use R. But, such a bug were not appeared untial the release of the version of 2024.08.0-5

@jennybc
Copy link
Member

jennybc commented Aug 8, 2024

This part of the wiki explains how to access logs:

https://github.com/posit-dev/positron/wiki/Troubleshooting#python-and-r-logs

@blechturm
Copy link

@jennybc

I have the same Issue, Positron does not find the R intepreter on both of my work Windows machines. I'll try it at home later where I have admin-rights. I installed the latest User-installation

Quick Feedback to the Wiki article you've posted: coming from R-Studio it is not clear what you mean with

"Run the Output: Show Output Channels command to show a list of output channels. You can then select one to view its output by name, like "Positron R Extension"."

Where exactly should I run this command? I do not have any console yet that could interpret the command and the Terminal pane does not evaluate the command.

@blechturm
Copy link

blechturm commented Aug 8, 2024

@jennybc found out how to do it. For the other R-Studio users: the command you need is CTRL + SHIFT + P then the so-called "command palette" shows up where you can enter the command "Show Output Channels"

This is the output of the Positron R Extension:

2024-08-08 11:48:57.943 [info] Log level: Debug
2024-08-08 11:48:57.943 [info] Refreshing testthat status
2024-08-08 11:48:57.943 [info] Not working in an R package
2024-08-08 11:48:57.943 [info] Context key 'testthatIsConfigured' is 'false'
2024-08-08 11:48:57.943 [info] Context key 'testthatHasTests' is 'false'
2024-08-08 11:49:19.107 [info] Log level: Debug
2024-08-08 11:49:19.107 [info] Refreshing testthat status
2024-08-08 11:49:19.167 [info] Not working in an R package
2024-08-08 11:49:19.167 [info] Context key 'testthatIsConfigured' is 'false'
2024-08-08 11:49:19.167 [info] Context key 'testthatHasTests' is 'false'`

As you can see in the Screenshot below Positron does not find my R-Installation

image

But R-Studio finds R version 4.3.2

image

Let me know if you need any other outputs or infos about my machine.

@jennybc
Copy link
Member

jennybc commented Aug 8, 2024

@blechturm or @ShiweiLin1991 Would you be willing to roll back to a previous version of Positron and post the comparable "good log" for comparison, i.e. where the R installation is discovered?

I have been working in the R discovery area, so my hypothesis is that your R installations were previously being discovered ?through registry keys? and now that is not happening. I'm still not sure why (certainly not the intent), but it's a guess. I also can't reproduce this in either of my Windows VMs, so it's some difference in our setups. I notice that for @blechturm the location of the R installation suggests that you don't have admin privileges.

@jennybc jennybc self-assigned this Aug 8, 2024
@jmcphers jmcphers added the info needed Waiting on information label Aug 8, 2024
@jennybc
Copy link
Member

jennybc commented Aug 9, 2024

People can probably get unstuck by putting the parent folder of your desired R binary on the PATH. However I do hope to get more information from the folks on this thread, because it's clear there's been some sort of recent regression and we should be discovering an R installation. So I'd like to identify and fix that!

But here's how to put R on the PATH. Let's assume that R is installed in C:\notADefaultFolder\R-4.2.3 (substitute whatever is true on your system). The entry we want to add to PATH is C:\notADefaultFolder\R-4.2.3\bin\x64.

Go to About your PC > Advanced system settings (in list on the right) > Environment Variables. Add an entry to Path for the user or the system.

edit-environment-variable

@ShiweiLin1991
Copy link
Author

1723186660839(1) As a beginner, I can't understand your needs well. I provide a picture here, hoping to help improve the bug.

@ShiweiLin1991
Copy link
Author

When I start use Positron, such bug never appeared until the latest version released.

@michaelgicheru
Copy link

michaelgicheru commented Aug 9, 2024

Hello there, currently experiencing the same issue with R discovery on the latest release.

In my case, positron is able to identify the latest version of R on my system when not in a folder. This is the output from the Positron R Extension:
image

When in the context of an existing folder/directory, it is unable to identify any version of R on my system, even with an R script in the directory. Here is the output:
image

The R version is not identified:
image

To work with R, I would need to close all folders -> discover R with no folders open -> create new R project/directory

@jennybc
Copy link
Member

jennybc commented Aug 9, 2024

With Positron 2024.08.0-5, upon a relaunch, which is occurring in a previously-opened folder, I see this in the Window output channel (and all R discovery / launch happens as usual):

...
2024-08-09 08:51:34.964 [debug] [Runtime startup] Phase changed to 'starting'
2024-08-09 08:51:34.965 [debug] [Runtime startup] Activating extension vscode.positron-r for language ID r
2024-08-09 08:51:36.641 [info] [perf] Render performance baseline is 63ms
2024-08-09 08:51:38.830 [info] Language runtime 912077798d99e95f382c96e6337fbb96 (language: R name: R 4.4.1 version: 4.4.1) automatically starting. Source: Affiliated r runtime for workspace
2024-08-09 08:51:38.832 [debug] [Runtime startup] Activating extension ms-python.python for language ID python
2024-08-09 08:51:38.832 [debug] [Runtime startup] Activating extension vscode.positron-r for language ID r
...
2024-08-09 08:51:38.850 [debug] [Ext host 0] Runtime manager for 'R 4.4.1': true
...
2024-08-09 08:51:38.971 [debug] [Runtime startup] All extensions contributing language runtimes have been activated.
2024-08-09 08:51:38.971 [debug] [Runtime startup] Phase changed to 'discovering'
2024-08-09 08:51:39.127 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///d%3A/Users/jenny/AppData/Roaming/Positron/logs/20240809T085127/window1/exthost/vscode.positron-r/Positron%20R%20Extension.log
2024-08-09 08:51:39.132 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///d%3A/Users/jenny/AppData/Roaming/Positron/logs/20240809T085127/window1/exthost/ms-python.python/Python.log
2024-08-09 08:51:39.133 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///d%3A/Users/jenny/AppData/Roaming/Positron/logs/20240809T085127/window1/exthost/ms-python.python/Python%20Locator.log
2024-08-09 08:51:39.355 [debug] [Ext host 0] Runtime manager for 'R 4.4.1': true

I'm curious if those of you seeing no R launch / discovery could share what you see in this channel. Specifically do you see anything like this? This is where we quickly re-launch the version of R you were last running in this workspace:

2024-08-09 08:51:38.830 [info] Language runtime 912077798d99e95f382c96e6337fbb96 (language: R name: R 4.4.1 version: 4.4.1) automatically starting. Source: Affiliated r runtime for workspace
...
2024-08-09 08:51:38.850 [debug] [Ext host 0] Runtime manager for 'R 4.4.1': true

Also curious if you see this (although I imagine you do):

2024-08-09 08:51:38.971 [debug] [Runtime startup] Phase changed to 'discovering'

The reason that I ask is that the Positron R Extension log makes it look like we aren't even attempting discovery, which is very odd.

And, again, if anyone just needs to get unstuck, either of these should do the trick:

  1. Put R on your PATH, as described above. OR ...
  2. Use a slightly earlier release of Positron, such as 2024.07.0-125.

But I hope some of you stick with me so we can sort this out. I still can't reproduce it. Positron work and troubleshooting will be a bit slow for the next week or so, due to posit::conf.

@keitheleejr
Copy link

@jennybc Here are the logs for R Extension. My personal computer has no issues with the current release, so I'm including that log as well. I've also included the Window output you mentioned in your last comment.

2024.07.0-125 (work)

2024 07 0-125

2024.08.0-5 (work)

2024 08 0-5work

2024.08.0-5 (personal)

2024 08 0-5personal

Window Output 2024.08.0-5 (work)

window-output-1
window-output-2

@michaelgicheru
Copy link

michaelgicheru commented Aug 9, 2024

Here is the output from the window when no R is discovered:

2024-08-09 19:35:56.235 [debug] Using cached extensions scan result user vscode-userdata:/c%3A/Users/mmuiruri/.positron/extensions/extensions.json 2024-08-09 19:35:56.235 [debug] ComputeTargetPlatform: win32-x64 2024-08-09 19:35:56.251 [info] Started local extension host with pid 22280. 2024-08-09 19:35:56.514 [debug] No new project configuration found in storage 2024-08-09 19:35:56.524 [error] Extension 'ms-python.python' appears in product.json but enables LESS API proposals than the extension wants. package.json (LOSES): positronResolveSymlinks, contribEditorContentMenu, quickPickSortByLabel, testObserver, quickPickItemTooltip, terminalDataWriteEvent, terminalExecuteCommandEvent, contribIssueReporter, terminalShellIntegration product.json (WINS): contribEditorContentMenu, quickPickSortByLabel, portsAttributes, testObserver, quickPickItemTooltip, terminalDataWriteEvent, terminalExecuteCommandEvent, contribIssueReporter, terminalShellIntegration 2024-08-09 19:35:56.533 [warning] [ms-python.python]: Cannot register 'python.venvPath'. This property is already registered. 2024-08-09 19:35:56.533 [warning] [vscode.positron-r]: Cannot register 'positron.r.extraArguments'. This property is already registered. 2024-08-09 19:35:56.581 [debug] [Runtime startup] Extension ms-python.python has been registered for language runtime for language ID 'python' 2024-08-09 19:35:56.581 [debug] [Runtime startup] Extension vscode.positron-r has been registered for language runtime for language ID 'r' 2024-08-09 19:35:56.959 [debug] User data changed 2024-08-09 19:35:57.124 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T193554/window1/notebook.rendering.log 2024-08-09 19:35:57.215 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T193554/editSessions.log 2024-08-09 19:35:57.232 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T193554/window1/exthost/vscode.git/Git.log 2024-08-09 19:35:57.245 [debug] User data changed 2024-08-09 19:35:57.350 [debug] [Runtime startup] Activating extension ms-python.python for language ID python 2024-08-09 19:35:57.351 [debug] [Runtime startup] Activating extension vscode.positron-r for language ID r 2024-08-09 19:35:57.665 [error] spawn c:\Users\mmuiruri\scoop\apps\positron\2024.08.0-5\resources\app\extensions\positron-python\python-env-tools\bin\pet.exe ENOENT: Error: spawn c:\Users\mmuiruri\scoop\apps\positron\2024.08.0-5\resources\app\extensions\positron-python\python-env-tools\bin\pet.exe ENOENT at ChildProcess._handle.onexit (node:internal/child_process:286:19) at onErrorNT (node:internal/child_process:484:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) 2024-08-09 19:35:57.710 [debug] [Runtime startup] All extensions contributing language runtimes have been activated. 2024-08-09 19:35:57.711 [debug] [Runtime startup] Phase changed to 'discovering' 2024-08-09 19:35:57.718 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T193554/window1/exthost/vscode.positron-notebook-controllers/Positron%20Notebook%20Controllers.log 2024-08-09 19:35:57.718 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T193554/window1/exthost/vscode.positron-r/Positron%20R%20Extension.log 2024-08-09 19:35:57.776 [error] [Extension Host] Language runtime provider threw an error during registration: Error: not found: R 2024-08-09 19:35:57.977 [debug] User data changed 2024-08-09 19:35:58.092 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T193554/ptyhost.log 2024-08-09 19:35:59.076 [debug] User data changed 2024-08-09 19:35:59.503 [info] [perf] Render performance baseline is 29ms 2024-08-09 19:36:06.757 [debug] [Runtime startup] Phase changed to 'complete' 2024-08-09 19:36:07.057 [debug] User data changed 2024-08-09 19:36:07.189 [debug] User data changed 2024-08-09 19:36:20.360 [debug] User data changed

When R is discovered:

2024-08-09 19:38:31.807 [debug] Using cached extensions scan result user vscode-userdata:/c%3A/Users/mmuiruri/.positron/extensions/extensions.json 2024-08-09 19:38:31.808 [debug] ComputeTargetPlatform: win32-x64 2024-08-09 19:38:31.810 [info] Started local extension host with pid 2752. 2024-08-09 19:38:32.056 [debug] No new project configuration found in storage 2024-08-09 19:38:32.065 [error] Extension 'ms-python.python' appears in product.json but enables LESS API proposals than the extension wants. package.json (LOSES): positronResolveSymlinks, contribEditorContentMenu, quickPickSortByLabel, testObserver, quickPickItemTooltip, terminalDataWriteEvent, terminalExecuteCommandEvent, contribIssueReporter, terminalShellIntegration product.json (WINS): contribEditorContentMenu, quickPickSortByLabel, portsAttributes, testObserver, quickPickItemTooltip, terminalDataWriteEvent, terminalExecuteCommandEvent, contribIssueReporter, terminalShellIntegration 2024-08-09 19:38:32.077 [warning] [ms-python.python]: Cannot register 'python.venvPath'. This property is already registered. 2024-08-09 19:38:32.077 [warning] [vscode.positron-r]: Cannot register 'positron.r.extraArguments'. This property is already registered. 2024-08-09 19:38:32.125 [debug] [Runtime startup] Extension ms-python.python has been registered for language runtime for language ID 'python' 2024-08-09 19:38:32.125 [debug] [Runtime startup] Extension vscode.positron-r has been registered for language runtime for language ID 'r' 2024-08-09 19:38:32.479 [debug] User data changed 2024-08-09 19:38:32.530 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T193830/window1/notebook.rendering.log 2024-08-09 19:38:32.641 [debug] User data changed 2024-08-09 19:38:32.649 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T193830/editSessions.log 2024-08-09 19:38:32.959 [debug] User data changed 2024-08-09 19:38:33.145 [error] spawn c:\Users\mmuiruri\scoop\apps\positron\2024.08.0-5\resources\app\extensions\positron-python\python-env-tools\bin\pet.exe ENOENT: Error: spawn c:\Users\mmuiruri\scoop\apps\positron\2024.08.0-5\resources\app\extensions\positron-python\python-env-tools\bin\pet.exe ENOENT at ChildProcess._handle.onexit (node:internal/child_process:286:19) at onErrorNT (node:internal/child_process:484:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) 2024-08-09 19:38:33.248 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T193830/window1/exthost/vscode.positron-r/Positron%20R%20Extension.log 2024-08-09 19:38:33.260 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T193830/window1/exthost/ms-python.python/Python.log 2024-08-09 19:38:33.260 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T193830/window1/exthost/ms-python.python/Python%20Locator.log 2024-08-09 19:38:33.284 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T193830/window1/exthost/vscode.git/Git.log 2024-08-09 19:38:33.285 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T193830/window1/exthost/vscode.github/GitHub.log 2024-08-09 19:38:33.439 [debug] [Runtime startup] Phase changed to 'starting' 2024-08-09 19:38:33.439 [debug] [Runtime startup] Activating extension vscode.positron-r for language ID r 2024-08-09 19:38:33.457 [debug] User data changed 2024-08-09 19:38:33.539 [info] Language runtime 378a95eba2dc3264cd81d7f28e867881 (language: R name: R 4.4.1 version: 4.4.1) automatically starting. Source: Affiliated r runtime for workspace 2024-08-09 19:38:33.539 [debug] [Runtime startup] Activating extension ms-python.python for language ID python 2024-08-09 19:38:33.539 [debug] [Runtime startup] Activating extension vscode.positron-r for language ID r 2024-08-09 19:38:33.573 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T193830/ptyhost.log 2024-08-09 19:38:33.577 [debug] [Ext host 0] Runtime manager for 'R 4.4.1': true 2024-08-09 19:38:33.578 [debug] [Runtime startup] All extensions contributing language runtimes have been activated. 2024-08-09 19:38:33.578 [debug] [Runtime startup] Phase changed to 'discovering' 2024-08-09 19:38:33.635 [error] [Extension Host] Language runtime provider threw an error during registration: Error: not found: R 2024-08-09 19:38:33.640 [debug] User data changed 2024-08-09 19:38:33.859 [debug] [Ext host 0] Runtime manager for 'R 4.4.1': true 2024-08-09 19:38:33.925 [warning] Ignoring call to requestRefresh; client is not available. 2024-08-09 19:38:35.098 [info] [perf] Render performance baseline is 53ms 2024-08-09 19:38:36.249 [info] Creating positron.variables client 'positron-variables-r-0-856a3f3e'... 2024-08-09 19:38:36.256 [info] Creating positron.ui client 'positron-ui-r-1-104040ea'... 2024-08-09 19:38:37.082 [info] Creating positron.help client 'positron-help-r-2-fe2716b5'... 2024-08-09 19:38:45.855 [debug] [Runtime startup] Phase changed to 'complete' 2024-08-09 19:38:46.016 [debug] User data changed 2024-08-09 19:38:46.184 [debug] User data changed 2024-08-09 19:38:56.052 [debug] User data changed

Will certainly try the fixes suggested

Adding pictures for a better view:

No R discovered

@jennybc
Copy link
Member

jennybc commented Aug 9, 2024

Here's one (non-specific) thing to try: reset your Positron state, which is in %APPDATA%\Positron. Literally, I propose that you close all open Positron instances and delete this folder.

In Windows Command Prompt, echo %APPDATA%\Positron will reveal this path.
In PowerShell, echo %APPDATA%\Positron will do the same.

Given that I don't understand the problem yet, I also don't know if this will help. But it does give us a better baseline, i.e. we know we aren't trying to restore a previous state.

Warning: This will blow away your user settings (which are in the User subfolder), so be prepared for that. If you've done a lot of customization, consider saving/restoring the user settings.json.

@michaelgicheru
Copy link

I have done what you just suggested and now it can't detect R at all. Even with all workspaces closed. Here is the output from "Window":

2024-08-09 20:18:58.661 [debug] Error while reading the extension cache file: /C:/Users/mmuiruri/AppData/Roaming/Positron/CachedProfilesData/__default__profile__/extensions.builtin.cache Unable to read file 'vscode-userdata:/c:/Users/mmuiruri/AppData/Roaming/Positron/CachedProfilesData/__default__profile__/extensions.builtin.cache' (Error: Unable to resolve nonexistent file 'vscode-userdata:/c:/Users/mmuiruri/AppData/Roaming/Positron/CachedProfilesData/__default__profile__/extensions.builtin.cache') 2024-08-09 20:18:58.662 [debug] Error while reading the extension cache file: /C:/Users/mmuiruri/AppData/Roaming/Positron/CachedProfilesData/__default__profile__/extensions.user.cache Unable to read file 'vscode-userdata:/c:/Users/mmuiruri/AppData/Roaming/Positron/CachedProfilesData/__default__profile__/extensions.user.cache' (Error: Unable to resolve nonexistent file 'vscode-userdata:/c:/Users/mmuiruri/AppData/Roaming/Positron/CachedProfilesData/__default__profile__/extensions.user.cache') 2024-08-09 20:18:58.691 [info] Started local extension host with pid 9624. 2024-08-09 20:18:58.698 [debug] Could not get workspace hash for forwarded ports storage key. 2024-08-09 20:18:58.701 [debug] No new project configuration found in storage 2024-08-09 20:18:59.022 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T201856/terminal.log 2024-08-09 20:18:59.022 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T201856/remoteTunnelService.log 2024-08-09 20:18:59.023 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T201856/window1/notebook.rendering.log 2024-08-09 20:18:59.023 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T201856/editSessions.log 2024-08-09 20:18:59.374 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T201856/sharedprocess.log 2024-08-09 20:18:59.463 [debug] ComputeTargetPlatform: win32-x64 2024-08-09 20:18:59.466 [error] Extension 'ms-python.python' appears in product.json but enables LESS API proposals than the extension wants. package.json (LOSES): positronResolveSymlinks, contribEditorContentMenu, quickPickSortByLabel, testObserver, quickPickItemTooltip, terminalDataWriteEvent, terminalExecuteCommandEvent, contribIssueReporter, terminalShellIntegration product.json (WINS): contribEditorContentMenu, quickPickSortByLabel, portsAttributes, testObserver, quickPickItemTooltip, terminalDataWriteEvent, terminalExecuteCommandEvent, contribIssueReporter, terminalShellIntegration 2024-08-09 20:18:59.479 [warning] [ms-python.python]: Cannot register 'python.venvPath'. This property is already registered. 2024-08-09 20:18:59.480 [warning] [vscode.positron-r]: Cannot register 'positron.r.extraArguments'. This property is already registered. 2024-08-09 20:18:59.533 [debug] [Runtime startup] Extension ms-python.python has been registered for language runtime for language ID 'python' 2024-08-09 20:18:59.533 [debug] [Runtime startup] Extension vscode.positron-r has been registered for language runtime for language ID 'r' 2024-08-09 20:18:59.916 [debug] User data changed 2024-08-09 20:19:00.120 [debug] User data changed 2024-08-09 20:19:01.853 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T201856/window1/exthost/vscode.github/GitHub.log 2024-08-09 20:19:01.944 [debug] [Runtime startup] Activating extension ms-python.python for language ID python 2024-08-09 20:19:01.945 [debug] [Runtime startup] Activating extension vscode.positron-r for language ID r 2024-08-09 20:19:02.134 [info] [perf] Render performance baseline is 21ms 2024-08-09 20:19:03.109 [error] spawn c:\Users\mmuiruri\scoop\apps\positron\2024.08.0-5\resources\app\extensions\positron-python\python-env-tools\bin\pet.exe ENOENT: Error: spawn c:\Users\mmuiruri\scoop\apps\positron\2024.08.0-5\resources\app\extensions\positron-python\python-env-tools\bin\pet.exe ENOENT at ChildProcess._handle.onexit (node:internal/child_process:286:19) at onErrorNT (node:internal/child_process:484:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) 2024-08-09 20:19:03.189 [debug] User data changed 2024-08-09 20:19:03.199 [debug] [Runtime startup] All extensions contributing language runtimes have been activated. 2024-08-09 20:19:03.199 [debug] [Runtime startup] Phase changed to 'discovering' 2024-08-09 20:19:03.208 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T201856/window1/exthost/vscode.positron-notebook-controllers/Positron%20Notebook%20Controllers.log 2024-08-09 20:19:03.211 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T201856/window1/exthost/vscode.positron-r/Positron%20R%20Extension.log 2024-08-09 20:19:03.212 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T201856/window1/exthost/ms-python.python/Python.log 2024-08-09 20:19:03.212 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T201856/window1/exthost/ms-python.python/Python%20Locator.log 2024-08-09 20:19:03.261 [error] [Extension Host] Language runtime provider threw an error during registration: Error: not found: R 2024-08-09 20:19:03.310 [debug] User data changed 2024-08-09 20:19:03.550 [debug] [Registering Log Channel] File does not exist. Waiting for 1s to retry. file:///c%3A/Users/mmuiruri/AppData/Roaming/Positron/logs/20240809T201856/ptyhost.log 2024-08-09 20:19:04.411 [debug] User data changed 2024-08-09 20:19:04.527 [debug] User data changed 2024-08-09 20:19:09.459 [debug] User data changed 2024-08-09 20:19:09.723 [debug] User data changed 2024-08-09 20:19:12.878 [debug] [Runtime startup] Phase changed to 'complete' 2024-08-09 20:19:16.028 [debug] User data changed 2024-08-09 20:19:29.484 [debug] User data changed 2024-08-09 20:19:58.264 [debug] Comments: URIs of continue on comments to add to storage . 2024-08-09 20:19:58.561 [debug] User data changed 2024-08-09 20:20:02.464 [debug] Comments: URIs of continue on comments to add to storage . 2024-08-09 20:20:02.660 [debug] User data changed 2024-08-09 20:20:13.481 [debug] User data changed

@jennybc
Copy link
Member

jennybc commented Aug 10, 2024

We think we understand this now and have a fix working its way through the system.

If you're suffering from this, I don't think there's anything you can do as a user to fix it. Fall back to the 2024.07.0-125 release to get unstuck. And once #4311 gets into release, all should be well 🤞

softwarenerd added a commit that referenced this issue Aug 10, 2024
…rong version of `which` to be used, which caused R not to load on some configurations of Windows (#4311)

<!--
  Describe briefly what problem this pull request resolves, or what
  new feature it introduces. Include screenshots of any new or altered
  UI. Link to any GitHub issues but avoid "magic" keywords that will 
  automatically close the issue. If there are any details about your 
approach that are unintuitive or you want to draw attention to, please
  describe them here.
-->

This PR addresses #4280.

This issue was tracked down to the fact that the `positron-r` extension
did not have an explicit `dependencies` entry for the `which` package,
but it did have a `devDependencies` entry for `@types/which`
(`"@types/which": "^3.0.0",`).

As a result of this, the `positron-r/node_modules` folder contained
`which` 2.0.2 (I believe) from:

```
mocha@^9.2.1:
  version "9.2.2"
  resolved "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz"
  integrity sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==
  dependencies:
    "@ungap/promise-all-settled" "1.1.2"
    ansi-colors "4.1.1"
    browser-stdout "1.3.1"
    chokidar "3.5.3"
    debug "4.3.3"
    diff "5.0.0"
    escape-string-regexp "4.0.0"
    find-up "5.0.0"
    glob "7.2.0"
    growl "1.10.5"
    he "1.2.0"
    js-yaml "4.1.0"
    log-symbols "4.1.0"
    minimatch "4.2.1"
    ms "2.1.3"
    nanoid "3.3.1"
    serialize-javascript "6.0.0"
    strip-json-comments "3.1.1"
    supports-color "8.1.1"
    which "2.0.2"
    workerpool "6.2.0"
    yargs "16.2.0"
    yargs-parser "20.2.4"
    yargs-unparser "2.0.0"
```

This version of `which` does not support the `nothrow` option for `async
which`, which we rely on in this code fragment from
`extensions/positron-r/src/provider.ts`:

```
	const whichR = await which('R', { nothrow: true }) as string;
```

Because of this, on some configurations of Windows, an error was being
thrown which caused R not to load.

For background on this, see:
npm/node-which#80. This was the exact same
problem.

### QA Notes

<!--
  Add additional information for QA on how to validate the change,
  paying special attention to the level of risk, adjacent areas that
  could be affected by the change, and any important contextual
  information not present in the linked issues.
-->
@jennybc
Copy link
Member

jennybc commented Aug 10, 2024

The 2024.08.0-31 release contains what we believe to be the fix. If anyone here can confirm, that would be great to know!

@PatrickCoyle
Copy link

PatrickCoyle commented Aug 10, 2024

The 2024.08.0-31 release fixes this issue for me.

OS details: Windows

Interpreter details:
R version: 4.4.1
Location: C:\Program Files\R\R-4.4.1\bin\x64\R.exe

@Suggestions-Only
Copy link

The 2024.08.0-31 release also fixed it for me.

Windows 11 Home

Interpreter details:
R version: 4.4.1
Location: C:\Program Files\R\R-4.4.1\bin\x64\R.exe

@jennybc
Copy link
Member

jennybc commented Aug 11, 2024

I think we can close this now.

@jennybc jennybc closed this as completed Aug 11, 2024
@jennybc jennybc added bug Something isn't working regression os-windows Windows issue lang: r and removed info needed Waiting on information labels Aug 11, 2024
@keitheleejr
Copy link

Thanks, @jennybc. I was just able to confirm as well.

@ShiweiLin1991
Copy link
Author

Done, the lastest version has been solved such bug in windows (x64)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working lang: r os-windows Windows issue regression
Projects
None yet
Development

No branches or pull requests

8 participants