Can't clone remote repository

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.

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!

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:

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

try changing that to:

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

and see if you get any further.

1 Like

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!

What env vars did you have to edit?

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.

Work for me on NodeRed v1.0.3

Thanks.

Hi @knolleary!

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

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.

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

Yes that is the right path - node-red/index.js at 32999ffa84e96f5f72a11714055ec3e716af052a · node-red/node-red · GitHub

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

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 with the fix. It'll get into the next maintenance release - although none is currently planned in the short term.

Great, thank you!