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

[rserver] ERROR system error 98 (Address already in use):RStudio in a container #2

Open
bio-visualisation opened this issue Jan 8, 2023 · 8 comments

Comments

@bio-visualisation
Copy link

I am using conda environment. I want to install rstudio-server in this conda environment. So I tried pulling the container using
(base) basu@darwin:~$ singularity pull docker://rocker/tidyverse:3.6.1

But when I am running the rserver container, it is showing the following error.

(base) basu@darwin:~$ singularity exec tidyverse_3.6.1.sif rserver
INFO: Converting SIF file to temporary sandbox...
08 Jan 2023 06:32:51 [rserver] ERROR system error 98 (Address already in use); OCCURRED AT: rstudio::core::Error rstudio::core::http::initTcpIpAcceptor(rstudio::core::http::SocketAcceptorService<rstudio_boost::asio::ip::tcp>&, const string&, const string&) /var/lib/jenkins/workspace/IDE/open-source-pipeline/v1.2-patch/src/cpp/core/include/core/http/TcpIpSocketUtils.hpp:103; LOGGED FROM: int main(int, char* const*) /var/lib/jenkins/workspace/IDE/open-source-pipeline/v1.2-patch/src/cpp/server/ServerMain.cpp:502
INFO: Cleaning up image...

(base) basu@darwin:~$ singularity exec -C -B $(pwd):/home/rstudio -B $(pwd):$HOME tidyverse_3.6.1.sif rserver --www-port 8787 --www-address 0.0.0.0 --auth-none=0 --auth-pam-helper-path=pam-helper
INFO: Converting SIF file to temporary sandbox...
08 Jan 2023 06:35:13 [rserver] ERROR system error 98 (Address already in use); OCCURRED AT: rstudio::core::Error rstudio::core::http::initTcpIpAcceptor(rstudio::core::http::SocketAcceptorService<rstudio_boost::asio::ip::tcp>&, const string&, const string&) /var/lib/jenkins/workspace/IDE/open-source-pipeline/v1.2-patch/src/cpp/core/include/core/http/TcpIpSocketUtils.hpp:103; LOGGED FROM: int main(int, char* const*) /var/lib/jenkins/workspace/IDE/open-source-pipeline/v1.2-patch/src/cpp/server/ServerMain.cpp:502
rserver[14]: ERROR system error 98 (Address already in use); OCCURRED AT: rstudio::core::Error rstudio::core::http::initTcpIpAcceptor(rstudio::core::http::SocketAcceptorService<rstudio_boost::asio::ip::tcp>&, const string&, const string&) /var/lib/jenkins/workspace/IDE/open-source-pipeline/v1.2-patch/src/cpp/core/include/core/http/TcpIpSocketUtils.hpp:103; LOGGED FROM: int main(int, char* const*) /var/lib/jenkins/workspace/IDE/open-source-pipeline/v1.2-patch/src/cpp/server/ServerMain.cpp:502
INFO: Cleaning up image...

Please help.

@marcodelapierre
Copy link
Contributor

marcodelapierre commented Jan 9, 2023

Hi,
some of these suggest to me that it might be an issue due to your Singularity setup, not to the specific setup for the RStudio container:

INFO: Converting SIF file to temporary sandbox...
...
ERROR system error 98 (Address already in use); OCCURRED AT: ...

To test this hypothesis, can you try with another container?

$ singularity shell docker://ubuntu:20.04

@marcodelapierre
Copy link
Contributor

Also, can you share the outputs of these two commands:

  1. cat /etc/os-release
  2. singularity --version

@bio-visualisation
Copy link
Author

Okay. I have tried all those commands. Singularity set up looks fine to me.

$ singularity shell docker://ubuntu:20.04
INFO: Converting OCI blobs to SIF format
INFO: Starting build...
Getting image source signatures
Copying blob 846c0b181fff done
Copying config 6bf069844c done
Writing manifest to image destination
Storing signatures
2023/01/09 12:19:55 info unpack layer: sha256:846c0b181fff0c667d9444f8378e8fcfa13116da8d308bf21673f7e4bea8d580
INFO: Creating SIF file...
INFO: Converting SIF file to temporary sandbox...
WARNING: underlay of /etc/localtime required more than 50 (66) bind mounts
Singularity>

......

(base) basu@darwin:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

..............

(base) basu@darwin:~$ singularity --version
singularity version 3.8.6

@marcodelapierre
Copy link
Contributor

Thanks.

Finally, what happens with the following:

singularity shell docker://rocker/tidyverse:3.6.1
singularity shell docker://rocker/tidyverse:4.2.2

@bio-visualisation
Copy link
Author

(base) basu@darwin:~$ singularity shell docker://rocker/tidyverse:3.6.1
INFO: Using cached SIF image
INFO: Converting SIF file to temporary sandbox...
Singularity>

(base) basu@darwin:~$ singularity shell docker://rocker/tidyverse:4.2.2
INFO: Converting OCI blobs to SIF format
INFO: Starting build...
Getting image source signatures
Copying blob 6e3729cf69e0 skipped: already exists
Copying blob 38ca03cb4341 skipped: already exists
Copying blob 391772febd46 skipped: already exists
Copying blob a25c51f16bf9 done
Copying blob f3b5813d2232 done
Copying blob 794f953b3104 done
Copying blob 50588e2c240f done
Copying blob 945cceb8a05a done
Copying blob dbb7ba223c94 done
Copying config 003530cab3 done
Writing manifest to image destination
Storing signatures
2023/01/09 17:18:34 info unpack layer: sha256:6e3729cf69e0ce2de9e779575a1fec8b7fb5efdfa822829290ab6d5d1bc3e797
2023/01/09 17:18:35 info unpack layer: sha256:38ca03cb4341ffc5ad0cc6e55bb3f37f75b2f651a46b59c29045da93cc29618d
2023/01/09 17:18:35 info unpack layer: sha256:391772febd46a665834d86cd5c6547e548e3dc06bda60df9cb3496ff18e37bf1
2023/01/09 17:18:41 info unpack layer: sha256:a25c51f16bf9046e7aff5a80b4b12b027300d174aa7aa7dad9ee3330d1588f2d
2023/01/09 17:18:41 info unpack layer: sha256:f3b5813d223228aaf690481063e66104d0f3ff8f81cfabf103fa0e58241aaeea
2023/01/09 17:18:42 info unpack layer: sha256:794f953b310428251b7c2b9b14c5f8e0d067aab119958670fc88f761264b6c5d
2023/01/09 17:18:50 info unpack layer: sha256:50588e2c240fb4430bd7794010011b200fcc514dd27d8b6c6884f5225aa7926f
2023/01/09 17:18:50 info unpack layer: sha256:945cceb8a05ae4c6de98a8cb86e0c2112a69b51894a12dbcd8fa4402f6770fb2
2023/01/09 17:18:50 info unpack layer: sha256:dbb7ba223c94d1062e23d2a9d8254e30e95acd876e41ed0cf751ea57182defc3
INFO: Creating SIF file...
INFO: Converting SIF file to temporary sandbox...
Singularity>

@marcodelapierre
Copy link
Contributor

marcodelapierre commented Jan 16, 2023

Ok,
so it looks like the issue is specific to running the rserver command. I had a further look, and it seems like the default communication port requested by rserver is already in use by some other service on your computer.

I suggest the following (see example file https://github.com/PawseySC/singularity-containers/blob/gh-pages/demos/rstudio/run_session.sh):

  1. try and run these commands:
    export SINGULARITYENV_USER=$USER
    export SINGULARITYENV_PASSWORD=rstudiopassword
    echo $SINGULARITYENV_USER && echo $SINGULARITYENV_PASSWORD
    
    singularity exec \
        -C \
        -B $(pwd):/home/rstudio \
        -B $(pwd):$HOME \
        docker://rocker/tidyverse:3.6.1 \
        rserver --www-port 8787 --www-address 0.0.0.0 --auth-none=0 --auth-pam-helper-path=pam-helper
    
  2. If you get the same error, replace 8787 above with another number within that similar range, i.e. 8788, and so on
  3. If the command succeeds and you are running on your local machine, all you have to do is to go on your browser and type the URL localhost:<PORT NUMBER>

Feel free to let me know how this goes.

@bio-visualisation
Copy link
Author

I tried all the suggestions. After all this, at port 8797 there was no error but still i could not connect with localhost:8797.

I tried with different version of rocker image. This time with rocker/rstudio:4.2

singularity exec \ -C \ -B $(pwd):/home/rstudio \ -B $(pwd):$HOME \ rstudio_4.2.sif \ rserver --www-port 8787 --www-address 0.0.0.0 --auth-none=0 --auth-pam-helper-path=pam-helper

I got the following error.

INFO: Converting SIF file to temporary sandbox...
TTY detected. Printing informational message about logging configuration. Logging configuration loaded from '/etc/rstudio/logging.conf'. Logging to 'syslog'.
rserver[13]: ERROR Attempt to run server as user 'rstudio-server' (uid 999) from account 'basu' (uid 1009) without privilege, which is required to run as a different uid; LOGGED FROM: virtual rstudio::core::ProgramStatus rstudio::server::Options::read(int, char* const*, std::ostream&) src/cpp/server/ServerOptions.cpp:318

2023-01-23T11:13:30.665675Z [rserver] ERROR Attempt to run server as user 'rstudio-server' (uid 999) from account 'basu' (uid 1009) without privilege, which is required to run as a different uid; LOGGED FROM: virtual rstudio::core::ProgramStatus rstudio::server::Options::read(int, char* const*, std::ostream&) src/cpp/server/ServerOptions.cpp:318
INFO: Cleaning up image...

@marcodelapierre
Copy link
Contributor

Hi, is this your laptop?

(base) basu@darwin

The message suggests that you need basu, the host user in the computer (laptop?), to have sudo powers. In other words, you need to enable administrative privileges to such user, otherwise the setup will not work.

This issue normally does not appear on HPC centres nor cloud VMs, nor personal computer. I suspect you have an institutional (academia/company) computer, with restrictions on the user privileges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants