dobbydog / sftp-sync-deploy

[Node.js] Sync local files to remote using SFTP.
MIT License
25 stars 17 forks source link

Failed to upload second time #11

Open joseboretto opened 5 years ago

joseboretto commented 5 years ago

Hi, I have a FTP server. When the folder is empty everything its ok. But the second time I get this error:

forceUpload: true // fail forceUpload: false // ok

Deploy error!  { Error: Failure
    at SFTPStream._transform (C:\Users\20371279688\Documents\repos\rgp-web-frontend\node_modules\ssh2-streams\lib\sftp.js:413:27)
    at SFTPStream.Transform._read (_stream_transform.js:186:10)
    at SFTPStream._read (C:\Users\20371279688\Documents\repos\rgp-web-frontend\node_modules\ssh2-streams\lib\sftp.js:184:15)
    at SFTPStream.Transform._write (_stream_transform.js:174:12)
    at doWrite (_stream_writable.js:396:12)
    at writeOrBuffer (_stream_writable.js:382:5)
    at SFTPStream.Writable.write (_stream_writable.js:290:11)
    at Channel.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at Channel.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Channel.Readable.push (_stream_readable.js:208:10)
    at SSH2Stream.<anonymous> (C:\Users\20371279688\Documents\repos\rgp-web-frontend\node_modules\ssh2\lib\Channel.js:166:15)
    at emitOne (events.js:116:13)
    at SSH2Stream.emit (events.js:211:7)
  cause: { Error: Failure
    at SFTPStream._transform (C:\Users\20371279688\Documents\repos\rgp-web-frontend\node_modules\ssh2-streams\lib\sftp.js:413:27)
    at SFTPStream.Transform._read (_stream_transform.js:186:10)
    at SFTPStream._read (C:\Users\20371279688\Documents\repos\rgp-web-frontend\node_modules\ssh2-streams\lib\sftp.js:184:15)
    at SFTPStream.Transform._write (_stream_transform.js:174:12)
    at doWrite (_stream_writable.js:396:12)
    at writeOrBuffer (_stream_writable.js:382:5)
    at SFTPStream.Writable.write (_stream_writable.js:290:11)
    at Channel.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at Channel.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Channel.Readable.push (_stream_readable.js:208:10)
    at SSH2Stream.<anonymous> (C:\Users\20371279688\Documents\repos\rgp-web-frontend\node_modules\ssh2\lib\Channel.js:166:15)
    at emitOne (events.js:116:13)
    at SSH2Stream.emit (events.js:211:7) code: 4, lang: '' },
  isOperational: true,
  code: 4,
  lang: '' }

After that my images in the static folder are broken with size 0.

Any help?

joseboretto commented 5 years ago

Solution: I had a dependency that generates lot of svg icons (https://www.npmjs.com/package/flag-icon-css). I remove it and its works!

Erim32 commented 5 years ago

I have the same issue, how did you found the source of your issue ?

entozoon commented 5 years ago

Same issue here. Does it just break when there are a lot of files to upload? Makes this package unusable

dobbydog commented 5 years ago

Perhaps same as #8 i've tried to figure out this with queuing sftp tasks and seemed to work well. I'll release a beta version shortly.

dobbydog commented 5 years ago

Try new beta version npm i sftp-sync-deploy@beta installed version will be 0.8.0

Erim32 commented 5 years ago

Works, thank you 👍

noraj commented 4 years ago

with sftp-sync-deploy v0.7.1 or v0.8.0 it fails with forceUpload: trueand forceUpload: false.

https://github.com/lucascaro/hexo-deployer-sftp/issues/2