# Problems in cloning gitlab repository

**URL:** <https://forum.buildkite.community/t/problems-in-cloning-gitlab-repository/3681>\
**Category:** General\
**Created:** [April 30, 2024, 2:24pm UTC](https://forum.buildkite.community/t/problems-in-cloning-gitlab-repository/3681 "2024-04-30T14:24:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sergiobelli81](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@sergiobelli81](https://forum.buildkite.community/u/sergiobelli81)\
**Post date:** [April 30, 2024, 2:24pm UTC](https://forum.buildkite.community/t/problems-in-cloning-gitlab-repository/3681/1 "2024-04-30T14:24:29Z")

</div>

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](mailto:git@gitlab.com): Permission denied (publickey).

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

# Added host “[gitlab.com](http://gitlab.com)” to known hosts at “/home/ec2-user/.ssh/known\_hosts”

$ git clone -v – [git@gitlab.com](mailto:git@gitlab.com):xxx/yyy.git .  
Cloning into ‘.’…  
[git@gitlab.com](mailto: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: 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.

---

<div class="post-metadata">

**Author:** ![karen.sawrey](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/karen.sawrey/32/1188_2.png) [@karen.sawrey](https://forum.buildkite.community/u/karen.sawrey)\
**Post date:** [April 30, 2024, 3:07pm UTC](https://forum.buildkite.community/t/problems-in-cloning-gitlab-repository/3681/2 "2024-04-30T15:07:49Z")

</div>

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](https://buildkite.com/docs/agent/v3/ssh-keys).

Best!  
Karen

---

<div class="post-metadata">

**Author:** ![sergiobelli81](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@sergiobelli81](https://forum.buildkite.community/u/sergiobelli81)\
**Post date:** [April 30, 2024, 4:30pm UTC](https://forum.buildkite.community/t/problems-in-cloning-gitlab-repository/3681/3 "2024-04-30T16:30:12Z")

</div>

Hi Karen, solved following your instructions, thank you!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/system/32/1321_2.png) [@system](https://forum.buildkite.community/u/system)\
**Post date:** [May 31, 2024, 2:31am UTC](https://forum.buildkite.community/t/problems-in-cloning-gitlab-repository/3681/4 "2024-05-31T02:31:06Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
