Closed jjalexander closed 5 years ago
Can anyone help me?
@jjalexander Here marge is trying to clone the repository using git over ssh and the remote ssh server is rejecting the keypair. The options I see here are:
git clone
yourself using the private key you are giving to marge.
Config file:
gitlab-url: "https://gitlab.com/" project-regexp: "jjalexander/revert-test" auth-token: "SECRET" ssh-key-file: /configuration/centos7
Docker command:
docker run -d --name marge --restart=on-failure -v ~/code/marge:/configuration smarkets/marge-bot --config-file=/configuration/marge-bot-config.yaml
git clone git@gitlab.com:jjalexander/revert-test.git
works but asks for the passphrase.
It sounds like maybe you have not uploaded this SSH key to the GitLab user that performs the merges? Or maybe the token doesn't have the right privileges?
Access token:
marge | May 28, 2019 | In 7 months | api, read_user
In the SSH Keys, it says the key was used ten minutes ago. That means when I did git clone
by hand.
What happens if you both the key and the token in the config rather than a separate file?
You mean using ssh-key:
instead of ssh-key-file
?
If yes, I have just tried and the same error message pops up.
OK, but if git clone
is asking for the passphrase on the CLI, then the ssh
key is not quite right somewhere, so the place to start is probably to ensure that the SSH key is correct on GitLab and that you have added the marge-bot
gitlab user to the project with maintainer rights.
BTW is your project owned by a group? If so, is it a subgroup of a larger group?
It's my private project, in which I am the maintainer and use my own user as marge-bot
.
OK, so once you can clone on the command line without entering a passphrase, your bot should be OK, I would guess.
If I use docker exec
on that container, how can I see what ssh-keys are in use by marge?
@snim2 thanks. I created a new ssh-key pair without a passphrase. It now works. Thanks again for the help.
Quick question: can the merged branches not be deleted?
@jjalexander at the moment it will always delete the source branch, but it shouldn't be hard to add an option to make this optional if you want to give it a go. The relevant line is in marge/single_merge_job.py
:
merge_request.accept(remove_branch=True, sha=actual_sha)
Thanks again for all the help.
Hi, I am getting this error.
The repo is on gitlab.com. I have created an access token. I have generated a ssh key pair and added the public key to my gitlab account and the private key file is in the config file.
I have run marge both as a docker container and as a local python application.
Still no luck in getting marge to work.
I know this might not be an issue, rather an error on my part. I was told to create an issue here by Daniel Gorin.