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

install_git() fails to install package from AzureDevOps with command status 128 #621

Closed
mima25 opened this issue Jun 4, 2021 · 3 comments · Fixed by #630
Closed

install_git() fails to install package from AzureDevOps with command status 128 #621

mima25 opened this issue Jun 4, 2021 · 3 comments · Fixed by #630

Comments

@mima25
Copy link

mima25 commented Jun 4, 2021

We´ve been using remotes v2.3 to install internally developed packages that are stored on AzureDevOps. Unable to use the function since the package upgrade with the following error:
remotes::install_git( 'git@ssh.dev.azure.com:v3/dataapi-rclient', git = 'external')
Error: Failed to install 'unknown package' from Git:
Command failed (128)
In addition: Warning message:
In system(full, intern = TRUE, ignore.stderr = quiet) :
running command ''/usr/bin/git' ls-remote git ssh.dev.azure.com:v3/dataapi-rclient 2>/dev/null' had status 128

session info():
R version 4.1.0 (2021-05-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] remotes_2.4.0

@ellisp
Copy link

ellisp commented Jun 7, 2021

I have a similar problem with this code (unfortunately not a reproducible example) for installing from a private GitLab repository, which works under 2.3.0 but does not work under 2.4.0:

uid <- getPass::getPass("Enter your GitLab username (not your email address but the actual GitLab name)", noblank = TRUE)

remotes::install_git(
  url = "https://gitlab.com/nous-group/ip/nous.utils",
  credentials = git2r::cred_user_pass(uid, getPass::getPass("GitLab password:")),
  build_opts = c("--no-resave-data", "--no-manual"),
  dependencies = TRUE,
  upgrade = TRUE
)

The error message is

Error: Failed to install 'unknown package' from Git:
  cannot open URL 'https://gitlab.com/nous-group/ip/nous.utils/raw/ebea3e7b9d02447131fedcc65faa303078abaf43/DESCRIPTION'

The user definitely has access to that location (can point their browser there), but installation fails unless we revert to remotes 2.3.0.

@joel23888
Copy link

I had a similar issue and made a simple function to work around this. I am using ssh so I call it by passing an ssh url and git2r::cred_ssh_key() for credentials. It should work for https but untested. It is very basic, so you may need to add further parameters if you need more options when cloning or installing locally:

install_git_alt=function(url, credentials) { 
  x=tempfile()
  git2r::clone(url, local_path=x, credentials=credentials)
  devtools::install_local(x)
}

@dakep
Copy link

dakep commented Jun 20, 2021

I have a similar issue for any repository with URLs of the form username@host:repo/ref, and #627 references the same issue. The PR #603 seems to have introduced the issue when trying to parse the URL at

meta <- re_match(url, "(?:(?<url>[^@]*))(?:@(?<ref>.*))?")

I have no idea what this RE is trying to accomplish and hence I will refrain from creating a PR to fix the issue. Maybe the author of the PR @niheaven can take a look at it?

@ellisp: I think your particular issue is actually the same as #625 and is already being taken care of, but not related to how the URL is parsed.

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

Successfully merging a pull request may close this issue.

4 participants