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

Path /mnt/somevolume/somefolder in SSH FS 'myfs' is not a directory #219

Closed yonz2 closed 3 years ago

yonz2 commented 3 years ago

Hi,

I am trying to connect a folder on a hosted website to as VS-Code a VS-Code SSH Workspace. (Note: "Open a Remote SSH Terminal" works fine, so the connection is Ok)

Root: ~/myfolder

Message: Path '/mnt/web315/a3/87/51482087/htdocs/myfolder' in SSH FS 'myfs' is not a directory (I now click "Okay" - on the error dialog from VSCode) Now I get a second message: "Error while connecting to SSH FS myfs: undefined".

(Webspace is hosted at Strato.de, running on a SunOS Server (SunOS localhost 5.10 Generic_150401-49 i86pc) so the storage is most likely some kind of network based storage. Implying that at least a part of the path (/mnt/web315/a3/87/51482087/htdocs/myfolder) could be a link of some sort.

An idea how to resolve my issue?

Best regards Yonz

gpion commented 3 years ago

Same error here, whichever root directory I use, even with "/tmp"

SchoofsKelvin commented 3 years ago

Can you post the SSH FS log? It is available under Output > SSH FS. While it should censor passwords/passphrases, I recommend checking it for (other) sensitive data first.

Does the user you authenticate with have file access? Your server also doesn't have some weird SFTP/SSH restrictions set up?

gpion commented 3 years ago

It is available under Output > SSH FS

Where is that "output" menu?

gpion commented 3 years ago

Ok, found it, heres the complete contents of the output:sshfs buffer

[INFO]    Created output channel for vscode-sshfs
[INFO]    When posting your logs somewhere, keep the following in mind:
  - While the logging tries to censor your passwords/passphrases/..., double check!
    Maybe you also want to censor out e.g. the hostname/IP you're connecting to.
  - If you want to report an issue regarding authentication or something else that
    seems to be more of an issue with the actual SSH2 connection, it might be handy
    to reconnect with this added to your User Settings (settings.json) first:
      "sshfs.flags": [ "DEBUG_SSH2" ],
    This will (for new connections) also enable internal SSH2 logging.

[INFO]    Loading configurations...
[INFO]    Calculated config flags: {"df-ge":[false,"Built-in Default"]}
[DEBUG]     Added configuration fserv from 1
[INFO]    Found 1 configurations
[INFO]    Extension activated, version 1.20.2, mode 1
gpion commented 3 years ago

Stay tuned more is coming

gpion commented 3 years ago

Here we go: (anonymised user and hostname)

[INFO]    Created output channel for vscode-sshfs
[INFO]    When posting your logs somewhere, keep the following in mind:
  - While the logging tries to censor your passwords/passphrases/..., double check!
    Maybe you also want to censor out e.g. the hostname/IP you're connecting to.
  - If you want to report an issue regarding authentication or something else that
    seems to be more of an issue with the actual SSH2 connection, it might be handy
    to reconnect with this added to your User Settings (settings.json) first:
      "sshfs.flags": [ "DEBUG_SSH2" ],
    This will (for new connections) also enable internal SSH2 logging.

[INFO]    Loading configurations...
[INFO]    Calculated config flags: {"df-ge":[false,"Built-in Default"]}
[DEBUG]     Added configuration ***remotehost*** from 1
[INFO]    Found 1 configurations
[INFO]    Extension activated, version 1.20.2, mode 1
[INFO]    Command received to connect ***remotehost***
[INFO]    [createConnection(***remotehost***,config)] Creating a new connection for '***remotehost***'
[INFO]    Calculating actual config
[DEBUG]     Final configuration:
{
    "name": "***remotehost***",
    "host": "***remotehost***",
    "username": "**USERNAME**",
    "agentForward": true,
    "agent": "//./pipe/openssh-ssh-agent",
    "root": "/var/services/homes/**USERNAME**",
    "_location": 1,
    "_locations": [
        1
    ],
    "_calculated": {
        "name": "***remotehost***",
        "host": "***remotehost***",
        "username": "**USERNAME**",
        "agentForward": true,
        "agent": "//./pipe/openssh-ssh-agent",
        "root": "/var/services/homes/**USERNAME**",
        "_location": 1,
        "_locations": [
            1
        ]
    }
}
[INFO]    [createSocket(***remotehost***)] Creating socket
[DEBUG]   [createSocket(***remotehost***)] Connecting to ***remotehost***:22
[INFO]    [getSFTP(***remotehost***)] Creating SFTP session using standard sftp subsystem
[INFO]    [SSHFileSystem(/var/services/homes/**USERNAME**)] SSHFileSystem created
[INFO]    Created SSHFileSystem for ***remotehost***, reading root directory...
[ERROR]   Error handling uri: ssh://***remotehost***/
[ERROR]   No such file
JSON: {"code":2,"lang":""}
Error: No such file
    at k._transform (c:\Users\**USERNAME**\.vscode\extensions\kelvin.vscode-sshfs-1.20.2\dist\262.extension.js:1:82627)
    at k.Transform._read (internal/streams/transform.js:205:10)
    at k._read (c:\Users\**USERNAME**\.vscode\extensions\kelvin.vscode-sshfs-1.20.2\dist\262.extension.js:1:78632)
Logged at:
    at c:\Users\**USERNAME**\.vscode\extensions\kelvin.vscode-sshfs-1.20.2\dist\398.extension.js:1:1436
[DEBUG]   Error converted to: EntryNotFound (FileSystemError): ssh://***remotehost***/
[ERROR]   ssh://***remotehost***/
JSON: {"code":"FileNotFound","name":"EntryNotFound (FileSystemError)"}
EntryNotFound (FileSystemError): ssh://***remotehost***/
    at a.handleError (c:\Users\**USERNAME**\.vscode\extensions\kelvin.vscode-sshfs-1.20.2\dist\398.extension.js:1:4598)
    at c:\Users\**USERNAME**\.vscode\extensions\kelvin.vscode-sshfs-1.20.2\dist\398.extension.js:1:1436
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async a.stat (c:\Users\**USERNAME**\.vscode\extensions\kelvin.vscode-sshfs-1.20.2\dist\398.extension.js:1:1348)
    at async c:\Users\**USERNAME**\.vscode\extensions\kelvin.vscode-sshfs-1.20.2\dist\extension.js:1:31043
Logged at:
    at c:\Users\**USERNAME**\.vscode\extensions\kelvin.vscode-sshfs-1.20.2\dist\extension.js:1:31329
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
[INFO]    Command received to disconnect ***remotehost***
[INFO]    Closing connection to '***remotehost***' with  no reason given
[INFO]    [createConnection(***remotehost***,config)] Creating a new connection for '***remotehost***'
[INFO]    Calculating actual config
[DEBUG]     Final configuration:
{
    "name": "***remotehost***",
    "host": "***remotehost***",
    "username": "**USERNAME**",
    "agentForward": true,
    "agent": "//./pipe/openssh-ssh-agent",
    "root": "/var/services/homes/**USERNAME**",
    "_location": 1,
    "_locations": [
        1
    ],
    "_calculated": {
        "name": "***remotehost***",
        "host": "***remotehost***",
        "username": "**USERNAME**",
        "agentForward": true,
        "agent": "//./pipe/openssh-ssh-agent",
        "root": "/var/services/homes/**USERNAME**",
        "_location": 1,
        "_locations": [
            1
        ]
    }
}
[INFO]    [createSocket(***remotehost***)] Creating socket
[DEBUG]   [createSocket(***remotehost***)] Connecting to ***remotehost***:22
[INFO]    [getSFTP(***remotehost***)] Creating SFTP session using standard sftp subsystem
[INFO]    [SSHFileSystem(/var/services/homes/**USERNAME**)] SSHFileSystem created
[INFO]    Created SSHFileSystem for ***remotehost***, reading root directory...
[ERROR]   Error handling uri: ssh://***remotehost***/
[ERROR]   No such file
JSON: {"code":2,"lang":""}
Error: No such file
    at k._transform (c:\Users\**USERNAME**\.vscode\extensions\kelvin.vscode-sshfs-1.20.2\dist\262.extension.js:1:82627)
    at k.Transform._read (internal/streams/transform.js:205:10)
    at k._read (c:\Users\**USERNAME**\.vscode\extensions\kelvin.vscode-sshfs-1.20.2\dist\262.extension.js:1:78632)
Logged at:
    at c:\Users\**USERNAME**\.vscode\extensions\kelvin.vscode-sshfs-1.20.2\dist\398.extension.js:1:1436
[DEBUG]   Error converted to: EntryNotFound (FileSystemError): ssh://***remotehost***/
[ERROR]   ssh://***remotehost***/
JSON: {"code":"FileNotFound","name":"EntryNotFound (FileSystemError)"}
EntryNotFound (FileSystemError): ssh://***remotehost***/
    at a.handleError (c:\Users\**USERNAME**\.vscode\extensions\kelvin.vscode-sshfs-1.20.2\dist\398.extension.js:1:4598)
    at c:\Users\**USERNAME**\.vscode\extensions\kelvin.vscode-sshfs-1.20.2\dist\398.extension.js:1:1436
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async a.stat (c:\Users\**USERNAME**\.vscode\extensions\kelvin.vscode-sshfs-1.20.2\dist\398.extension.js:1:1348)
    at async c:\Users\**USERNAME**\.vscode\extensions\kelvin.vscode-sshfs-1.20.2\dist\extension.js:1:31043
Logged at:
    at c:\Users\**USERNAME**\.vscode\extensions\kelvin.vscode-sshfs-1.20.2\dist\extension.js:1:31329
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
gpion commented 3 years ago

Ok, found explanation, sftp server on the target device use fake paths!

gpion commented 3 years ago

Fixed,

SchoofsKelvin commented 3 years ago

Never heard of an sftp server using fake paths, but it seems like you found a fix for your problem.

gpion commented 3 years ago

Never heard of an sftp server using fake paths,

It's the Synology NAS SFTP service. It shows paths based on the smb shares configuration instead of the real filesystem.

jpbaril commented 1 year ago

Never heard of an sftp server using fake paths,

It's the Synology NAS SFTP service. It shows paths based on the smb shares configuration instead of the real filesystem.

Hi @gpion , I have the same problem. How did you solve it ? Thank you

gpion commented 1 year ago

Hi @gpion , I have the same problem. How did you solve it ?

No. Unfortunately for you I'm not using that stuff anymore