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

[singularity] rsession-path / Could not connect to the R session on RStudio Server #590

Closed
liv-acollins opened this issue Jan 5, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@liv-acollins
Copy link

Container image name

rocker/rstudio:4.2.2

Container image digest

rocker/rstudio:4.2.2@sha256:320a4cdcda8402045b0e595e35c56620073abeb178f60efbb5d34e8371842d9b

What operating system are you seeing the problem on?

Linux

System information

$ singularity --version
singularity version 3.8.6
$ cat /etc/rocky-release
Rocky Linux release 8.6 (Green Obsidian)
$ uname -r
4.18.0-372.26.1.el8_6.x86_64

Bug description

Unable to login to RStudio once instance is launched. The instance seems to launch and login prompt appears, on entering correct details the instance is unable to connect and prompts:
"Could not connect to the R session on RStudio Server"

This issue appears to exist >=4.1.0 && <=4.2.2 (<4.1.0 untested) of the rocker images. We first found issue with 4.2.2. When we traced it back we found all images had the issue, including 4.1.0 which we are currently using. The only difference is our 4.1.0 images were pulled some time ago. I can't find the command in singularity to get the container digest value. It seems something has been changed in the image rebuilds that has caused this (?)

Only identifying feature I can find is:

New (broken) image:

$ singularity inspect -e rstudio_4.1.0.sif
=== /.singularity.d/env/10-docker2singularity.sh ===
#!/bin/sh
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
export R_VERSION="${R_VERSION:-"4.1.0"}"
export R_HOME="${R_HOME:-"/usr/local/lib/R"}"
export TZ="${TZ:-"Etc/UTC"}"
export CRAN="${CRAN:-"https://packagemanager.rstudio.com/cran/__linux__/focal/2021-08-09"}"
export LANG="${LANG:-"en_US.UTF-8"}"
export S6_VERSION="${S6_VERSION:-"v2.1.0.2"}"
export RSTUDIO_VERSION="${RSTUDIO_VERSION:-"1.4.1717"}"
export DEFAULT_USER="${DEFAULT_USER:-"rstudio"}"
export PANDOC_VERSION="${PANDOC_VERSION:-"default"}"

Old (working) image:

$ singularity inspect -e backup/rstudio_4.1.0.sif
=== /.singularity.d/env/10-docker2singularity.sh ===
#!/bin/sh
export PATH="/usr/lib/rstudio-server/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
export R_VERSION="${R_VERSION:-"4.1.0"}"
export TERM="${TERM:-"xterm"}"
export LC_ALL="${LC_ALL:-"en_US.UTF-8"}"
export LANG="${LANG:-"en_US.UTF-8"}"
export R_HOME="${R_HOME:-"/usr/local/lib/R"}"
export CRAN="${CRAN:-"https://packagemanager.rstudio.com/cran/__linux__/focal/2021-08-09"}"
export TZ="${TZ:-"Etc/UTC"}"
export S6_VERSION="${S6_VERSION:-"v2.1.0.2"}"
export RSTUDIO_VERSION="${RSTUDIO_VERSION:-"1.4.1717"}"
export DEFAULT_USER="${DEFAULT_USER:-"rstudio"}"

How to reproduce this bug?

This only seems to occur when using the following line (from the Singularity example):
--rsession-path=/etc/rstudio/rsession.sh

If we remove this line, then instance will launch fine
@liv-acollins liv-acollins added the bug Something isn't working label Jan 5, 2023
@eitsupi
Copy link
Member

eitsupi commented Jan 5, 2023

Please check #538.
I think your script needs to be updated.

@liv-acollins
Copy link
Author

liv-acollins commented Jan 5, 2023

@eitsupi.
Argh, found the culprit was the path missing and the line causing it but didn't put the two issues together.

exec rsession "${@}"
to
exec /usr/lib/rstudio-server/bin/rsession "${@}"

Additionally. Perhaps should be a separate issue but the following needs adding to the Singularity launch script example (for us at least this is required):
--server-user=`whoami`

Happy for this to be closed. The path update is the fix.

@eitsupi eitsupi changed the title rsession-path / Could not connect to the R session on RStudio Server [singularity] rsession-path / Could not connect to the R session on RStudio Server Jan 5, 2023
@eitsupi
Copy link
Member

eitsupi commented Jan 5, 2023

I'm glad to hear that has been resolved.

Additionally. Perhaps should be a separate issue but the following needs adding to the Singularity launch script example (for us at least this is required):
--server-user=whoami

Pull Requests to https://github.com/rocker-org/website are welcome!
(rocker-org members do not use singularity, so the cooperation of users like you is essential for updating this document)

@eitsupi eitsupi closed this as completed Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants