I am struggling with installing a package from a gitlab repository on a windows computer.
I found different hints but still have problems to install my package from gitlab.
First of all, I generated a public and private key with puttygen.exe
The files need to be changed afterwards, I had to remove comments and stuff so they look like my the file on my unix system. So now, both public and private key files have just a single line.
I tried to install my package via devtools::install_git
which takes very long and I get the error message
Error: Failed to install 'unknown package' from Git:
Error in 'git2r_remote_ls': Failed to authenticate SSH session: Unable to send userauth-publickey request
And with devtools::install_gitlab
I get a different error message and I somehow have the feeling, the link which gets generated doesn't fit to my gitlab server.
Error: Failed to install 'unknown package' from GitLab:
cannot open URL 'https://gitlab.rlp.net/api/v4/projects/madejung%2FMQqueue.git/repository/files/DESCRIPTION/raw?ref=master'
My complete code to test at the moment is
creds <- git2r::cred_ssh_key(publickey="~/.ssh/id_rsa_gitlab.pub",
privatekey="~/.ssh/id_rsa_gitlab")
devtools::install_git(
url='git@gitlab.rlp.net:madejung/MQqueue.git',
quiet=FALSE,
credentials=creds)
devtools::install_gitlab(
repo='madejung/MQqueue.git',
host='gitlab.rlp.net',
quiet=FALSE,
credentials=creds
)
My id_rsa_gitlab.pub
file looks like this and is just a single line
ssh-rsa AAAA....fiwbw== rsa-key-20200121
The id_rsa_gitlab
file has just the code
AAABA.....3WNSIAGE=
UPDATE
On my Mac system it works as expected after installing the libssh2
library via homebrew
and and recompiling git2r
with install.packages("git2r", type = "source")
.
So the working code on my machine is
creds <- git2r::cred_ssh_key(publickey="~/.ssh/id_rsa_gitlab.rlp.net.pub",
privatekey="~/.ssh/id_rsa_gitlab.rlp.net")
devtools::install_git(
url='git@gitlab.rlp.net:madejung/MQqueue.git',
quiet=FALSE,
credentials=creds
)
For some strange reason, the devtools::install_git
call needs about a minute to fail in the end. I have no idea where the problem here is.