SSH key error ... sometimes

These two things are inconsistent:

balena ssh dd641d8fd65c20db1b11ff990c762218
=============================================================
    Welcome to balenaOS
=============================================================
root@gopigo3:~#

but, the same device and app:

~/m/Balena-ROS-Melodic (gopigo3=) balena ssh gopigo3.local
root@gopigo3.local: Permission denied (publickey).
Warning: ssh process exited with non-zero code "255"

Are the SSH keys correctly configured in balenaCloud? See:
https://www.balena.io/docs/learn/manage/ssh-access/#add-an-ssh-key-to-balenacloud

~/m/Balena-ROS-Melodic (gopigo3=)

and the same happens if I give a specific IP address.

Can you help me understand please?

Hi,
Can you clarify the version of the balena cli & the version & variant of balenaOS that you are using?
Please note that using an ip or a .local address is only supported for the development variants of balenaOS or production versions were you have added your ssh keys during the provisioning process.
Let me also point you to our docs for this:

Kind regards,
Thodoris