Problems in cloning gitlab repository

Hi all,
I’m trying buildkite to add ci/cd to mine simple java test project.

I created a pipeline and added the integration to gitlab, it seems to work properly. When I push a commit in my gitlab repo, buildkite is triggered an the pipeline runs…

But I obtain a gitlab clone error :
git@gitlab.com: Permission denied (publickey).

See the logs :
###################

Added host “gitlab.com” to known hosts at “/home/ec2-user/.ssh/known_hosts”

$ git clone -v – git@gitlab.com:xxx/yyy.git .
Cloning into ‘.’…
git@gitlab.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
:warning: Warning: Checkout failed! cloning git repository: exit status 128 (Attempt 1/3 Retrying in 2s)
###################

Where can i provide username/password? How can I configure the connection buildkite/gitlab properly?

Thank you for your attention!

Best regards.

Hello, @sergiobelli81! Welcome to the Buildkite Community!

It looks like the issue you’re experiencing is due to the Buildkite agent not seeing the GitLab’s SSH key.

To set your SSH keys, follow the instructions in the docs - Buildkite Agent SSH keys v3 | Buildkite Documentation.

Best!
Karen

Hi Karen, solved following your instructions, thank you!

1 Like