R packages in 'install.R' fail to load - MRAN down?

Hi there,

I have this git repo for an R project:

I am using a combination of ‘runtime.txt’ and ‘install.R’ to set up my configuration. It used to work just fine until a couple of days ago. Now, the binder runs but the packages (e.g., “tidyverse”) specified in ‘install.R’ fail to load. Examining the build logs suggests that the problem occurs because MRAN is down. E.g., the following URL:

https://mran.microsoft.com/snapshot/2020-02-01/src/contrib/

returns the error message “The specified CGI application encountered an error and the server terminated the process.”

I was wondering if anyone else has faced this issue. Are there any workarounds for this?

Thanks!

1 Like

Welcome to the forum!
Unfortunately this is a recurring issue with MRAN :frowning:. You can see some discussion on


but no-one’s yet come up with a good solution.

1 Like

Thanks a lot @manics! Even though there is no good solution to this MRAN issue, it is still useful to learn that this issue isn’t specific to me.

1 Like

We recently added a new way to install R packages and RStudio to repo2docker (the tool doing the image building). It uses conda-forge instead of MRAN. Might be worth trying out while MRAN is unavailable.

An example on how to do this is in https://github.com/betatim/r-conda. The basic pattern is to take the R package name and add a r- to the beginning, then add it to environment.yml.

This should speed up building your repository on mybinder.org because the conda packages don’t need compiling. Right now installing tidyverse from MRAN takes an hour or so because we have to compile lots of things.

Another side benefit could be that the conda package mirror has better uptime than MRAN.

A downside of this approach could be that not all the packages you need are available on conda-forge. For this we need more people using this approach to get some feeling for how good/bad the coverage is.

It would be great if you have a moment to try this out and send feedback/an experience report :slight_smile:

2 Likes

Thanks you @betatim for the suggestion to use conda-forge instead of MRAN. MRAN is back for now. But I will give your suggestion a try and report back my experience.

1 Like

It seems that MRAN is still down. I tried your suggestion and it works.
Now, why MRAN still seems to be an option if it is constantly down, should we just stick to conda-forge?

I tried the conda-forge approach and it works like a charm! Thanks @betatim!

The only (small) issue was that the package dslabs was not found. On CRAN, it appeared on 13 December 2019. So it is a very new package. I had no problems whatsoever with older, stable packages.

Glad to hear that it worked well :slight_smile:

Not every R package is on conda-forge yet. However it should not be super difficult to add a new one and everyone can do it (no special permission needed), even if you aren’t the package author (https://conda-forge.org/#add_recipe).

1 Like