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

Running RStudio Server with unprivileged user not possible #592

Closed
antonneubauer opened this issue Jan 11, 2023 · 5 comments
Closed

Running RStudio Server with unprivileged user not possible #592

antonneubauer opened this issue Jan 11, 2023 · 5 comments
Labels

Comments

@antonneubauer
Copy link

We ran into a problem trying to start the rocker/rstudio image with enroot on our slurm-cluster. Since our users are unprivileged, we get the following error:
2023-01-11T19:23:56.907205Z [rserver] ERROR Attempt to run server as user 'rstudio-server' (uid 999) from account '<userAccount>' (uid 11293) 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 /usr/lib/rstudio-server/bin/rstudio-server: line 7: systemctl: command not found

We have fixed this by copying your Dockerfile, inserting RUN echo "server-user=$USER" >> /etc/rstudio/rserver.conf before CMD ["/init"] and building our own image.

We were wondering, if this is something you might want to/ can to add to your Dockerfiles.
If there's something that speaks against doing that I would be very interested in learning about it since I am fairly new to this field.

@antonneubauer antonneubauer changed the title Running RStudio Server from unpriviliged account not possible Running RStudio Server with unprivileged user not possible Jan 11, 2023
@eddelbuettel eddelbuettel transferred this issue from rocker-org/rocker Jan 11, 2023
@eitsupi
Copy link
Member

eitsupi commented Jan 12, 2023

I believe that the RStudio Server started by the /init command is intended to be run by the root user, so it does not work correctly by a non-root user.

We have fixed this by copying your Dockerfile, inserting RUN echo "server-user=$USER" >> /etc/rstudio/rserver.conf before CMD ["/init"] and building our own image.

I don't think you have to do it. A simple Dockerfile like the following should should be sufficient:

FROM rocker/rstudio:4
RUN echo "server-user=$USER" >> /etc/rstudio/rserver.conf

@antonneubauer
Copy link
Author

Thanks for the quick reply!
Looks like your (much simpler) version of the Dockerfile works. Thank you for that.

We are currently testing the set up on our Cluster and I'll report back if we run into issues because of the non-root-start up.

@eitsupi
Copy link
Member

eitsupi commented Jan 17, 2023

I'm glad to hear that.
I'm closing this for now, but feel free to post again if you have any more problems.

@eitsupi eitsupi closed this as completed Jan 17, 2023
@lambdamoses
Copy link

Hi, I got the same problem when running RStudio from the rocker container on a server using apptainer. I translated your short dockerfile into apptainer definition (though had to hard code my user name since somehow $USER is blank when building the image with fakeroot) and it worked, but that's one extra annoying step. Is there a reason not to add RUN echo "server-user=$USER" >> /etc/rstudio/rserver.conf in the rocker docker file? Anyway, I think I'm going to make my own docker image to run my R package in RStudio inside a container and I'll add that line, unless you advise not to.

@eitsupi
Copy link
Member

eitsupi commented Apr 18, 2024

Is there a reason not to add RUN echo "server-user=$USER" >> /etc/rstudio/rserver.conf in the rocker docker file?

As I wrote above, these images are intended to run RStudio Server by root.

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

No branches or pull requests

3 participants