SchoofsKelvin / vscode-sshfs

Extension for Visual Studio Code: File system provider using SSH
GNU General Public License v3.0
543 stars 36 forks source link

"Unable to exec" Error while connecting to SSH FS #277

Closed mrowell closed 2 years ago

mrowell commented 2 years ago

Since upgrading to version 1.21.0 we receive an Error while connecting to SSH FS ***hostname***: Unable to exec error and the connections fails.

Reverting to version 1.20.2 and the connection succeeds without issue.

The server is SFTP only (ie no SSH). The client is macOS 10.15.1, VS Code 1.58.2.

I also tried with the -CHECK_HOME flag set as the server does present the User's home directory. I received the same error.

Here are the DEBUG_SSH2 logs:


[INFO]    Loading configurations...
[INFO]    Calculated config flags: {}
[DEBUG]     Added configuration ***hostname*** from 2
[DEBUG]     Added configuration ***hostname2*** from 2
[DEBUG]     Added configuration ***hostname3*** from 2
[DEBUG]     Added configuration ***hostname4*** from 1
[DEBUG]     Added configuration test from 1
[INFO]    Found 5 configurations
[INFO]    Extension activated, version 1.21.0, mode 1
[INFO]    Command received to connect ***hostname***
[INFO]    [createConnection(***hostname***,config)] Creating a new connection for '***hostname***'
[INFO]    Calculating actual config
[DEBUG]     Final configuration:
{
    "name": "***hostname***",
    "label": "***hostname***",
    "host": "***hostname***",
    "port": 2222,
    "username": "***username***",
    "password": "<censored>",
    "flags": [
        "DEBUG_SSH2"
    ],
    "_location": 2,
    "_locations": [
        2
    ],
    "_calculated": {
        "name": "***hostname***",
        "label": "***hostname***",
        "host": "***hostname***",
        "port": 2222,
        "username": "***username***",
        "password": "<censored>",
        "flags": [
            "DEBUG_SSH2"
        ],
        "_location": 2,
        "_locations": [
            2
        ]
    }
}
[INFO]    [createSocket(***hostname***)] Creating socket
[DEBUG]   [createSocket(***hostname***)] Connecting to ***hostname***:2222
[DEBUG]   [ssh2(***hostname***)] DEBUG: Local ident: 'SSH-2.0-ssh2js0.4.10'
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_INIT
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_GREETING
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_HEADER
[DEBUG]   [ssh2(***hostname***)] DEBUG: Remote ident: 'SSH-2.0-mod_sftp'
[DEBUG]   [ssh2(***hostname***)] DEBUG: Outgoing: Writing KEXINIT
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETBEFORE (expecting 8)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKET
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: pktLen:588,padLen:5,remainLen:584
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATA
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAAFTER, packet: KEXINIT
[DEBUG]   [ssh2(***hostname***)] DEBUG: Comparing KEXINITs ...
[DEBUG]   [ssh2(***hostname***)] DEBUG: (local) KEX algorithms: curve25519-sha256@libssh.org,curve25519-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha1
[DEBUG]   [ssh2(***hostname***)] DEBUG: (remote) KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group18-sha512,diffie-hellman-group16-sha512,diffie-hellman-group14-sha256,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,rsa1024-sha1,ext-info-s
[DEBUG]   [ssh2(***hostname***)] DEBUG: KEX algorithm: curve25519-sha256@libssh.org
[DEBUG]   [ssh2(***hostname***)] DEBUG: (local) Host key formats: ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa
[DEBUG]   [ssh2(***hostname***)] DEBUG: (remote) Host key formats: rsa-sha2-512,rsa-sha2-256,ssh-rsa
[DEBUG]   [ssh2(***hostname***)] DEBUG: Host key format: ssh-rsa
[DEBUG]   [ssh2(***hostname***)] DEBUG: (local) Client->Server ciphers: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm,aes128-gcm@openssh.com,aes256-gcm,aes256-gcm@openssh.com
[DEBUG]   [ssh2(***hostname***)] DEBUG: (remote) Client->Server ciphers: aes128-ctr,aes192-ctr,aes256-ctr
[DEBUG]   [ssh2(***hostname***)] DEBUG: Client->Server Cipher: aes128-ctr
[DEBUG]   [ssh2(***hostname***)] DEBUG: (local) Server->Client ciphers: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm,aes128-gcm@openssh.com,aes256-gcm,aes256-gcm@openssh.com
[DEBUG]   [ssh2(***hostname***)] DEBUG: (remote) Server->Client ciphers: aes128-ctr,aes192-ctr,aes256-ctr
[DEBUG]   [ssh2(***hostname***)] DEBUG: Server->Client Cipher: aes128-ctr
[DEBUG]   [ssh2(***hostname***)] DEBUG: (local) Client->Server HMAC algorithms: hmac-sha2-256,hmac-sha2-512,hmac-sha1
[DEBUG]   [ssh2(***hostname***)] DEBUG: (remote) Client->Server HMAC algorithms: hmac-sha2-256,hmac-sha2-512
[DEBUG]   [ssh2(***hostname***)] DEBUG: Client->Server HMAC algorithm: hmac-sha2-256
[DEBUG]   [ssh2(***hostname***)] DEBUG: (local) Server->Client HMAC algorithms: hmac-sha2-256,hmac-sha2-512,hmac-sha1
[DEBUG]   [ssh2(***hostname***)] DEBUG: (remote) Server->Client HMAC algorithms: hmac-sha2-256,hmac-sha2-512
[DEBUG]   [ssh2(***hostname***)] DEBUG: Server->Client HMAC algorithm: hmac-sha2-256
[DEBUG]   [ssh2(***hostname***)] DEBUG: (local) Client->Server compression algorithms: none,zlib@openssh.com,zlib
[DEBUG]   [ssh2(***hostname***)] DEBUG: (remote) Client->Server compression algorithms: zlib@openssh.com,zlib,none
[DEBUG]   [ssh2(***hostname***)] DEBUG: Client->Server compression algorithm: none
[DEBUG]   [ssh2(***hostname***)] DEBUG: (local) Server->Client compression algorithms: none,zlib@openssh.com,zlib
[DEBUG]   [ssh2(***hostname***)] DEBUG: (remote) Server->Client compression algorithms: zlib@openssh.com,zlib,none
[DEBUG]   [ssh2(***hostname***)] DEBUG: Server->Client compression algorithm: none
[DEBUG]   [ssh2(***hostname***)] DEBUG: Outgoing: Writing KEXECDH_INIT
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETBEFORE (expecting 8)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKET
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: pktLen:604,padLen:8,remainLen:600
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATA
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAAFTER, packet: KEXECDH_REPLY
[DEBUG]   [ssh2(***hostname***)] DEBUG: Checking host key format
[DEBUG]   [ssh2(***hostname***)] DEBUG: Checking signature format
[DEBUG]   [ssh2(***hostname***)] DEBUG: Verifying host fingerprint
[DEBUG]   [ssh2(***hostname***)] DEBUG: Host accepted by default (no verification)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Verifying signature
[DEBUG]   [ssh2(***hostname***)] DEBUG: Outgoing: Writing NEWKEYS
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETBEFORE (expecting 8)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKET
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: pktLen:12,padLen:10,remainLen:8
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATA
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAAFTER, packet: NEWKEYS
[DEBUG]   [ssh2(***hostname***)] DEBUG: Outgoing: Writing SERVICE_REQUEST (ssh-userauth)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETBEFORE (expecting 16)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKET
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: Decrypting
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: pktLen:28,padLen:10,remainLen:16
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATA
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: Decrypting
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: HMAC size:32
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAVERIFY
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: Verifying MAC
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAVERIFY (Valid HMAC)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAAFTER, packet: SERVICE_ACCEPT
[DEBUG]   [ssh2(***hostname***)] DEBUG: Outgoing: Writing USERAUTH_REQUEST (none)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETBEFORE (expecting 16)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKET
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: Decrypting
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: pktLen:44,padLen:19,remainLen:32
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATA
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: Decrypting
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: HMAC size:32
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAVERIFY
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: Verifying MAC
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAVERIFY (Valid HMAC)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAAFTER, packet: USERAUTH_FAILURE
[DEBUG]   [ssh2(***hostname***)] DEBUG: Client: none auth failed
[DEBUG]   [ssh2(***hostname***)] DEBUG: Outgoing: Writing USERAUTH_REQUEST (password)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETBEFORE (expecting 16)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKET
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: Decrypting
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: pktLen:12,padLen:10,remainLen:0
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATA
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: HMAC size:32
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAVERIFY
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: Verifying MAC
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAVERIFY (Valid HMAC)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAAFTER, packet: USERAUTH_SUCCESS
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETBEFORE (expecting 16)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Outgoing: Writing CHANNEL_OPEN (0, session)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKET
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: Decrypting
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: pktLen:28,padLen:10,remainLen:16
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATA
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: Decrypting
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: HMAC size:32
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAVERIFY
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: Verifying MAC
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAVERIFY (Valid HMAC)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_OPEN_CONFIRMATION
[DEBUG]   [ssh2(***hostname***)] DEBUG: Outgoing: Writing CHANNEL_REQUEST (0, exec)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETBEFORE (expecting 16)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKET
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: Decrypting
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: pktLen:12,padLen:6,remainLen:0
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATA
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: HMAC size:32
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAVERIFY
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: Verifying MAC
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAVERIFY (Valid HMAC)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_FAILURE (0)
[DEBUG]   [ssh2(***hostname***)] DEBUG: Parser: IN_PACKETBEFORE (expecting 16)
[ERROR]   Error while connecting to SSH FS ***hostname***:
Unable to exec
Logged at:
    at /Users/***username***/.vscode/extensions/kelvin.vscode-sshfs-1.21.0/dist/extension.js:1:34891
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async o.stat (/Users/***username***/.vscode/extensions/kelvin.vscode-sshfs-1.21.0/dist/extension.js:1:26919)
[ERROR]   Unable to exec
JSON: {}
Error: Unable to exec
    at /Users/***username***/.vscode/extensions/kelvin.vscode-sshfs-1.21.0/dist/262.extension.js:1:215955
    at fe.<anonymous> (/Users/***username***/.vscode/extensions/kelvin.vscode-sshfs-1.21.0/dist/262.extension.js:1:186991)
    at fe.emit (events.js:315:20)
    at le (/Users/***username***/.vscode/extensions/kelvin.vscode-sshfs-1.21.0/dist/262.extension.js:1:131928)
    at fe._transform (/Users/***username***/.vscode/extensions/kelvin.vscode-sshfs-1.21.0/dist/262.extension.js:1:154517)
    at fe.Transform._read (internal/streams/transform.js:205:10)
    at fe._read (/Users/***username***/.vscode/extensions/kelvin.vscode-sshfs-1.21.0/dist/262.extension.js:1:148405)
    at fe.Transform._write (internal/streams/transform.js:193:12)
    at writeOrBuffer (internal/streams/writable.js:358:12)
Logged at:
    at /Users/***username***/.vscode/extensions/kelvin.vscode-sshfs-1.21.0/dist/extension.js:1:34958
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async o.stat (/Users/***username***/.vscode/extensions/kelvin.vscode-sshfs-1.21.0/dist/extension.js:1:26919)
[DEBUG]   Reading ssh://***hostname***/.vscode/settings.json
[DEBUG]   Reading ssh://***hostname***/.vscode/tasks.json
[DEBUG]   Reading ssh://***hostname***/.vscode/launch.json
[DEBUG]   Reading ssh://***hostname***/.vscode/settings.json
[DEBUG]   Reading ssh://***hostname***/.vscode/tasks.json
[DEBUG]   Reading ssh://***hostname***/.vscode/launch.json
[DEBUG]   Reading ssh://***hostname***/.vscode/extensions.json
[DEBUG]   Reading ssh://***hostname***/.vscode/extensions.json
[DEBUG]   Reading ssh://***hostname***/.vscode/extensions.json
[DEBUG]   Reading ssh://***hostname***/.vscode/extensions.json
[DEBUG]   Reading ssh://***hostname***/.vscode/extensions.json
[DEBUG]   Reading ssh://***hostname***/.vscode/extensions.json

If I can do any further testing to assist, please don't hesitate to ask. Thanks, Marcus.

SchoofsKelvin commented 2 years ago

While -CHECK_HOME would stop the connection process from failing if the shell command used to find the home directory failed or if the given home directory wasn't an accessible directory, it wouldn't actually account for the creation of the shell failing.

This should now be fixed (c7f1261), which you can test in the latest build here. Might end up creating a release for that today (with or without other commits), but still working on something right now.

mrowell commented 2 years ago

I've tested the build you created and that works without issue.

Thank you so very much for promptly fixing the problem and for such a useful VSCode extension.

SchoofsKelvin commented 2 years ago

It's now released in v1.21.0 of the extension.

If you're not using VS Code but an IDE that uses OpenVSX, you might have to manually update, due to an issue in OpenVSX.