Can't get my Node-Red to connect to Balena

Hi,

I’m trying to connect my node red project to my balena cloud application. I’ve added the link for the remote repo to my Node-Red and have created an SSH Key in the Node-red and put it in my balena preferences. However, it still will not let me push to balena.

It is saying “none of the supplied SSH keys matched a known key for user {my_username}”.

I have definitely created an SSH key and added it to my balena.

Can anyone help?

It sounds like you created the ssh key on the device? The SSH key that the server matches against is your local one. Similar to how github authenticates you when you push a repo there…

Yeah, I created the SSH key on the Node Red editor:

What are you using to push to balenaCloud?

It is a raspberry Pi 4B running node red.

This is the first time I hear about Node Red so forgive me if I don’t understand how things work there… but usually you run balena push via the command line to deploy to balenaCloud. The user running this command should have a SSH key set up locally (the default public key can be found at ~/.ssh/id_rsa.pub or similar…) and this key is the one that balenaCloud requires to be registered with your account.

Hi Robert, Node-RED is a programming tool that is object-oriented and has a Projects feature which basically creates a local git repo on the development device to allow version control etc as you are developing. It also has the option to create SSH keys, and link to remote Github/Balena Repos. This is where the problem lies, as I cannot get my development pi to successfully push its local git repo (Node-red project) to balena.

I am following the tutorial here but obviously it has changed from resion to balena. I can’t get this tutorial to work, even if I substitute out the ‘resin’ parts for ‘balena’.

I hope this gives more of an insight into what I’m trying to do and how I’m trying to do it.

Hi, I’m not sure about the guide you linked as it looks a bit outdated, but you can have a look at our balena-node-red project to experiment with or take inspiration from it.

Hi @thundron, thanks for the link you sent. Unfortunately I think this is to allow me to set up the node-red so that I can access it on the remote devices through the balena public URL. This isn’t something I’m looking to do for security reasons (I would rather just disable the admin APIs on the remote devices)- I’m just wanting to connect my development device to balena so I can git push from it.

I can’t get my device to git push from it to balena. It just gives me errors. Any suggestions for this?

Hi,

As we had an incident last week, the git service was unavailable for a while due to cloud provider hardware failure (https://status.balena.io/incidents/743kbmcg22w3) and it was resolved so git push should work by now. Can you please try again and let us know if the issue still persists?

hi @nghiant2710 I have been trying this morning but I am recieving this error:

image

Any ideas what could be causing this? I created my SSH key through the Node Red projects section, and have put this into my balena preferences.

Did you add the SSH key to the ssh-agent on your machine? You can follow this guide to do https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent

I think this was the issue, I followed the tutorial you sent and it seems to be working from the command line now! Next step is to try adding the Node-Red generated key to the ssh-agent and see if that allows it to work through node-red.

Thanks.

That is great to know @gregorr1, anything let us know! :slight_smile:
Cheers