Has anyone else dealt with “FTP_INCORRECT_HOST_KEY...
# suitescript
s
Has anyone else dealt with “FTP_INCORRECT_HOST_KEY” when using sftp.createConnection? I have the exact same host key working in my sandbox environment but is failing in production. This is occurring within my scripts as well as the SFTP Connector SuiteApp.
b
your sftp server probably has different keys
choose a different one to use
s
How would I find that out? Running
ssh-keyscan
always gives the same host key and this EXACT key works in SB but not production
I generated a new SSH key and tried that out just to be safe, but had the same problems (and host key shouldn’t change anyway). It’s happening with two different SFTP servers too: works in SB, doesn’t work in prod
b
use -t to specify types of keys
s
Yeah, sorry I should have mentioned the whole command, but I did specify the key type (rsa). Same situation 😞
b
there are 3 options for that argument
try all of them
s
Yeah, if you don’t define a
-t
you get all of them. Servers only have rsa
ed25519
and
dsa
give nothing
b
ed25519
is not 1 of the 3 options
s
rsa1
my bad, it’s late. Anyways
-4
and
-6
(forcing ipv4 and ipv6) give the same host key. Including
-p 22
to specify the port gives the same. I’m confident the host key is correct because it’s working perfectly in my sandboxes (tried both sandboxes we have), but as soon as I try in production it fails
b
if your server only has one host key, something weird is happening because there is only one correct value
s
Yeah, it’s gotta be a NetSuite thing. I’ve opened a case so fingers crossed they can find something
b
if there are multiple host keys, you should be trying those instead, because production and sandbox may be ignoring different keys
n
If you have saved the Host key in a custom record/custom field, make sure it is not Free-Form Text but Text Area. Also compare the field with your sandbox. Free-Form Text field tends to remove the extra character to limit the string.
This has happened to me.
s
Thing is, I’m getting the exact same behavior using the SFTP Connector SuiteApp. I installed it in both production and sandbox -> Entered all the same values and uploaded the same key file (Setup->Company->Keys)… I even ensured the id was the same
custkey_sftp_key
-> SB1: Pass, SB2: Pass, Production: “FTP_INCORRECT_HOST_KEY”: “”Provided host key does not match remote server’s fingerprint.”