# Rstudio-server Not Found

**URL:** <https://discourse.openondemand.org/t/rstudio-server-not-found/2279>\
**Category:** Get Help\
**Tags:** ondemand2, question\
**Created:** [September 16, 2022, 1:46pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279 "2022-09-16T13:46:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bdgill](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bdgill](https://discourse.openondemand.org/u/bdgill)\
**Post date:** [September 16, 2022, 1:46pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/1 "2022-09-16T13:46:11Z")

</div>

I’ve got two installations of rstudio on ood on two different clusters. One works as expected and one just gives me a 404 error on the auth-do-sign-in page. using ood 2.0.27 on the one that’s not working, 1.8.18 on the working one, rstudio-server-1.3.1093-1.x86\_64 on both and a centos8 singularity image.

I can confirm via telnet from the ood server that rstudio-server is listening on the node and port that was assigned to it.

I suspected a problem with the reverse proxy but the netcat test works as expected. Any advice on what to try next?

Here’s the relevant parts of my script.sh.erb:

setup\_env () {  
export RSTUDIO\_SERVER\_IMAGE=“/bil/packages/RStudio/rstudio-server-c8.sif”  
export SINGULARITY\_BINDPATH=“/etc,/media,/mnt,/opt,/srv,/usr,/lib64,/lib,/bil,/var”  
export SINGULARITYENV\_LD\_LIBRARY\_PATH=“$LD\_LIBRARY\_PATH”  
export PATH=“$PATH:/usr/lib/rstudio-server/bin:/bil/packages/R/R-3.6.3/bin:/bil/packages/anaconda3/4.9.2/envs/rstudio/bin/R”

}  
setup\_env

export RSTUDIO\_AUTH=“${PWD}/bin/auth”

export RSESSION\_WRAPPER\_FILE=“${PWD}/rsession.sh”  
(  
umask 077  
sed ‘s/^ {2}//’ \> “${RSESSION\_WRAPPER\_FILE}” \<\< EOL

export RSESSION\_LOG\_FILE=“${PWD}/rsession.log”

exec &\>\>“${RSESSION\_LOG\_FILE}”

echo “Launching rsession…”  
set -x  
exec rsession --r-libs-user “${R\_LIBS\_USER}” “${@}”  
EOL  
)  
chmod 700 “${RSESSION\_WRAPPER\_FILE}”

cd “${HOME}”

export TMPDIR=“$(mktemp -d)”  
export VARDIR=“$(mktemp -d)”

mkdir -p “$TMPDIR/rstudio-server”  
echo “Started the server”  
echo $(uuidgen) \> “$TMPDIR/rstudio-server/secure-cookie-key”

chmod 0600 “$TMPDIR/rstudio-server/secure-cookie-key”

set -x  
echo “Starting up rserver…”

singularity run -B “$TMPDIR:/tmp,$VARDIR:/var” “$RSTUDIO\_SERVER\_IMAGE”   
–www-port “${port}”   
–auth-none 0   
–auth-pam-helper-path “${RSTUDIO\_AUTH}”   
–auth-encrypt-password 0   
–server-working-dir “/tmp”   
–rsession-path “${RSESSION\_WRAPPER\_FILE}”

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [September 16, 2022, 1:59pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/2 "2022-09-16T13:59:44Z")

</div>

> [@bdgill](#):
>
> rstudio-server-1.3.1093-1.x86\_64

This is the version of RStudio in both cases? There was an update to RStudio in terms of how to connect to it upwards of 1.3.

---

<div class="post-metadata">

**Author:** ![bdgill](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bdgill](https://discourse.openondemand.org/u/bdgill)\
**Post date:** [September 16, 2022, 2:02pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/3 "2022-09-16T14:02:16Z")

</div>

Yes, I deliberately used the version that was working on our other installation. I also tried the most recent version but I get user errors with that one so I was trying to eliminate other issues to make the two setups as similar as possible.

---

<div class="post-metadata">

**Author:** ![bdgill](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bdgill](https://discourse.openondemand.org/u/bdgill)\
**Post date:** [September 16, 2022, 2:30pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/4 "2022-09-16T14:30:50Z")

</div>

I’m starting to think there’s a problem with the /var setup, I realized it’s slightly different from the other one but it gives me errors (readonly fs) if I try to bind the real /var, while binding the system /var works on the 1.8.18 ood version.

I tried copying the readable contents of the system /var/lib/rstudio-server into $VARDIR and the server again starts up but I still get 404 on the auth-do-sign-in page.

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [September 16, 2022, 2:47pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/5 "2022-09-16T14:47:34Z")

</div>

Can you tell where the 404 is coming from? If you open your browsers dev tools and inspect the response you should see a `server` header that indicates where it’s from.

I mean is it from our apache or is it from RStudio itself? Maybe it’s a simple as you forgot to enable the `/rnode` Locations on the new instance and that’s where the 404s are coming from.

---

<div class="post-metadata">

**Author:** ![bdgill](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bdgill](https://discourse.openondemand.org/u/bdgill)\
**Post date:** [September 16, 2022, 3:16pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/6 "2022-09-16T15:16:36Z")

</div>

Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k

grepping for rnode, I have this line commented out in etc/ood so I guess its the default:

config/ood\_portal.yml:#rnode\_uri: ‘/node’

I tried changing the value to ‘/rnode’ and restarting the server but got the same result.

and I have this line in the app regarding rnodes:  
view.html.erb:

---

<div class="post-metadata">

**Author:** ![bdgill](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bdgill](https://discourse.openondemand.org/u/bdgill)\
**Post date:** [September 16, 2022, 3:17pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/7 "2022-09-16T15:17:34Z")

</div>

on the working instance it’s set to ‘/rnode’

---

<div class="post-metadata">

**Author:** ![bdgill](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bdgill](https://discourse.openondemand.org/u/bdgill)\
**Post date:** [September 16, 2022, 3:27pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/8 "2022-09-16T15:27:27Z")

</div>

Sorry it interpreted that as formatting, let me see if I can get the line from view.html.erb:

`Preformatted text :<form action="/rnode/<%= host %>/<%= port %>/auth-do-sign-in" method="post" target="_blank">`

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [September 16, 2022, 5:22pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/9 "2022-09-16T17:22:49Z")

</div>

OK - so if this is a new cluster do you need to change/add the `host_regex` for that cluster?

```nohighlight
# ood_portal.yml
host_regex: ...

```

---

<div class="post-metadata">

**Author:** ![bdgill](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bdgill](https://discourse.openondemand.org/u/bdgill)\
**Post date:** [September 16, 2022, 6:03pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/10 "2022-09-16T18:03:58Z")

</div>

It’s set to the default right now.

---

<div class="post-metadata">

**Author:** ![bdgill](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bdgill](https://discourse.openondemand.org/u/bdgill)\
**Post date:** [September 16, 2022, 8:32pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/11 "2022-09-16T20:32:58Z")

</div>

Ok we changed the line in view.html.erb to node instead of rnode and now we get an error from RStudio instead of from Apache:

RStudio Server

The requested page was not found.

Please contact your system administrator for assistance, or click here to go back.

So the reverse proxy is getting the node to reply properly now, but perhaps the url for auth is still not formed right?

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [September 16, 2022, 8:49pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/12 "2022-09-16T20:49:55Z")

</div>

OK - keeping it as `rnode` is likely the correct thing. So this is a 404 not found from Apache and this is different 404 not found than the original issue yes?

I guess, I’m still trying to determine who’s gave you the original 404 - apache or RStudio?

---

<div class="post-metadata">

**Author:** ![bdgill](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bdgill](https://discourse.openondemand.org/u/bdgill)\
**Post date:** [September 16, 2022, 8:53pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/13 "2022-09-16T20:53:58Z")

</div>

Originally it was apache, just a generic page not found. Then we changed the view.html.erb to point to node instead of rnode and we get an error message from rstudio now.

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [September 16, 2022, 9:00pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/14 "2022-09-16T21:00:37Z")

</div>

I believe `/rnode` is the right one you want. Seems like you may have them backwards in your ood\_portal?

You seemed to indicate above that you’ve flipped these? They should be rnode is rnode and node is node.

```yaml
rnode_uri: '/rnode'
node_uri: '/node'

```

> [@bdgill](#):
>
> grepping for rnode, I have this line commented out in etc/ood so I guess its the default:
> 
> config/ood\_portal.yml:#rnode\_uri: ‘/node’

You have another OOD instance deployed. It does not seem like they both have the same configurations, do they?

---

<div class="post-metadata">

**Author:** ![bdgill](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bdgill](https://discourse.openondemand.org/u/bdgill)\
**Post date:** [September 19, 2022, 3:01am UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/15 "2022-09-19T03:01:11Z")

</div>

I’ve confirmed that the configuration is the same now between our two installations in ood\_portal.yml and it’s as you suggested rnode\_uri: ‘/rnode’, node\_uri: ‘/node’. However, in the working deployment we have the view.html.erb set to /rnode, but when I set the broken deployment that way it generates a 404 error from apache. When I set it to /node I get a page not found from Rstudio. It’s the same version of Rstudio and the same singularity image in both cases, so I’m puzzled as to why we get different behavior in these cases. Am I right in thinking you choose /rnode or /node based on what the application expects?

---

<div class="post-metadata">

**Author:** ![bdgill](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bdgill](https://discourse.openondemand.org/u/bdgill)\
**Post date:** [September 19, 2022, 1:16pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/16 "2022-09-19T13:16:56Z")

</div>

Also I’ve confirmed that it’s possible to connect with a browser directly to the port that is opened by rstudio so the server can generate pages but I can’t log in even if I save and use the password that’s generated for it (with my username). I can’t get the login screen to appear at all through the reverse proxy.

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [September 19, 2022, 2:02pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/17 "2022-09-19T14:02:19Z")

</div>

I’m still concerned a little about configs - especially when the behavior is backwards like that.

When you reconfigured `ood_portal.yml` did you bounce httpd? Those settings don’t take affect until you bounce httpd, so I want to be sure the configs you have have actually been applied.

---

<div class="post-metadata">

**Author:** ![bdgill](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bdgill](https://discourse.openondemand.org/u/bdgill)\
**Post date:** [September 19, 2022, 2:06pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/18 "2022-09-19T14:06:24Z")

</div>

Yes we did bounce the server. We’ve made a little progress now, we can get the rstudio loading screen with the loading whee. but then we get rstudio initialization error/unable to connect to service.

I am not sure how I can view any error output from the auth command?

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [September 19, 2022, 2:23pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/19 "2022-09-19T14:23:33Z")

</div>

Glad to see you making progress. If you have a helper script like this one - you can redirect output somewhere.

> <https://github.com/OSC/bc_osc_rstudio_server/blob/5349225dba0f432d3b61ecb199c76c817f85cfdd/template/script.sh.erb#L93>

---

<div class="post-metadata">

**Author:** ![bdgill](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bdgill](https://discourse.openondemand.org/u/bdgill)\
**Post date:** [September 19, 2022, 2:25pm UTC](https://discourse.openondemand.org/t/rstudio-server-not-found/2279/20 "2022-09-19T14:25:55Z")

</div>

Ok perhaps that’s part of the issue here. We have a line to create that rsession.log but it’s never yet been created so we don’t see any output.

[Next page](https://discourse.openondemand.org/t/rstudio-server-not-found/2279.md?page=2)
