r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
331 stars 152 forks source link

Failed to install 'unknown package' from Bitbucket #703

Closed harell closed 10 months ago

harell commented 2 years ago

This issue is related to a closed issue mentioned here

@jimhester this is still an open issue on R4.1.3 remotes v2.4.2. Could you please advise?

I'm trying to install a package on a public Bitbucket repo. This gives the following error

install_bitbucket('annalectnz/rianna')
> Error: Failed to install 'unknown package' from Bitbucket:
  cannot open URL 'https://api.bitbucket.org/2.0/repositories/annalectnz/rianna/src/HEAD/DESCRIPTION'

However, when I paste the URL address to Chrome, I can see the DESCRIPTION file content

lancefrench commented 2 years ago

Seems highly likely that this is related to the deprecation of Atlassian account passwords for Basic Authentication with the Bitbucket API or Git over HTTPS that went into effect March 1st. Have you re-tested using an app password?

harell commented 2 years ago

I see. If the repo is public (as is the aforementioned repo), do you still expect this error?

lancefrench commented 2 years ago

Technically, no, I would not expect the change to basic auth to affect cloning of repositories marked publicly accessible. (I should read more carefully!) Seems like the actual function should be passing NULL for basic_auth when downloading.

I might try just issuing a download() or file.download() directly against https://api.bitbucket.org/2.0/repositories/annalectnz/rianna/src/HEAD/DESCRIPTION and seeing if that is successful. Even a straight up curl from the command line would be a good proxy for what is happening under the hood.

harell commented 2 years ago

The following code successfully installs the package:

remotes::install_git("https://api.bitbucket.org/2.0/repositories/annalectnz/rianna")
gaborcsardi commented 10 months ago
install_bitbucket('annalectnz/rianna')

works for me now, but please reopen this issue if you still have problems.