"Access to 127.0.0.1 was denied" when trying to to open pdf vignette

I wrote an R package that has pdf files as vignettes and have successfully used it for 3 years. Now, when I try to open the pdfs I get the access error.:

Access to 127.0.0.1 was denied
You don't have authorization to view this page.
HTTP ERROR 403

I can't associate any particular update of RStudio where the problem started since I don't check the files every time I update. Here are the specs on my system:

R version 4.2.2 Patched (2022-11-10 r83330)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 21.1

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] compiler_4.2.2 tools_4.2.2 rstudioapi_0.14

RStudio 2022.12.0+353 "Elsbeth Geranium" Release (7d165dcfc1b6d300eb247738db2c7076234f6ef0, 2022-12-03) for Ubuntu Jammy

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) rstudio/2022.12.0+353 Chrome/102.0.5005.167 Electron/19.1.3 Safari/537.36

Can you open the files from outside of RStudio? E.g. does it work if you run

xdg-open  <path-to-pdf-file>

from a terminal?

What do you see if you run

Sys.getenv("R_PDFVIEWER")

from within R?

The pdf file opens with xdg-open from the command line, but gives a bunch of statements like

qt5ct: using qt5ct plugin
Invalid Context= "Apps" line for icon theme: "/usr/share/icons/Mint-Y/apps/16/"
Invalid Context= "Apps" line for icon theme: "/usr/share/icons/Mint-Y/apps/16@2x/"
Invalid Context= "Mimetypes" line for icon theme: "/usr/share/icons/Mint-Y/mimetypes/16/"
Invalid Context= "Mimetypes" line for icon theme: "/usr/share/icons/Mint-Y/mimetypes/16@2x/"
Invalid Context= "Apps" line for icon theme: "/usr/share/icons/Mint-Y/apps/22/"
Invalid Context= "Apps" line for icon theme: "/usr/share/icons/Mint-Y/apps/22@2x/"
Invalid Context= "Apps" line for icon theme: "/usr/share/icons/Mint-Y/apps/24/"
Invalid Context= "Apps" line for icon theme: "/usr/share/icons/Mint-Y/apps/24@2x/"
Invalid Context= "Mimetypes" line for icon theme: "/usr/share/icons/Mint-Y/mimetypes/24/"
Invalid Context= "Mimetypes" line for icon theme: "/usr/share/icons/Mint-Y/mimetypes/24@2x/"
Invalid Context= "Apps" line for icon theme: "/usr/share/icons/Mint-Y/apps/32/"
Invalid Context= "Apps" line for icon theme: "/usr/share/icons/Mint-Y/apps/32@2x/"

As for the second item, Sys.getenv("R_PDFVIEWER") gives "/usr/bin/xdg-open".

... and I get the same results opening a pdf in a standard R package, like optimx.

What is a standard R package? How is yours different? Can you open the help pages of your package? Did you try reinstalling your package? Did you try restarting your machine?
Can you see the link in RStudio that points to the PDF? What does it say?

Sorry, a lot of questions, just shooting blindly in the dark....

By "standard" I meant a major package you can download from CRAN. The fact that I am having the same problem with pdfs in optimx means we don't have to consider anything I may have screwed up in the development and installation of my package. I have 4 Linux Mint machines (two are 21.1 and two are 20.3) and all have the same issue, even after rebooting. I don't have the problem on Windows 10 (i.e., the pdfs load). How would I go about seeing the link for the pdf in RStudio?

I just noticed this today as well. Any PDF vignette I try to view in RStudio produces the same error message: "Access to 127.0.0.1 was denied You don't have authorization to view this page. HTTP ERROR 403"

Currently running RStudio 2022.12.0 Build 353 with R 4.2.2 on Windows 10 .

When I run Sys.getenv("R_PDFVIEWER") I get an empty string ""

Also, I changed my default browser from Chrome to Firefox (I am at the "try random things" stage of problem solving). Firefox does not show the error but gives this address

http://127.0.0.1:24199/help/library/optimx/doc/Extend-optimx.pdf

and simply does not show the pdf. I don't understand why RStudio is going to the browsers rather than the pdf readers. Note that the pdf I am trying to load is located at

/home/thomas/R/x86_64-pc-linux-gnu-library/4.2/optimx/doc

@Gabor , I uninstalled RStudio from Mint 20.3, reinstalled this earlier version

RStudio 2021.09.1+372 "Ghost Orchid" Release (8b9ced188245155642d024aa3630363df611088a, 2021-11-08) for Ubuntu Bionic
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36

and everything works as desired. I uninstalled RStudio from Mint 21.1, installed this verion

RStudio 2022.02.3+492 "Prairie Trillium" Release (1db809b8323ba0a87c148d16eb84efe39a8e7785, 2022-05-20) for Ubuntu Jammy
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36

and again, everything worked. @Gabor, have you been able to reproduce this problem on Linux Mint?

I don't have Linux Mint, but this sounds like an RStudio bug, which you can report in the Issues · rstudio/rstudio · GitHub repo. Do a search in the existing issues first, maybe it was already reported. Thanks!

I am having the same issue with pdf help in any package. I am using RStudio 2022.12.0+353 on Windows 11.

1 Like

I reverted back to a previous version of RStudio, which solved the problem.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.