Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remotes::system_requirements: Error: JSON: EXPECTED value GOT < #663

Closed
bschilder opened this issue Oct 29, 2021 · 11 comments
Closed

remotes::system_requirements: Error: JSON: EXPECTED value GOT < #663

bschilder opened this issue Oct 29, 2021 · 11 comments

Comments

@bschilder
Copy link

bschilder commented Oct 29, 2021

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
Copy link
Author

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

@jimhester
Copy link
Member

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?

@bschilder
Copy link
Author

bschilder commented Oct 29, 2021

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.

@cicdguy
Copy link

cicdguy commented Dec 2, 2021

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

image

@cicdguy
Copy link

cicdguy commented Dec 2, 2021

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

image

@mpadge
Copy link

mpadge commented Dec 2, 2021

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 😄 👍

@mpadge
Copy link

mpadge commented Dec 2, 2021

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

@mpadge
Copy link

mpadge commented Dec 6, 2021

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:

res <- system2(
curl,
args = c(
"--silent",
"--data-binary",
shQuote(paste0("@", desc_file)),
shQuote(sprintf("%s/sysreqs?distribution=%s&release=%s&suggests=true",
rspm_repo_url,
os,
os_release)
)
),
stdout = TRUE
)
res <- json$parse(res)

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.

@cicdguy
Copy link

cicdguy commented Dec 17, 2021

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.

@gaborcsardi
Copy link
Member

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

@gaborcsardi
Copy link
Member

Hopefully this has been fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants