remotes icon indicating copy to clipboard operation
remotes copied to clipboard

`remotes::system_requirements`: ` Error: JSON: EXPECTED value GOT < `

Open bschilder opened this issue 3 years ago • 10 comments

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

bschilder avatar Oct 29 '21 14:10 bschilder

If this is not something that can easily be resolved, perhaps a more descriptive error message could be produced in the meantime?

bschilder avatar Oct 29 '21 15:10 bschilder

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?

jimhester avatar Oct 29 '21 18:10 jimhester

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:

  1. When the function encounters this error, have it rerun another N times to see if succeeds.
  2. 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.

bschilder avatar Oct 29 '21 20:10 bschilder

I think this issue occurs due to public RSPM being unavailable at random times, as it is now.

image

cicdguy avatar Dec 02 '21 13:12 cicdguy

The status page says RSPM is operational though... Must be a bug in the way statuses are monitored.

image

cicdguy avatar Dec 02 '21 13:12 cicdguy

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:

mpadge avatar Dec 02 '21 14:12 mpadge

Hmm, all seems okay again now. It is clearly intermittent as @dinakar29 suggested, but during times of failure it does seem entirely reproducible.

mpadge avatar Dec 02 '21 15:12 mpadge

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.

mpadge avatar Dec 06 '21 17:12 mpadge

Caught this in action, again: image

At least the status page reports the outage this time: image

Hopefully RStudio has any plans to improve stability/resiliency/HA for public-facing RSPM, as the demand for it grows over time.

cicdguy avatar Dec 17 '21 15:12 cicdguy

We have plans both to improve the performance, and also to have better fallback, but both will take a couple of weeks unfortunately.

gaborcsardi avatar Dec 17 '21 15:12 gaborcsardi

Hopefully this has been fixed now.

gaborcsardi avatar Nov 01 '23 14:11 gaborcsardi