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

Can't install from bitbucket due to incorrect Host assumption #494

Closed
d-sci opened this issue Jul 27, 2020 · 3 comments
Closed

Can't install from bitbucket due to incorrect Host assumption #494

d-sci opened this issue Jul 27, 2020 · 3 comments

Comments

@d-sci
Copy link

d-sci commented Jul 27, 2020

When snapshotting or discovering a bitbucket package bitbucket::d-sci/exemplrDependency, my renv.lock file was updated like:

"exemplrDependency": {
      "Package": "exemplrDependency",
      "Version": "0.0.0.9000",
      "Source": "Bitbucket",
      "RemoteType": "bitbucket",
      "RemoteHost": "api.bitbucket.org/2.0",
      "RemoteUsername": "d-sci",
      "RemoteRepo": "exemplrDependency",
      "RemoteRef": "master",
      "RemoteSha": "e747b3b9d19befa297f3ca5c818105f2ec7f98ef",
      "Hash": "044ac6dd5fab09509deeb2dc1e0fbfc6"
    }

When subsequently running renv::restore() on a different machine, I get an error because it attempts to download from:
https://api.bitbucket.org/2.0/d-sci/exemplrDependency/get/e747b3b9d19befa297f3ca5c818105f2ec7f98ef.tar.gz
and gets a 404.

To solve this, I had to manually update the RemoteHost to bitbucket.org so that it would (successfully) attempt to download from https://bitbucket.org/d-sci/exemplrDependency/get/e747b3b9d19befa297f3ca5c818105f2ec7f98ef.tar.gz

Indeed, it seems that renv simply can't install bitbucket remotes due to this issue:

> renv::install('bitbucket::d-sci/exemplrDependency')
Retrieving 'https://api.bitbucket.org/2.0/d-sci/exemplrDependency/get/e747b3b9d19befa297f3ca5c818105f2ec7f98ef.tar.gz' ...
Warning messages:
1: curl: (22) The requested URL returned error: 404  
2: curl: (22) The requested URL returned error: 404  

even though remotes::install_bitbucket('d-sci/exemplrDependency') works.

Of note, remotes seems to know to convert to the appropriate URL:

> remotes:::bitbucket_download_url('d-sci', 'exemplrDependency', host = "api.bitbucket.org/2.0")
[1] "https://bitbucket.org/d-sci/exemplrdependency/get/master.tar.gz"

That exemplrDependency is a dummy, public repo so you should be able to recreate all this without any auth.

@kevinushey
Copy link
Collaborator

Thanks for the bug report! It looks like there's an issue in how renv is trying to use the Bitbucket API here.

This should now be fixed up in the development version of renv.

@d-sci
Copy link
Author

d-sci commented Jul 27, 2020

Thanks for the quick fix, and for all your hard work on the package in general -- starting to use it and I'm really loving it!

@kevinushey
Copy link
Collaborator

Thank you! I'm glad to hear it :-)

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

2 participants