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

how to use rig behind proxy server #166

Closed
ssh352 opened this issue Jul 18, 2023 · 5 comments
Closed

how to use rig behind proxy server #166

ssh352 opened this issue Jul 18, 2023 · 5 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@ssh352
Copy link

ssh352 commented Jul 18, 2023

how to use rig behind proxy server, wget works without issue. I have https_proxy and http_proxy env variables set.

❯ rig add release
[INFO] Running `sudo` for adding new R versions. This might need your password.
[ERROR] Failed to resolve R version: Cannot download JSON: error sending request for url (https://api.r-hub.io/rversions/resolve/release/linux-ubuntu-20.04/x86_64): error trying to connect: dns error: failed to lookup address information: Try again

❯ wget https://api.r-hub.io/rversions/resolve/release/linux-ubuntu-20.04/x86_64
--2023-07-18 10:11:19--  https://api.r-hub.io/rversions/resolve/release/linux-ubuntu-20.04/x86_64
Connecting to 10.25.27.61:3128... connected.
Proxy request sent, awaiting response... 200 OK
Length: 168 [application/json]
Saving to: ‘x86_64.1’

x86_64.1                                                                100%[=============================================================================================================================================================================>]     168  --.-KB/s    in 0s

2023-07-18 10:11:20 (96.9 MB/s) - ‘x86_64.1’ saved [168/168]

@gaborcsardi
Copy link
Member

rig does use the https_proxy env var for me (Ubuntu Linux):

root@7ee1366b84ee:~# export https_proxy=https://example.com
root@7ee1366b84ee:~# rig resolve release
[ERROR] Failed to resolve R version: Cannot download JSON: error sending request for url (https://api.r-hub.io/rversions/resolve/release/linux-ubuntu-22.04/aarch64): error trying to connect: unsuccessful tunnel
root@7ee1366b84ee:~# unset https_proxy
root@7ee1366b84ee:~# rig resolve release
4.3.1 https://github.com/r-hub/R/releases/download/v4.3.1/r-rstudio-ubuntu-2204-4.3.1_1_arm64.deb

@gaborcsardi
Copy link
Member

Just tried it with a proper squid proxy, on macOS, and that works as well, rig uses the proxy for HTTPS urls. Also, from your error

dns error: failed to lookup address information

hints that this is not an issue with rig, but there is something wrong with name resolution.

I am going to close this now, but if you still think that this is a rig issue, then please reopen with new information. Thanks!

@ssh352
Copy link
Author

ssh352 commented Jul 20, 2023

sudo doesn't have proxy env variables set. Thanks!

@gaborcsardi gaborcsardi reopened this Jul 20, 2023
@gaborcsardi
Copy link
Member

Aha, that makes sense and we should indeed fix it. Thanks for the report!

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Jul 20, 2023
@gaborcsardi
Copy link
Member

This is fixed on GitHub. A workaround until the next rig version is released is to run sudo manually (with passing the env vars) and then running rig as the root user.

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