Rstudio relative links don't work in help pane

Hi,

We have an error which is somewhat related to RStudio help link error which was fixed in the past but is not working in our environment,

The relative links inside the help pane of rstudio is not resolving correct. For example:
library(igraph)
help(igraph)
Inside the help description is a make_ring() link;
igraph graphs have a class ‘igraph’. They are printed to the screen in a special format, here is an example, a ring graph created using make_ring():

This make_ring() url should resolve as:
https://${ood_server}/rnode/${compute_node)/{port}/help/library/igraph/help/make_ring

but is resolving as:
https://${ood_server}/rnode/${compute_node)/{port}/igraph/html/make_ring.html.

In the console this will display the page in the help pane right
?make_ring()

ood version = 3.1
R version = 4.4.0
Rstdudio version = 2024.04.01

We don’t have other issues within ood/rstudio, Is there some kind of redirect setting of rewriterule we can use just for displaying the help pages right?

Thanks in advance,
Regards,
Arthur

Hi and welcome!

Sorry for the delay in the response. This should have been fixed - I fixed it myself at some point in the past. I see you’re on 3.1. What OS are you on and can you also provide the apache version. With those 2 pieces of information, I’ll try to replicate and see if this issue persists.

Hi Jeff,

Thanks for the response. For open ondemand we are on RedHat 8.9 and the httpd version is 2.4.37. We are running Rstudio from inside a singularity rocker image based on ubuntu 22.04.

Regards.
Arthur

Hi @jeff.ohrstrom. Did you manage to check if this issue persists on our current setup. Is there some kind of (temporary) customisation which we can do inside the code? We have many R-Studio users which are using this help pane frequently.
Regards,
Arthur

I haven’t gotten a chance to replicate yet. We’re in the middle of a summer program for high school kids that’s got a week left.

It’s still on my plate though - I’ll report back when I have something.

I can’t replicate on our systems. I’m running the same OS and httpd as you are. Though my Rstudio is 2023.06.1.

I’ll see if I can install 2024.04.01 and see if there’s any difference there.

I can’t replicate with the rocker/rstudio image either. Though when I build rocker/rstudio:4.4.0 it gives rstudio 2024.04.2, so I can’t get the same exact version of Rstudio.

Hi, Jeff. Sorry for the very late reply. I have tried a different combinations with RHEL7/8, apache versions, rocker versions. and different rstudio server versions but in our environment the help links doesn’t resolve right. Can you give me some guidelines what could be an approach to manually fix this for our environment? Things i am thinking about are:

  • altering the /opt/ood/mod_ood_proxy/lib/node_proxy.lua file (see Ensure urls in proxies by johrstrom · Pull Request #1105 · OSC/ondemand · GitHub) with a seperate “help uri” entry
  • Another approach can be the addition of a seperate LocationMatch directive with a custom …/help/library regexp inside the file /etc/httpd/conf.d/ood-portal.conf
    but maybe there are better solutions available.
    Hope you can help.

Best regards,
Arthur

Those may work, but without knowing where the issue really is, I’m just stabbing in the dark.

There must be something here we’re failing to consider. Does your site run behind a proxy? Is there anything else about your setup/network that we haven’t considered yet? I would also maybe try a different browser just to be sure it isn’t that.

I guess as a last resort I’d also ask if you’ve been editing the ood_portal.conf by hand or if it’s really being generated automatically form the yml settings.

I just want to eliminate what we can before having to make some serious edits.

You could maybe increase logging to see how the rewrite rules are rewriting the Location header.

Hi,

  • already did try different browsers
  • no proxy or custom network is configured
  • we are using a default ood_portal.yml. here rnode_uri: /rnode is defined.
  • the increase of logging where can i set this?

I now get the following get requests if i navigate to the make_ring() relative link from igraph help pane.

“GET /rnode/{compute_node}/help/library/igraph/help/make_ring HTTP/1.1” 302 75 “https://{ood_node}/rnode/{compute_node}/65165/” “Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0”
“GET /rnode/{compute_node}/65165/help/library/igraph/help/make_ring HTTP/1.1” 302 75 “https://{ood_node}/rnode/{compute_node}/65165/” “Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0”
“GET /rnode/{compute_node}/65165/igraph/html/make_ring.html HTTP/1.1” 404 2375 “https://{ood_node}/rnode/{compute_node}/65165/” “Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0”
“GET /rnode/{compute_node}/65165/css/page.css HTTP/1.1” 200 738 “https://{ood_node}/rnode/{compute_node}/65165/igraph/html/make_ring.html” “Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0”
“GET /rnode/{compute_node}/65165/rstudio.css HTTP/1.1” 200 1289 “https://{ood_node}/rnode/{compute_node}/65165/igraph/html/make_ring.html” “Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0”

Hi, we have finally managed to have a workaround for the relative links. We have changed the following section inside /opt/ood/ood-portal-generator/templates/ood-portal.conf.erb

<LocationMatch “^<%= @rnode_uri %>/(?<%= @host_regex || “[^/]+” %>)/(?\d+)(?/.*|)”>
<%- @auth.each do |line| -%>
<%= line %>
<%- end -%>

<%- @custom_location_directives.to_a.each do |line| -%>
<%= line %>
<%- end -%>

# ProxyPassReverse implementation
#Header edit Location "^([^/]+//[^/]+)|(?=/)|^([\./]{1,}(?<!/))" "<%= @rnode_uri %>/%{MATCH_HOST}e/%{MATCH_PORT}e"
# FIX
Header edit Location "^([\./]{1,}.*)" "%{MATCH_URI}e/../$1"
Header edit Location "^([^/]+//[^/]+)|(?=/)" "<%= @rnode_uri %>/%{MATCH_HOST}e/%{MATCH_PORT}e"

So we created a seperate Header edit Location for the relative links inside the help pane.
I don know if this is the right approach but it is working for us.