[COMPASS-2769] If the SSH Identity File is present but empty, Compass does nothing when the CONNECT button is clicked Created: 20/Apr/18  Updated: 29/Oct/23  Resolved: 03/Mar/22

Status: Closed
Project: Compass
Component/s: Connectivity
Affects Version/s: 1.12.6
Fix Version/s: 1.31.0

Type: Bug Priority: Minor - P4
Reporter: Brian Blevins Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File exception_with_empty_id_rsa_file.png    
Issue Links:
Related
related to COMPASS-4069 Update ssh2 dependency Closed
Epic Link: COMPASS-4948
Story Points: 2
Documentation Changes: Not Needed

 Description   

If the Compass user selects SSH tunneling and specifies an identity file with no content, there is no error message displayed when the user clicks the CONNECT button.

$ ls -alt .ssh/id_rsa
-rw------- 1 brian staff 0 Apr 20 10:34 .ssh/id_rsa

There is an error thrown in the DevTools Console:

/Applications/MongoDB Compass.app/Contents/Resources/app.asar/node_modules/ssh2-streams/lib/keyParser.js:42 Uncaught TypeError: Cannot read property 'length' of undefined
    at module.exports (/Applications/MongoDB Compass.app/Contents/Resources/app.asar/node_modules/ssh2-streams/lib/keyParser.js:42:18)
    at Client.connect (/Applications/MongoDB Compass.app/Contents/Resources/app.asar/node_modules/ssh2/lib/client.js:228:23)
    at SSHTunnel.createTunnel (/Applications/MongoDB Compass.app/Contents/Resources/app.asar/node_modules/mongodb-connection-model/lib/ssh-tunnel.js:53:4)
    at /Applications/MongoDB Compass.app/Contents/Resources/app.asar/node_modules/mongodb-connection-model/node_modules/async/dist/async.js:3866:24
    at replenish (/Applications/MongoDB Compass.app/Contents/Resources/app.asar/node_modules/mongodb-connection-model/node_modules/async/dist/async.js:998:17)
    at /Applications/MongoDB Compass.app/Contents/Resources/app.asar/node_modules/mongodb-connection-model/node_modules/async/dist/async.js:1002:9
    at eachOfLimit (/Applications/MongoDB Compass.app/Contents/Resources/app.asar/node_modules/mongodb-connection-model/node_modules/async/dist/async.js:1027:24)
    at _parallel (/Applications/MongoDB Compass.app/Contents/Resources/app.asar/node_modules/mongodb-connection-model/node_modules/async/dist/async.js:3865:5)
    at Object.series (/Applications/MongoDB Compass.app/Contents/Resources/app.asar/node_modules/mongodb-connection-model/node_modules/async/dist/async.js:4721:5)
    at SSHTunnel.listen (/Applications/MongoDB Compass.app/Contents/Resources/app.asar/node_modules/mongodb-connection-model/lib/ssh-tunnel.js:138:9)



 Comments   
Comment by Maurizio Casimirri [ 03/Mar/22 ]

Now it correctly reports: "Cannot parse privateKey: Unsupported key format"

Generated at Wed Feb 07 22:30:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.