posit-dev / positron

Positron, a next-generation data science IDE
Other
2.41k stars 72 forks source link

[Bug] Socket Timeout Error When Starting R with Positron #4233

Open kmkamilkhel opened 1 month ago

kmkamilkhel commented 1 month ago

System Details: Positron and OS Details: Positron Version: 2024.07.0-125

Operating System: Windows 10 Pro, Version 20H2

Interpreter Details: R Version: R 4.4.1

Describe the Issue: I'm experiencing a socket connection timeout error when attempting to start R (version 4.4.1) within the Positron IDE. This issue consistently prevents the successful initialization of R sessions. Below are the error messages and system configurations related to the issue:

R 4.4.1 starting. Error: Socket connect timed out after 20 seconds "c:\Program Files\Positron\resources\app\extensions\positron-r\resources\ark\ark.exe" --connection_file C:\Users\kk\AppData\Local\Temp\kernel-79VBUu\connection.json --log C:\Users\kk\AppData\Local\Temp\kernel-79VBUu\kernel.log --startup-file "c:\Program Files\Positron\resources\app\extensions\positron-r\resources\scripts\startup.R" --session-mode console -- --interactive --no-restore-data Process exit code 1073741845

Log File Details: Here are some relevant excerpts from the log file located at C:\Users\kk\AppData\Local\Temp\kernel-79VBUu\kernel.log:

[2024-08-05 10:15:32] INFO: Starting R process... [2024-08-05 10:15:52] ERROR: Socket connection timed out. [2024-08-05 10:15:52] ERROR: Process exit code 1073741845 - STATUS_ACCESS_VIOLATION

jmcphers commented 1 month ago

How was this R version installed?

Are you able to use it with other R front ends, such as RStudio?

Could you try again with trace-level logs enabled for R? You can turn these on here:

Image

kmkamilkhel commented 1 month ago

@jmcphers, thank you for looking into this issue. Below are the details and responses to your questions: R Version Installation Details: Installation Method: The R version 4.4.1 was installed using the official installer from CRAN. I downloaded the installer directly from CRAN's website and followed the standard installation process.

Installation Path: The installation path is the default location: C:\Program Files\R\R-4.4.1.

Environment Variables: I have verified that the R executable is correctly added to the system's PATH environment variable.

Compatibility with Other R Front Ends: RStudio: I am able to use R 4.4.1 successfully with RStudio without any issues. RStudio starts the R session without any socket timeout errors or connectivity problems.

Other Front Ends: I have also tested R with the base R GUI, and it runs without any problems.

Trace-Level Logs: I have enabled trace-level logging in Positron, and below are the relevant details from the log file:

Trace Log Excerpts:

R 4.4.1 starting. Error: Socket connect timed out after 20 seconds "c:\Program Files\Positron\resources\app\extensions\positron-r\resources\ark\ark.exe" --connection_file C:\Users\kk\AppData\Local\Temp\kernel-mJSG1T\connection.json --log C:\Users\kk\AppData\Local\Temp\kernel-mJSG1T\kernel.log --startup-file "c:\Program Files\Positron\resources\app\extensions\positron-r\resources\scripts\startup.R" --session-mode console -- --interactive --no-restore-data 2024-08-06T06:27:45.867416Z INFO Loaded connection information from frontend in C:\Users\kk\AppData\Local\Temp\kernel-mJSG1T\connection.json 2024-08-06T06:27:45.867464Z DEBUG Connection data: ConnectionFile { control_port: 53199, shell_port: 53886, stdin_port: 58536, iopub_port: 43750, hb_port: 62047, transport: "tcp", signature_scheme: "hmac-sha256", ip: "127.0.0.1", key: "80ce6d19824a565cf4d6913733d87998" } 2024-08-06T06:27:45.873921Z TRACE Binding to ZeroMQ 'Shell' socket at tcp://127.0.0.1:53886 at crates\amalthea\src\socket\socket.rs:45

Process exit code 1073741845

ZeroMQ Binding: The log indicates that there is an issue with binding to the ZeroMQ 'Shell' socket, suggesting a problem in establishing the connection.

Ports and IP: The connection uses ports on 127.0.0.1, and I've confirmed no conflicts with these ports using netstat.

Given these steps, I would appreciate any additional guidance or suggestions you might have to resolve this persistent issue. Is there a particular configuration or setting within Positron or R that I might have overlooked?

Thank you for your assistance!