Shinyproxy.service failed: code=exited, status=217/USER

Hi there,

I’m a new ShinyProxy user, retracing the steps a colleague has made. He’s on sabbatical at the moment. We currently use the open version of shiny-server and he was looking into migrating to ShinyProxy at some point, but at the time transfer of knowledge didn’t seem necessary/feasible. And then time went by and I could really use a dashboard with user authentication…

Right before he left he mailed me saying he got our dashboard to work with Docker. I’m unsure if that meant he got it working all the way. When I try to run the dashboard with shinyproxy I can visit the login page, succesfully log in with simple authentication (not the default tesla user, but users my co-worker created) and select the dashboard in question. After that, however, I get a “Container did not respond in time” error. I ran it manually in a Docker with sudo docker run -p 3838:3838 appname-image R -e 'shiny::runApp("/root/appname")' and it showed no error messages.

After some sleuthing I found that the shinyproxy.service failed. Typing

systemctl status shinyproxy

gives the following output:

shinyproxy.service - ShinyProxy
Loaded: loaded (/etc/systemd/system/shinyproxy.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2020-04-22 13:01:06 UTC; 4s ago
Process: 72722 ExecStart=/usr/bin/java -jar /opt/shinyproxy/shinyproxy.jar (code=exited, status=217/USER)
Main PID: 72722 (code=exited, status=217/USER)

Restarting the service with

sudo systemctl restart shinyproxy.service

makes no difference.

The /opt/shinyproxy/shinyproxy.jar file exists, the /user/bin/java file does not. I’ve googled the “code=exited, status=217/USER” part, and found: “The error 217 indicate the user did not exist at the time the service tried to start”. I’ve looked into the /etc/system/systemd/shinyproxy.service file, and it says user is shinyproxy.

I’m currently out of ideas. Anyone know how to get the shinyproxy service to work again?

I had this problem just recently. The /etc/systemd/system/shinyproxy.service file that is created when you install shinyproxy puts in the User and Group: shinyproxy as down below. But I figured out that the LDAP active directory that maintains the username and group settings for my ec2 instances will delete or remove the shinyproxy user. So I changed those to my username and group settings so that it can run.

[Unit]
Description=ShinyProxy
After=syslog.target network.target
 
[Service]
Type=simple
User=$MYUSERNAME
Group=$MYUSERNAMEGROUP
WorkingDirectory=/etc/shinyproxy
ExecStart=/usr/bin/java -jar /opt/shinyproxy/shinyproxy.jar
KillMode=process
StandardOutput=journal
StandardError=journal
SuccessExitStatus=143

After changing the .service file, I ran sudo systemctl daemon-reload and then sudo systemctl restart shinyproxy and the service was working again.