remotes
remotes copied to clipboard
`remotes::system_requirements`: ` Error: JSON: EXPECTED value GOT < `
Running:
remotes::system_requirements("ubuntu", "20.04")
produces the following error as of today:
Error: JSON: EXPECTED value GOT <
Expected output
Character vector of Ubuntu system requirements.
Recurring issue
#494 #324
Many thanks, Brian
If this is not something that can easily be resolved, perhaps a more descriptive error message could be produced in the meantime?
I can't reproduce this, and this error simply occurs when the endpoint returns HTML or XML instead of JSON, likely due to an error page. What package you were you trying to retrieve the system requirements for?
I can't reproduce this, and this error simply occurs when the endpoint returns HTML or XML instead of JSON, likely due to an error page.
I think that's the crux of the issue, it happens seemingly at random.
Some things that might help:
- When the function encounters this error, have it rerun another N times to see if succeeds.
- Provide an error message indicating it was a problem with the endpoint (eg perhaps due to connection issues? issues with the server it's querying?) as opposed to the user misusing the function. This will help the user to narrow down the potential source of the error right away.
What package you were you trying to retrieve the system requirements for?
In this particular case, I'm using this function to install the necessary Linux deps to build and test my R packages (in this case orthogene
). You can see an example here:
https://github.com/neurogenomics/orthogene/runs/4049835231?check_suite_focus=true
You can see the full GH Actions workflow here: https://github.com/neurogenomics/orthogene/blob/93a674140c10bb15cdde20b5d4c42d75f91f0556/.github/workflows/check-bioc-docker.yml#L133
However, several hours ago, this error was also occurring when I ran the function by itself within my local Rstudio (MacOS), so it seems pretty independent of the pipeline.
This issue has also currently disabled rOpenSci's review bot, which is unable to check packages. Can reproduce by running call in a clean rocker/tidyverse
container. A prompt fix would be very much appreciated :smile: :+1:
Hmm, all seems okay again now. It is clearly intermittent as @dinakar29 suggested, but during times of failure it does seem entirely reproducible.
The start of this failure arises because the rspm API delivers a "504 Bad Gateway". The following code is where the failure is triggered in our case, because it presumes the curl
call to be failsafe:
https://github.com/r-lib/remotes/blob/fcad17b68b7a19d5363d64adfb0a0426a3a5b3db/R/system_requirements.R#L71-L85
That suggests that fixing this issue just needs an error handler around that to generate a more informative error message for anything other than a 200 status before passing to json$parse
.
Caught this in action, again:
At least the status page reports the outage this time:
Hopefully RStudio has any plans to improve stability/resiliency/HA for public-facing RSPM, as the demand for it grows over time.
We have plans both to improve the performance, and also to have better fallback, but both will take a couple of weeks unfortunately.
Hopefully this has been fixed now.