remotes icon indicating copy to clipboard operation
remotes copied to clipboard

Failed to install 'unknown package' from Bitbucket

Open harell opened this issue 2 years ago • 4 comments

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

harell avatar Apr 01 '22 23:04 harell

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?

lancefrench avatar Apr 14 '22 22:04 lancefrench

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

harell avatar Apr 14 '22 22:04 harell

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.

lancefrench avatar Apr 14 '22 23:04 lancefrench

The following code successfully installs the package:

remotes::install_git("https://api.bitbucket.org/2.0/repositories/annalectnz/rianna")

harell avatar Apr 14 '22 23:04 harell

install_bitbucket('annalectnz/rianna')

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

gaborcsardi avatar Nov 01 '23 14:11 gaborcsardi