# Can't clone remote repository

**URL:** https://discourse.nodered.org/t/cant-clone-remote-repository/9957
**Category:** General
**Created:** [9 April 2019 17:08 UTC](https://discourse.nodered.org/t/cant-clone-remote-repository/9957 "2019-04-09T17:08:48Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![juan\_appspring](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@juan\_appspring](https://discourse.nodered.org/u/juan_appspring)
#### Post date: [9 April 2019 17:08 UTC](https://discourse.nodered.org/t/cant-clone-remote-repository/9957/1 "2019-04-09T17:08:48Z")

</div>

Hi guys,

I've been trying to clone a remote repository but I keep getting error "Authentication failed". I've doublechecked SSH keys and many other things but everything seems correct.

When I open the Event log I see the attached message.

 ![node-red-log](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b42955c0a7dfbf5cbe71ceea42e983379f1cf3da.png)

I'm under the impression that this is an error due to a space in my OS username ("Jusn sebastian").

Any way to fix this?

Thanks in advance!

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [9 April 2019 20:00 UTC](https://discourse.nodered.org/t/cant-clone-remote-repository/9957/2 "2019-04-09T20:00:30Z")

</div>

Hi @juan_appspring - this is a bug we''ll have to fix in the core of Node-RED.

You may be able to patch it locally - although this is untested as I'm on vacation and don't have a Windows machine to hand. If you can find the file `node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/git/index.js`, then look at line 107:

```auto
commandEnv.GIT_SSH_COMMAND = "ssh -i " + auth.key_path + " -F /dev/null";

```

try changing that to:

```auto
commandEnv.GIT_SSH_COMMAND = "ssh -i \"" + auth.key_path + "\" -F /dev/null";

```

and see if you get any further.

---

<div class="post-metadata">

### Author: ![juan\_appspring](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@juan\_appspring](https://discourse.nodered.org/u/juan_appspring)
#### Post date: [9 April 2019 20:40 UTC](https://discourse.nodered.org/t/cant-clone-remote-repository/9957/3 "2019-04-09T20:40:34Z")

</div>

Hi knolleary,

Thanks for your quick response.

I already fixed the issue by changing the folder name of my OS user. Had to edit the environment vars too.

Re-installed node-red and then was able to succesfully clone the remote repository.

Thank you!

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [9 April 2019 21:37 UTC](https://discourse.nodered.org/t/cant-clone-remote-repository/9957/4 "2019-04-09T21:37:05Z")

</div>

> [@juan\_appspring](#):
>
> Had to edit the environment vars too.

What env vars did you have to edit?

---

<div class="post-metadata">

### Author: ![juan\_appspring](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@juan\_appspring](https://discourse.nodered.org/u/juan_appspring)
#### Post date: [9 April 2019 21:52 UTC](https://discourse.nodered.org/t/cant-clone-remote-repository/9957/5 "2019-04-09T21:52:42Z")

</div>

I bassically updated all of those that had my previous username with space.

Before this I was installing node-red but nothing was happening, type "node-red" and cmd couldn't recognize it.

---

<div class="post-metadata">

### Author: ![cooperHN](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cooperhn/32/16563_2.png) [@cooperHN](https://discourse.nodered.org/u/cooperHN)
#### Post date: [28 January 2020 22:13 UTC](https://discourse.nodered.org/t/cant-clone-remote-repository/9957/6 "2020-01-28T22:13:45Z")

</div>

Work for me on NodeRed v1.0.3

Thanks.

---

<div class="post-metadata">

### Author: ![hugo-maciel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hugo-maciel/32/68650_2.png) [@hugo-maciel](https://discourse.nodered.org/u/hugo-maciel)
#### Post date: [4 October 2022 13:55 UTC](https://discourse.nodered.org/t/cant-clone-remote-repository/9957/7 "2022-10-04T13:55:55Z")

</div>

Hi @knolleary!

Was the bug fixed? I'm using version 2.2.2 and I stepped into the same problem and could fix it.

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [4 October 2022 14:09 UTC](https://discourse.nodered.org/t/cant-clone-remote-repository/9957/8 "2022-10-04T14:09:32Z")

</div>

Looking at the code, it doesn't not appear to have been done. I don't think an issue was raised, so it got forgotten about.

---

<div class="post-metadata">

### Author: ![hugo-maciel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hugo-maciel/32/68650_2.png) [@hugo-maciel](https://discourse.nodered.org/u/hugo-maciel)
#### Post date: [4 October 2022 14:36 UTC](https://discourse.nodered.org/t/cant-clone-remote-repository/9957/9 "2022-10-04T14:36:43Z")

</div>

OK, Thank you so far, by the way is it the right file path i didn't find it `node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/git/index.js`

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [4 October 2022 14:41 UTC](https://discourse.nodered.org/t/cant-clone-remote-repository/9957/10 "2022-10-04T14:41:44Z")

</div>

Yes that is the right path - [node-red/index.js at 32999ffa84e96f5f72a11714055ec3e716af052a · node-red/node-red · GitHub](https://github.com/node-red/node-red/blob/32999ffa84e96f5f72a11714055ec3e716af052a/packages/node_modules/%40node-red/runtime/lib/storage/localfilesystem/projects/git/index.js#L109)

Where _exactly_ that may be in your local install is another matter...

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [4 October 2022 14:46 UTC](https://discourse.nodered.org/t/cant-clone-remote-repository/9957/11 "2022-10-04T14:46:14Z")

</div>

I have raised [Ensure key\_path is quoted in GIT\_SSH\_COMMAND in case of spaces in pathname by knolleary · Pull Request #3912 · node-red/node-red · GitHub](https://github.com/node-red/node-red/pull/3912) with the fix. It'll get into the next maintenance release - although none is currently planned in the short term.

---

<div class="post-metadata">

### Author: ![hugo-maciel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hugo-maciel/32/68650_2.png) [@hugo-maciel](https://discourse.nodered.org/u/hugo-maciel)
#### Post date: [4 October 2022 15:00 UTC](https://discourse.nodered.org/t/cant-clone-remote-repository/9957/12 "2022-10-04T15:00:12Z")

</div>

Great, thank you!
