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

Invalid handle

Open Epizefiri opened this issue 3 years ago • 6 comments

Hi there, When i try to upload to a website hosted on wpengine.com i get the error "Invalid handle". This happens only on Visual Studio Code 1.56, on my laptop ( that is still running 1.55 ) everything works normally.

I know that this project is basically unmaintained, what can i do to solve this?

[06-01 07:55:40] [warn] Can't set modified time to the file because Invalid handle
[06-01 07:55:41] [error] Error: Invalid handle
	at SFTPStream._transform (/home/epizefiri/.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 (/home/epizefiri/.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> (/home/epizefiri/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2/lib/Channel.js:167:15)
	at SSH2Stream.emit (events.js:315:20)
	at parsePacket (/home/epizefiri/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/ssh.js:3288:10)
	at SSH2Stream._transform (/home/epizefiri/.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 (/home/epizefiri/.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 /home/epizefiri/Projects/SUMUP/plexPayout/admin/partials/payout_settlement_master.php

Epizefiri avatar Jun 01 '21 06:06 Epizefiri

I'm having the exact same problem.

IlanVivanco avatar Jun 04 '21 12:06 IlanVivanco

Follow the #919 comment to fix it!

IlanVivanco avatar Jun 04 '21 12:06 IlanVivanco

#919 worked for me as well... thank you, @IlanVivanco

Updating the SSH2 package has fixed the issue for me, just need to change the ssh2 version 1.1.0 in the package.json "extensions/liximomo.sftp-1.12.9/package.json, and run npm install ref: https://www.npmjs.com/package/ssh2

I'm on Win10 so I went to c:\users\username.vscode\extensions\liximomo.sftp-1.12.9\package.json changed "ssh2": "^x.x.x" to "ssh2": "^1.1.0" Then opened terminal in same directory (c:\users\username.vscode\extensions\liximomo.sftp-1.12.9) and ran> npm install restart vscode (didn't work until I restarted vscode)

as1414 avatar Jun 18 '21 00:06 as1414

I can confirm that updating to 1.1.0 fixes the issue with wpengine invalid handle error.

senica avatar Oct 08 '21 17:10 senica

Update to "^1.1.0" helped, but only after restarting of vscode.

iaroslavglodov avatar Dec 06 '21 10:12 iaroslavglodov

You can try my version, I have fixed bugs and added new features, maybe this will fix the problem you are having. https://marketplace.visualstudio.com/items?itemName=satiromarra.code-sftp

satiromarra avatar Feb 03 '23 07:02 satiromarra