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

Failing to install old package versions on Windows with MitM proxy gives unhelpful error message #1739

Closed
mb706 opened this issue Oct 24, 2023 · 1 comment
Labels
bug an unexpected problem or unintended behavior
Milestone

Comments

@mb706
Copy link

mb706 commented Oct 24, 2023

See #1624

Trying to install an old package on such a system does not give a helpful error message:

renv::install("lintr@2.0.1")
#> # Downloading packages -----------------------------------------------
#> Warning: failed to find binary for 'lintr 2.0.1' in package repositories
#> Warning: failed to find source for 'lintr 2.0.1' in package repositories
#> Error: failed to retrieve package 'lintr@2.0.1'

(The "repos" option is set to "https://packagemanager.posit.co/cran/2023-10-05", if that matters. Unfortunately I don't have Windows with MitM proxy handy any more, so I cant try out a more minimal version of this.)

Tracing this through the debugger ultimately shows that the following fails:

renv:::renv_download_impl(
  url = "https://packagemanager.posit.co/cran/2023-10-05/src/contrib/Archive/lintr/lintr_2.0.1.tar.gz",
  destfile = "test.txt", type = NULL, request = "HEAD", headers = character(0))
#> <simpleWarning: curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - Die Sperrfunktion konnte keine Sperrpr�fung f�r das Zertifikat durchf�hren.>

Running C:\Windows\System32\curl.exe "https://google.com" gives the same error message, so this is ultimately because the system's curl is broken here.

#1624 already solved this problem, and the workaround is already built into renv:

Sys.setenv("R_LIBCURL_SSL_REVOKE_BEST_EFFORT" = "T")

It would be helpful if the error message could inform the user about this option here; I only found this option by going through the source code.

It would be even nicer if downloading source-versions of old packages could work in a more robust way, maybe using a different download method as fallback? Downloading up-to-date packages also seems to work with no issues, after all.

@kevinushey kevinushey added the bug an unexpected problem or unintended behavior label Oct 25, 2023
@kevinushey kevinushey added this to the 1.1.0 milestone Oct 25, 2023
@kevinushey
Copy link
Collaborator

Thanks; we now set this by default here: d88ec6c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants