vscode-sftp icon indicating copy to clipboard operation
vscode-sftp copied to clipboard

Error: Config Not Found. (file:///) when upload file on save (v1.16.3) but upload with right click on file works!

Open MIchaelPrisco77 opened this issue 2 years ago • 5 comments

Do you read the FAQ?

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Run command '....'
  3. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Mac, Win, Linux]
  • VSCode Version [e.g. 1.51.0]
  • Extension Version [e.g. 1.7.0]

Extension Logs from Startup - required

  1. Open User Settings.

    • On Windows/Linux - File > Preferences > Settings
    • On macOS - Code > Preferences > Settings
  2. Set sftp.debug to true and reload vscode.

  3. Reproduce the problem, get the logs from View > Output > sftp.

MIchaelPrisco77 avatar Aug 24 '23 17:08 MIchaelPrisco77

I have a problem with sftp extension. When I upload file using the option "Upload ..." clicking with the right button on a file, everything works. The same for download of entire folders.

But as soon as I save a file watched by the extension (using a context) , there is an odd error saying Error: Config Not Found

the error is the following:

08-24 18:55:46] [info] [file-save] D:\x\repository\x\src\website\html\app-chat-box.html
[08-24 18:55:46] [error] Error: Config Not Found. (file:///d:/x/repository/kynemaspace/src/website/html/app-chat-box.html)
	at l (c:\Users\micha\.vscode\extensions\natizyskunk.sftp-1.16.3\dist\extension.js:2:296202)
	at Object.<anonymous> (c:\Users\micha\.vscode\extensions\natizyskunk.sftp-1.16.3\dist\extension.js:2:296960)
	at Generator.next (<anonymous>)
	at c:\Users\micha\.vscode\extensions\natizyskunk.sftp-1.16.3\dist\extension.js:2:295920
	at new Promise (<anonymous>)
	at n (c:\Users\micha\.vscode\extensions\natizyskunk.sftp-1.16.3\dist\extension.js:2:295665)
	at Object.<anonymous> (c:\Users\micha\.vscode\extensions\natizyskunk.sftp-1.16.3\dist\extension.js:2:296899)
	at c:\Users\micha\.vscode\extensions\natizyskunk.sftp-1.16.3\dist\extension.js:2:324013
	at Generator.next (<anonymous>)
	at s (c:\Users\micha\.vscode\extensions\natizyskunk.sftp-1.16.3\dist\extension.js:2:323056) download xD:\x\repository\x\src\website\html\app-chat-box.html

sftp conf file (sensitive data obfuscated) (I repeat the upload works, so I think it's not a problem of configuration)

[
    {
        "name": "PHP",
        "context": "./src/website/php",
        "protocol": "sftp",
        "host": "x.x.x.x",
        "username": "admin",
        "remotePath": "/var/www/html/xxx",
        "privateKeyPath": "x",
        "uploadOnSave": true
    }
    ,
    {
        "name": "HTML",
        "context": "./src/website/html",
        "protocol": "sftp",
        "host": "x.x.x.x",
        "username": "admin",
        "remotePath": "/var/www/html/xxx",
        "privateKeyPath": "x",
        "uploadOnSave": true
    }
]

I activated the debug mode

AN EXAMPLE OF CORRECTLY UPLOADED FILE (WITH RIGHT CLICK, NOT WITH SAVE is the following

[08-24 19:08:01] [trace] run command 'Upload File'
[08-24 19:08:01] [trace] handle upload file for d:\X\repository\X\src\website\html\app-emailbox.html
[08-24 19:08:01] [debug] Custom crypto binding not available
[08-24 19:08:01] [debug] Local ident: 'SSH-2.0-ssh2js1.13.0'
[08-24 19:08:01] [debug] Client: Trying x.x.x.x on port 22 ...
[08-24 19:08:01] [debug] Socket connected
[08-24 19:08:01] [debug] Remote ident: 'SSH-2.0-OpenSSH_9.2p1 Debian-2'
[08-24 19:08:01] [debug] Outbound: Sending KEXINIT
[08-24 19:08:01] [debug] Inbound: Handshake in progress
[08-24 19:08:01] [debug] Handshake: (local) KEX method: [email protected],curve25519-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group15-sha512,diffie-hellman-group16-sha512,diffie-hellman-group17-sha512,diffie-hellman-group18-sha512,ext-info-c
[08-24 19:08:01] [debug] Handshake: (remote) KEX method: [email protected],curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256
[08-24 19:08:01] [debug] Handshake: KEX algorithm: [email protected]
[08-24 19:08:01] [debug] Handshake: (local) Host key format: ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-512,rsa-sha2-256,ssh-rsa
[08-24 19:08:01] [debug] Handshake: (remote) Host key format: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
[08-24 19:08:01] [debug] Handshake: Host key format: ssh-ed25519
[08-24 19:08:01] [debug] Handshake: (local) C->S cipher: [email protected],[email protected],aes128-ctr,aes192-ctr,aes256-ctr
[08-24 19:08:01] [debug] Handshake: (remote) C->S cipher: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
[08-24 19:08:01] [debug] Handshake: C->S Cipher: [email protected]
[08-24 19:08:01] [debug] Handshake: (local) S->C cipher: [email protected],[email protected],aes128-ctr,aes192-ctr,aes256-ctr
[08-24 19:08:01] [debug] Handshake: (remote) S->C cipher: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
[08-24 19:08:01] [debug] Handshake: S->C cipher: [email protected]
[08-24 19:08:01] [debug] Handshake: (local) C->S MAC: [email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
[08-24 19:08:01] [debug] Handshake: (remote) C->S MAC: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
[08-24 19:08:01] [debug] Handshake: C->S MAC: <implicit>
[08-24 19:08:01] [debug] Handshake: (local) S->C MAC: [email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
[08-24 19:08:01] [debug] Handshake: (remote) S->C MAC: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
[08-24 19:08:01] [debug] Handshake: S->C MAC: <implicit>
[08-24 19:08:01] [debug] Handshake: (local) C->S compression: none,[email protected],zlib
[08-24 19:08:01] [debug] Handshake: (remote) C->S compression: none,[email protected]
[08-24 19:08:01] [debug] Handshake: C->S compression: none
[08-24 19:08:01] [debug] Handshake: (local) S->C compression: none,[email protected],zlib
[08-24 19:08:01] [debug] Handshake: (remote) S->C compression: none,[email protected]
[08-24 19:08:01] [debug] Handshake: S->C compression: none
[08-24 19:08:01] [debug] Outbound: Sending KEXECDH_INIT
[08-24 19:08:02] [debug] Received DH Reply
[08-24 19:08:02] [debug] Host accepted by default (no verification)
[08-24 19:08:02] [debug] Host accepted (verified)
[08-24 19:08:02] [debug] Outbound: Sending NEWKEYS
[08-24 19:08:02] [debug] Inbound: NEWKEYS
[08-24 19:08:02] [debug] Verifying signature ...
[08-24 19:08:02] [debug] Verified signature
[08-24 19:08:02] [debug] Handshake completed
[08-24 19:08:02] [debug] Outbound: Sending SERVICE_REQUEST (ssh-userauth)
[08-24 19:08:02] [debug] Inbound: Received EXT_INFO
[08-24 19:08:02] [debug] Inbound: Received SERVICE_ACCEPT (ssh-userauth)
[08-24 19:08:02] [debug] Outbound: Sending USERAUTH_REQUEST (none)
[08-24 19:08:02] [debug] Inbound: Received USERAUTH_FAILURE (publickey)
[08-24 19:08:02] [debug] Client: none auth failed
[08-24 19:08:02] [debug] Outbound: Sending USERAUTH_REQUEST (publickey -- check)
[08-24 19:08:03] [debug] Inbound: Received USERAUTH_PK_OK
[08-24 19:08:03] [debug] Outbound: Sending USERAUTH_REQUEST (publickey)
[08-24 19:08:03] [debug] Inbound: Received USERAUTH_SUCCESS
[08-24 19:08:03] [debug] Outbound: Sending CHANNEL_OPEN (r:0, session)
[08-24 19:08:03] [debug] Inbound: GLOBAL_REQUEST ([email protected])
[08-24 19:08:03] [debug] Outbound: Sending GLOBAL_REQUEST ([email protected])
[08-24 19:08:03] [debug] Inbound: Received DEBUG
[08-24 19:08:03] [debug] Debug output from server: "/home/admin/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding"
[08-24 19:08:03] [debug] Inbound: Received DEBUG
[08-24 19:08:03] [debug] Debug output from server: "/home/admin/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding"
[08-24 19:08:04] [debug] Inbound: CHANNEL_OPEN_CONFIRMATION (r:0, s:0)
[08-24 19:08:04] [debug] Outbound: Sending CHANNEL_REQUEST (r:0, subsystem: sftp)
[08-24 19:08:04] [debug] Inbound: REQUEST_SUCCESS
[08-24 19:08:04] [debug] Inbound: CHANNEL_WINDOW_ADJUST (r:0, 2097152)
[08-24 19:08:04] [debug] Inbound: CHANNEL_SUCCESS (r:0)
[08-24 19:08:04] [debug] Outbound: Sending CHANNEL_DATA (r:0, 9)
[08-24 19:08:05] [debug] Inbound: CHANNEL_DATA (r:0, 322)
[08-24 19:08:05] [debug] SFTP: Inbound: Received VERSION (v3, exts:[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],copy-data,home-directory,[email protected])
[08-24 19:08:05] [debug] Outbound: Sending CHANNEL_DATA (r:0, 31)
[08-24 19:08:05] [debug] SFTP: Outbound: Buffered [email protected]
[08-24 19:08:05] [debug] Inbound: CHANNEL_DATA (r:0, 41)
[08-24 19:08:05] [debug] SFTP: Inbound: Received EXTENDED_REPLY (id:0, [email protected])
[08-24 19:08:05] [debug] Outbound: Sending CHANNEL_DATA (r:0, 42)
[08-24 19:08:05] [debug] SFTP: Outbound: Buffered MKDIR
[08-24 19:08:05] [debug] Inbound: CHANNEL_DATA (r:0, 28)
[08-24 19:08:05] [debug] SFTP: Inbound: Received STATUS (id:1, 4, "Failure")
[08-24 19:08:05] [debug] Outbound: Sending CHANNEL_DATA (r:0, 38)
[08-24 19:08:05] [debug] SFTP: Outbound: Buffered LSTAT
[08-24 19:08:06] [debug] Inbound: CHANNEL_DATA (r:0, 41)
[08-24 19:08:06] [debug] SFTP: Inbound: Received ATTRS (id:2)
[08-24 19:08:06] [debug] Outbound: Sending CHANNEL_DATA (r:0, 64)
[08-24 19:08:06] [debug] SFTP: Outbound: Buffered OPEN
[08-24 19:08:06] [debug] Inbound: CHANNEL_DATA (r:0, 17)
[08-24 19:08:06] [debug] SFTP: Inbound: Received HANDLE (id:3)
[08-24 19:08:06] [debug] Outbound: Sending CHANNEL_DATA (r:0, 17)
[08-24 19:08:06] [debug] SFTP: Outbound: Buffered FSTAT
[08-24 19:08:07] [debug] Inbound: CHANNEL_DATA (r:0, 41)
[08-24 19:08:07] [debug] SFTP: Inbound: Received ATTRS (id:4)
[08-24 19:08:07] [debug] Outbound: Sending CHANNEL_DATA (r:0, 25)
[08-24 19:08:07] [debug] SFTP: Outbound: Buffered FSETSTAT
[08-24 19:08:07] [debug] Inbound: CHANNEL_DATA (r:0, 28)
[08-24 19:08:07] [debug] SFTP: Inbound: Received STATUS (id:5, 0, "Success")
[08-24 19:08:07] [debug] Outbound: Sending CHANNEL_DATA (r:0, 32768)
[08-24 19:08:07] [debug] Outbound: Sending CHANNEL_DATA (r:0, 32768)
[08-24 19:08:07] [debug] Outbound: Sending CHANNEL_DATA (r:0, 29)
[08-24 19:08:07] [debug] SFTP: Outbound: Sent WRITE (id:6)
[08-24 19:08:08] [debug] Inbound: CHANNEL_DATA (r:0, 28)
[08-24 19:08:08] [debug] SFTP: Inbound: Received STATUS (id:6, 0, "Success")
[08-24 19:08:08] [debug] Outbound: Sending CHANNEL_DATA (r:0, 4780)
[08-24 19:08:08] [debug] SFTP: Outbound: Sent WRITE (id:7)
[08-24 19:08:08] [debug] Inbound: CHANNEL_DATA (r:0, 28)
[08-24 19:08:08] [debug] SFTP: Inbound: Received STATUS (id:7, 0, "Success")
[08-24 19:08:08] [debug] Outbound: Sending CHANNEL_DATA (r:0, 29)
[08-24 19:08:08] [debug] SFTP: Outbound: Buffered FSETSTAT
[08-24 19:08:08] [debug] Inbound: CHANNEL_DATA (r:0, 28)
[08-24 19:08:08] [debug] SFTP: Inbound: Received STATUS (id:8, 0, "Success")
[08-24 19:08:08] [debug] Outbound: Sending CHANNEL_DATA (r:0, 17)
[08-24 19:08:08] [debug] SFTP: Outbound: Buffered CLOSE
[08-24 19:08:09] [debug] Inbound: CHANNEL_DATA (r:0, 28)
[08-24 19:08:09] [debug] SFTP: Inbound: Received STATUS (id:9, 0, "Success")
**[08-24 19:08:09] [info] local ➞ remote d:\x\repository\x\src\website\html\app-emailbox.html**

MIchaelPrisco77 avatar Aug 24 '23 17:08 MIchaelPrisco77

I have this problem too when using context

staatzstreich avatar Aug 29 '23 02:08 staatzstreich

Maybe this also relates to #398 ? Did you try to downgrade to 1.16.1?

jnagler avatar Oct 25 '23 07:10 jnagler

My issue was with multiple context (did not try the single version). There seems to be a problem with evaluating the path of the selected local file as relative to the root folder. If you convert the "context" value into absolute paths instead of relative paths (so no usage of just "/" for the root), things work. such as:

[
{
    "name": "name-1",
    "context": "/Users/user/projects/project1"
    "remotePath": "/home/user/remote",
    ...
},
{
    "name": "name-2",
    "context": "/Users/user/projects/project1/other",
    "remotePath": "/usr/local/other",
    ...
}
]

kocas avatar Nov 16 '23 20:11 kocas

same behavior, downgrade to 1.16.1 helped

dvestezarzlkl avatar Feb 14 '24 17:02 dvestezarzlkl