liximomo / vscode-sftp

Super fast sftp/ftp extension for VS Code
MIT License
1.5k stars 256 forks source link

Permission Denied (Reinstalled VSC) #958

Open seizoux opened 2 years ago

seizoux commented 2 years ago

Do you read the FAQ?

Describe the bug Permission denied when trying to upload files from local to vps. I think there's nothing else to explain

To Reproduce Steps to reproduce the behavior:

  1. Go to 'VSC'
  2. Save file after edits (auto-upload-on-save enabled in sftp.json)
  3. See error

Expected behavior Files upload on vps automatically

Desktop (please complete the following information):

Error

[07-20 21:38:08] [error] Error: Permission denied
    at SFTPStream._transform (c:\Users\pisto\.vscode\extensions\liximomo.sftp-1.12.9\node_modules\ssh2-streams\lib\sftp.js:412:27)
    at SFTPStream.Transform._read (internal/streams/transform.js:205:10)
    at SFTPStream._read (c:\Users\pisto\.vscode\extensions\liximomo.sftp-1.12.9\node_modules\ssh2-streams\lib\sftp.js:183:15)
    at SFTPStream.Transform._write (internal/streams/transform.js:193:12)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at SFTPStream.Writable.write (internal/streams/writable.js:303:10)
    at Channel.ondata (internal/streams/readable.js:719:22)
    at Channel.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at Channel.Readable.push (internal/streams/readable.js:223:10)
    at SSH2Stream.<anonymous> (c:\Users\pisto\.vscode\extensions\liximomo.sftp-1.12.9\node_modules\ssh2\lib\Channel.js:167:15)
    at SSH2Stream.emit (events.js:315:20)
    at parsePacket (c:\Users\pisto\.vscode\extensions\liximomo.sftp-1.12.9\node_modules\ssh2-streams\lib\ssh.js:3288:10)
    at SSH2Stream._transform (c:\Users\pisto\.vscode\extensions\liximomo.sftp-1.12.9\node_modules\ssh2-streams\lib\ssh.js:694:13)
    at SSH2Stream.Transform._read (internal/streams/transform.js:205:10)
    at SSH2Stream._read (c:\Users\pisto\.vscode\extensions\liximomo.sftp-1.12.9\node_modules\ssh2-streams\lib\ssh.js:253:15)
    at SSH2Stream.Transform._write (internal/streams/transform.js:193:12)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at SSH2Stream.Writable.write (internal/streams/writable.js:303:10)
    at Socket.ondata (internal/streams/readable.js:719:22)
    at Socket.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at Socket.Readable.push (internal/streams/readable.js:223:10)
seizoux commented 2 years ago

Edit Actually changed remotePath from ./Ami to /home/daishiky/Ami, got a new error:

[07-21 00:49:58] [warn] Can't set modified time to the file because Failure
[07-21 00:49:58] [error] Error: No such file

Debug

[07-21 00:52:14] [warn] ENOENT: no such file or directory, open 'C:\Users\pisto\.ssh\config' load C:\Users\pisto\.ssh\config failed
[07-21 00:52:14] [info] [file-save] c:\Users\pisto\Desktop\Ami\cogs\newcuppy.py
[07-21 00:52:14] [trace] handle upload file for c:\Users\pisto\Desktop\Ami\cogs\newcuppy.py
[07-21 00:52:14] [debug] Local ident: 'SSH-2.0-ssh2js0.4.5'
[07-21 00:52:14] [debug] Client: Trying [ip hided] on port 22 ...
[07-21 00:52:15] [debug] Client: Connected
[07-21 00:52:15] [debug] Remote ident: 'SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3'
[07-21 00:52:15] [debug] Outgoing: Writing KEXINIT
[07-21 00:52:15] [debug] DEBUG: Comparing KEXINITs ...
[07-21 00:52:15] [debug] (local) KEX algorithms: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
[07-21 00:52:15] [debug] (remote) KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,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,diffie-hellman-group14-sha1
[07-21 00:52:15] [debug] KEX algorithm: ecdh-sha2-nistp256
[07-21 00:52:15] [debug] (local) Host key formats: ssh-ed25519,ssh-rsa,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
[07-21 00:52:15] [debug] (remote) Host key formats: ssh-rsa,rsa-sha2-512,rsa-sha2-256
[07-21 00:52:15] [debug] Host key format: ssh-rsa
[07-21 00:52:15] [debug] (local) Client->Server ciphers: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm,aes128-gcm@openssh.com,aes256-gcm,aes256-gcm@openssh.com
[07-21 00:52:15] [debug] (remote) Client->Server ciphers: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
[07-21 00:52:15] [debug] Client->Server Cipher: aes128-ctr
[07-21 00:52:15] [debug] (local) Server->Client ciphers: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm,aes128-gcm@openssh.com,aes256-gcm,aes256-gcm@openssh.com
[07-21 00:52:15] [debug] (remote) Server->Client ciphers: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
[07-21 00:52:15] [debug] Server->Client Cipher: aes128-ctr
[07-21 00:52:15] [debug] (local) Client->Server HMAC algorithms: hmac-sha2-256,hmac-sha2-512,hmac-sha1
[07-21 00:52:15] [debug] (remote) Client->Server HMAC algorithms: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
[07-21 00:52:15] [debug] Client->Server HMAC algorithm: hmac-sha2-256
[07-21 00:52:15] [debug] (local) Server->Client HMAC algorithms: hmac-sha2-256,hmac-sha2-512,hmac-sha1
[07-21 00:52:15] [debug] (remote) Server->Client HMAC algorithms: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
[07-21 00:52:15] [debug] Server->Client HMAC algorithm: hmac-sha2-256
[07-21 00:52:15] [debug] (local) Client->Server compression algorithms: none,zlib@openssh.com,zlib
[07-21 00:52:15] [debug] (remote) Client->Server compression algorithms: none,zlib@openssh.com
[07-21 00:52:15] [debug] Client->Server compression algorithm: none
[07-21 00:52:15] [debug] (local) Server->Client compression algorithms: none,zlib@openssh.com,zlib
[07-21 00:52:15] [debug] (remote) Server->Client compression algorithms: none,zlib@openssh.com
[07-21 00:52:15] [debug] Server->Client compression algorithm: none
[07-21 00:52:15] [debug] Outgoing: Writing KEXECDH_INIT
[07-21 00:52:15] [debug] DEBUG: Checking host key format
[07-21 00:52:15] [debug] DEBUG: Checking signature format
[07-21 00:52:15] [debug] DEBUG: Verifying host fingerprint
[07-21 00:52:15] [debug] DEBUG: Host accepted by default (no verification)
[07-21 00:52:15] [debug] DEBUG: Verifying signature
[07-21 00:52:15] [debug] Outgoing: Writing NEWKEYS
[07-21 00:52:15] [debug] Outgoing: Writing SERVICE_REQUEST (ssh-userauth)
[07-21 00:52:15] [debug] Outgoing: Writing USERAUTH_REQUEST (none)
[07-21 00:52:15] [debug] Client: none auth failed
[07-21 00:52:15] [debug] Outgoing: Writing USERAUTH_REQUEST (password)
[07-21 00:52:15] [debug] Outgoing: Writing CHANNEL_OPEN (0, session)
[07-21 00:52:16] [debug] Outgoing: Writing CHANNEL_REQUEST (0, subsystem: sftp)
[07-21 00:52:16] [debug] Outgoing: Writing CHANNEL_DATA (0)
[07-21 00:52:16] [debug] Outgoing: Writing MKDIR
[07-21 00:52:16] [debug] Outgoing: Writing CHANNEL_DATA (0)
[07-21 00:52:16] [debug] Outgoing: Writing LSTAT
[07-21 00:52:16] [debug] Outgoing: Writing CHANNEL_DATA (0)
[07-21 00:52:16] [debug] Outgoing: Writing OPEN
[07-21 00:52:16] [debug] Outgoing: Writing CHANNEL_DATA (0)
[07-21 00:52:16] [debug] Outgoing: Writing FSTAT
[07-21 00:52:16] [debug] Outgoing: Writing CHANNEL_DATA (0)
[07-21 00:52:16] [debug] Outgoing: Writing FSETSTAT
[07-21 00:52:16] [debug] Outgoing: Writing CHANNEL_DATA (0)
[07-21 00:52:16] [debug] Outgoing: Writing WRITE
[07-21 00:52:16] [debug] Outgoing: Writing CHANNEL_DATA (0)
[07-21 00:52:17] [debug] Outgoing: Writing CLOSE
[07-21 00:52:17] [debug] Outgoing: Writing CHANNEL_DATA (0)
[07-21 00:52:17] [debug] Outgoing: Writing FSETSTAT
[07-21 00:52:17] [debug] Outgoing: Writing CHANNEL_DATA (0)
[07-21 00:52:17] [warn] Can't set modified time to the file because Failure
[07-21 00:52:17] [debug] Outgoing: Writing CLOSE
[07-21 00:52:17] [debug] Outgoing: Writing CHANNEL_DATA (0)
[07-21 00:52:17] [error] Error: No such file
    at SFTPStream._transform (c:\Users\pisto\.vscode\extensions\liximomo.sftp-1.12.9\node_modules\ssh2-streams\lib\sftp.js:412:27)
    at SFTPStream.Transform._read (internal/streams/transform.js:205:10)
    at SFTPStream._read (c:\Users\pisto\.vscode\extensions\liximomo.sftp-1.12.9\node_modules\ssh2-streams\lib\sftp.js:183:15)
    at SFTPStream.Transform._write (internal/streams/transform.js:193:12)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at SFTPStream.Writable.write (internal/streams/writable.js:303:10)
    at Channel.ondata (internal/streams/readable.js:719:22)
    at Channel.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at Channel.Readable.push (internal/streams/readable.js:223:10)
    at SSH2Stream.<anonymous> (c:\Users\pisto\.vscode\extensions\liximomo.sftp-1.12.9\node_modules\ssh2\lib\Channel.js:167:15)
    at SSH2Stream.emit (events.js:315:20)
    at parsePacket (c:\Users\pisto\.vscode\extensions\liximomo.sftp-1.12.9\node_modules\ssh2-streams\lib\ssh.js:3288:10)
    at SSH2Stream._transform (c:\Users\pisto\.vscode\extensions\liximomo.sftp-1.12.9\node_modules\ssh2-streams\lib\ssh.js:694:13)
    at SSH2Stream.Transform._read (internal/streams/transform.js:205:10)
    at SSH2Stream._read (c:\Users\pisto\.vscode\extensions\liximomo.sftp-1.12.9\node_modules\ssh2-streams\lib\ssh.js:253:15)
    at SSH2Stream.Transform._write (internal/streams/transform.js:193:12)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at SSH2Stream.Writable.write (internal/streams/writable.js:303:10)
    at Socket.ondata (internal/streams/readable.js:719:22)
    at Socket.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at Socket.Readable.push (internal/streams/readable.js:223:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23) when local ➞ remote c:\Users\pisto\Desktop\Ami\cogs\newcuppy.py
uriasbt commented 2 years ago

I have the same issue, and for a long time this extension did not receive any updated. I switched to "SFTP" by Natizyskunk, it's a fork of this extension, works exactly the same for me and it's much more frequently updated.

Rod-Burke commented 6 months ago

I got this error, and it was due to having the wrong remotepath. It was caused by having public_html as the first directory in my local workspace. So "/public_html/" did not work but "public_html/" did. (removed the slash in front.)