Skip to content

Did not receive a response from VSCode-R API within 5 seconds #1019

Description

@kenhanscombe

Hi,

On an HPC SLURM compute node, I'm getting

r$> devtools::load_all()                                                                                                                                                                         
Error in request_response("rstudioapi", action = action, args = list(...)) : 
  Did not receive a response from VSCode-R API within 5 seconds.

I think the last change I made was to ~/.Rprofile, adding

Sys.setenv(TERM_PROGRAM = "vscode")

source(file.path(
    Sys.getenv(
        if (.Platform$OS.type == "windows") "USERPROFILE" else "HOME"
    ),
    ".vscode-R", "init.R"
))

Activity

  1. changed the title [-]Cannot [/-] [+]Did not receive a response from VSCode-R API within 5 seconds[/+] on Mar 1, 2022
  2. renkun-ken commented on Mar 1, 2022

    @renkun-ken
    Member

    Do you open your workspace via remote-ssh? If not, then you should not put the script in you ~/.Rprofile.

  3. kenhanscombe commented on Mar 2, 2022

    @kenhanscombe
    Author

    Yes, I'm using remote-ssh.

    It works from the login node, but fails from an interactive slurm job.

  4. renkun-ken commented on Mar 2, 2022

    @renkun-ken
    Member

    It is a known limitation at the moment that if vscode-R extension is running on a server which does not have direct access to the filesystem where the interactive R terminal is started, then vscode-R session watcher won't work.

  5. kenhanscombe commented on Mar 2, 2022

    @kenhanscombe
    Author

    If I understand correctly then, vscode-R session watcher cannot be used on an HPC compute node (SLURM srun)? Setting "r.session.emulateRStudioAPI": false clears the error. Should I undo any other changes?

  6. Kdreval commented on Feb 22, 2023

    @Kdreval

    It seems that after the recent VS Code version update to 1.75.1 this is also affecting non-slurm nodes and gives the same error message on a regular remote ssh. The solution of setting r.session.emulateRStudioAPI to false appears to still work.

  7. nathaneastwood commented on Jun 6, 2023

    @nathaneastwood

    I'm currently having this issue. I haven't changed anything that I'm aware of.

    Version: 1.78.2 (user setup)
    Commit: b3e4e68a0bc097f0ae7907b217c1119af9e03435
    Date: 2023-05-10T14:39:26.248Z
    Electron: 22.5.2
    Chromium: 108.0.5359.215
    Node.js: 16.17.1
    V8: 10.8.168.25-electron.0
    OS: Windows_NT x64 10.0.19045
    Sandboxed: Yes

    vscode-r: v2.8.0

    languageserver: 0.3.15

    This is on my local machine. I'm not routing into any server.

  8. github-actions commented on Jun 6, 2024

    @github-actions

    This issue is stale because it has been open for 365 days with no activity.

  9. kleinbub commented on Jun 20, 2024

    @kleinbub

    I'm also having the same issue on a clean install following vscode-R setup guide,
    when using devtools::build() on a local package (so no networking/virtualization)
    This happens to me exclusively using radian, instead when using the default R terminal the command works as expected.
    setting r.session.emulateRStudioAPI to false does fix the issue, allowing the command to succeed with radian as well.

    REditorSupport.r v.2.8.4
    radian v0.6.12se
    R v4.4.0
    languageserver 0.3.16

  10. jialul commented on Jul 2, 2024

    @jialul

    I also run into the same issue with the latest R version (v2.8.4). I downgraded to v2.8.1 and restarted R and it works for me now.

  11. halidaee commented on Feb 3, 2025

    @halidaee

    Also experiencing this on my local machine. Also only experience it when using radian.

  12. eitsupi commented on Sep 23, 2026

    @eitsupi
    Member

    Closing in favor of #1763

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions