# Netlify deploy fails remote: ERROR: Git access over SSH is not allowed

**URL:** <https://answers.netlify.com/t/netlify-deploy-fails-remote-error-git-access-over-ssh-is-not-allowed/116271>\
**Category:** Support\
**Tags:** git, branch-deploys, building, deployment\
**Created:** [April 10, 2024, 8:27pm UTC](https://answers.netlify.com/t/netlify-deploy-fails-remote-error-git-access-over-ssh-is-not-allowed/116271 "2024-04-10T20:27:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ejdysinger](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/ejdysinger/32/60257_2.png) [@ejdysinger](https://answers.netlify.com/u/ejdysinger)\
**Post date:** [April 10, 2024, 8:27pm UTC](https://answers.netlify.com/t/netlify-deploy-fails-remote-error-git-access-over-ssh-is-not-allowed/116271/1 "2024-04-10T20:27:22Z")

</div>

netlify site name: [https://pncc-scheduling-form.netlify.app/](https://pncc-scheduling-form.netlify.app/)

Experiencing issues building from gitlab repository (NOT self-hosted); I have already followed the recommended troubleshooting instructions found here ( [Build troubleshooting tips | Netlify Docs](https://docs.netlify.com/configure-builds/troubleshooting-tips/#build-fails-with-error-128))  
this is not a new project and for the past year at least we were able to deploy to production and to create deploy previews without any issue. I have already re-linked the gitlab repo, removed any additional generated webhooks in the repo, created new secrets and have more-or-less exhausted any new approaches I could find in the documentation.

deploy log below:  
2:09:19 PM: Build ready to start  
2:09:35 PM: build-image version: fcb0c1b3ada6d25c1cb58e8bc514f5f23cc14f15 (focal)  
2:09:35 PM: buildbot version: aa810d582dc14bf9392c9fc64b0002bffe04d8bd  
2:09:35 PM: Fetching cached dependencies  
2:09:35 PM: Failed to fetch cache, continuing with build  
2:09:35 PM: Starting to prepare the repo for build  
2:09:36 PM: Failed during stage “preparing repo”: For more information, visit [Build troubleshooting tips | Netlify Docs](https://docs.netlify.com/configure-builds/troubleshooting-tips/#build-fails-with-error-128:) Warning: Permanently added “[gitlab.com](http://gitlab.com)” (ECDSA) to the list of known hosts.

remote:  
remote: ========================================================================  
remote:  
remote: ERROR: Git access over SSH is not allowed

remote:  
remote: ========================================================================  
remote:  
fatal: Could not read from remote repository.

Please make sure you have the correct access rights  
and the repository exists.  
: exit status 128  
2:09:36 PM: User git error while checking for ref refs/heads/main  
2:09:36 PM: Failing build: Failed to prepare repo  
2:09:36 PM: Finished processing build request in 1.122s

---

<div class="post-metadata">

**Author:** ![marcus.little](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/marcus.little/32/49084_2.png) [@marcus.little](https://answers.netlify.com/u/marcus.little)\
**Post date:** [April 16, 2024, 7:57pm UTC](https://answers.netlify.com/t/netlify-deploy-fails-remote-error-git-access-over-ssh-is-not-allowed/116271/2 "2024-04-16T19:57:04Z")

</div>

Hey there,

Thanks for reaching out! It sounds like some of the repository permission settings may have changed on the Gitlab end?

You mentioned that you’ve already created new secrets, but I’m wondering if you’ve followed the steps [here](https://answers.netlify.com/t/support-guide-using-an-ssh-key-via-environment-variable-during-build/2457), as they seem to be applicable to the specific error you’re hitting here.

---

<div class="post-metadata">

**Author:** ![ejdysinger](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/ejdysinger/32/60257_2.png) [@ejdysinger](https://answers.netlify.com/u/ejdysinger)\
**Post date:** [August 7, 2024, 8:08pm UTC](https://answers.netlify.com/t/netlify-deploy-fails-remote-error-git-access-over-ssh-is-not-allowed/116271/3 "2024-08-07T20:08:59Z")

</div>

Hi Marcus,  
thanks for getting back to me. I initially believed that changes to the repository permissions would have been the cause, but no changes to repository permissions were made between our last successful deploy and the start of this trouble. I’ve also unlinked and relinked the repo several times, and the gitlab repository reflects the expected outcome of that process: new webhooks created, a new deploy key added to our repository. However, each time I attempt to trigger a new build, either from netlify or gitlab, I’m met with the same error.

I reviewed the documentation you linked; I’m attempting to apply it but am a bit pessimistic that it will wok given the above observation. Is there some way to force netlify to authenticate using HTTPS instead of ssh?

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [August 11, 2024, 4:19pm UTC](https://answers.netlify.com/t/netlify-deploy-fails-remote-error-git-access-over-ssh-is-not-allowed/116271/4 "2024-08-11T16:19:47Z")

</div>

Does creating a new site from the same repo make any difference?

---

<div class="post-metadata">

**Author:** ![ejdysinger](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/ejdysinger/32/60257_2.png) [@ejdysinger](https://answers.netlify.com/u/ejdysinger)\
**Post date:** [August 13, 2024, 10:10pm UTC](https://answers.netlify.com/t/netlify-deploy-fails-remote-error-git-access-over-ssh-is-not-allowed/116271/5 "2024-08-13T22:10:15Z")

</div>

Hi @hrishikesh, I took your advice and created a new project from the same repo. the build failed exactly the same.

---

<div class="post-metadata">

**Author:** ![SamO](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/samo/32/41847_2.png) [@SamO](https://answers.netlify.com/u/SamO)\
**Post date:** [August 19, 2024, 8:46pm UTC](https://answers.netlify.com/t/netlify-deploy-fails-remote-error-git-access-over-ssh-is-not-allowed/116271/6 "2024-08-19T20:46:42Z")

</div>

mind attaching a link to the new failed build log and the site ID? I’ll take a look on the backend.

---

<div class="post-metadata">

**Author:** ![ejdysinger](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/ejdysinger/32/60257_2.png) [@ejdysinger](https://answers.netlify.com/u/ejdysinger)\
**Post date:** [August 21, 2024, 3:28pm UTC](https://answers.netlify.com/t/netlify-deploy-fails-remote-error-git-access-over-ssh-is-not-allowed/116271/7 "2024-08-21T15:28:38Z")

</div>

@SamO for the new test project we created? Here are the details:  
site id: 5c3f73a0-200c-4ac5-9463-8d1dd2d25fe4

> **[Netlify](https://app.netlify.com/sites/pncc-schedule-duplicate-test/deploys/66bbd646b2c61fb85b0d04d0)**
>
> Start building the best web experiences in record time

thank you for investigating.

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [August 25, 2024, 6:43pm UTC](https://answers.netlify.com/t/netlify-deploy-fails-remote-error-git-access-over-ssh-is-not-allowed/116271/9 "2024-08-25T18:43:46Z")

</div>

I’ve asked the devs to take a look.

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [November 2, 2024, 6:40pm UTC](https://answers.netlify.com/t/netlify-deploy-fails-remote-error-git-access-over-ssh-is-not-allowed/116271/10 "2024-11-02T18:40:55Z")

</div>

Sorry for the delay on this one. Is it possible for you to recreate your GitLab SSH keys? The devs believe, the builds might be failing as GitLab’s SSH key might have expired after a year.
