Skip to content

"R Session Disconnected" error when running RStudio Server + RStudio Desktop at same time #10242

Closed

Description

@kevinushey

System details

RStudio Edition : Both
RStudio Version : 2022.02.0-daily-318
OS Version      : Ubuntu 20.04 (aarch64)
R Version       : 3.6.2

Steps to reproduce the problem

First, install the open source versions of RStudio Server and RStudio Desktop. Then:

  1. Start RStudio Server,
  2. Connect to a session, and verify that you can restart the R session without issue.
  3. Start, and then close, RStudio Desktop.
  4. Return to RStudio Server, and try to restart the R session.

Describe the problem in detail

The "R Session Disconnected" message is displayed every time you try to restart the R session in RStudio Server.

Note that this behavior persists even after restarting RStudio Server; the only remedy I've found so far is:

rm -rf ~/.local/share/rstudio

which implies the issue is likely caused by something unexpected changing in the shared state.

Describe the behavior you expected

Restarts should function as normal.

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. kevinushey commented on Dec 13, 2021

    @kevinushey
    CollaboratorAuthor

    Note: filed as qa-repro as I was reproducing this with the development versions of RStudio; if this does not reproduce in the current daily builds of RStudio then I think we can file this for a separate milestone.

  2. mikebessuille commented on Dec 14, 2021

    @mikebessuille
    Contributor

    @AndrewMcClain is this part of the db changes / session info stuff? If it is, and if it's a regression, we should fix for PT. Otherwise, we might not want to add it to PT considering how overloaded PT is.

  3. AndrewMcClain commented on Dec 14, 2021

    @AndrewMcClain
    Contributor

    I don't expect this is db changes related. But I'll get a local repro going and see what I find.

  4. mikebessuille commented on Dec 14, 2021

    @mikebessuille
    Contributor

    See https://rstudio.slack.com/archives/C7HT9GDB9/p1639437744239900. Particularly,

    Having RStudio Server use a separate data directory (e.g. export RSTUDIO_DATA_HOME=~/.local/share/rstudio-server) resolves the issue, so I wonder if there’s some kind of cross-talk in the session database here.

  5. AndrewMcClain commented on Dec 14, 2021

    @AndrewMcClain
    Contributor

    I can locally repro, and it doesn't repro in Ghost Orchid, so this looks to be a regression.

    I have however observed some odd behavior that it doesn't repro consistently, or sometimes deleting .local/share/rstudio doesn't resolve it. So I'm going to keep looking at this to see what the cause may be.

  6. AndrewMcClain commented on Dec 16, 2021

    @AndrewMcClain
    Contributor

    Turns out this is some session cross talk in the sources database between Desktop and Server, this is mitigated by my changes in #10115 to fix a regression causing Desktop to write to the scratch path.

  7. removed their assignment
    on Dec 17, 2021
  8. self-assigned this
    on Dec 17, 2021
  9. ronblum commented on Dec 21, 2021

    @ronblum
    Contributor

    Verified that this works with the combination of

    • RStudio Desktop 2022.02.0-daily+335
    • RStudio Server 2022.02.0-daily+335
    • R 3.6.2 and 4.1.1

    I was able to reproduce the original issue in with build 318. However, build 335 continued to fail until I removed the directory with rm -rf ~/.local/share/rstudio left over from the earlier build, and restarted the server. After that, no problem.

    Note: Not verified on Red Hat 8 due to #8840.

  10. privefl commented on Sep 12, 2025

    @privefl

    I experience this randomly (not at the start, but once per day on average), and it completely restarts my session.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions