lucascaro / hexo-deployer-sftp

SFTP deployer for Hexo
MIT License
7 stars 5 forks source link

Timeout during deployment #2

Open noraj opened 4 years ago

noraj commented 4 years ago

Often the hexo deployment command randomly timeout before completing, so not all files are synced.

  "hexo": {
    "version": "4.2.0"
  },
  "dependencies": {
    "hexo": "^4.0.0",
    "hexo-deployer-git": "^2.1.0",
    "hexo-deployer-sftp": "^0.1.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-feed": "^2.2.0",
    "hexo-generator-index": "^1.0.0",
    "hexo-generator-search": "^2.4.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-marked": "^2.0.0",
    "hexo-renderer-njucks": "^1.0.0",
    "hexo-renderer-stylus": "^1.1.0",
    "hexo-server": "^1.0.0"

Config:

deploy:
- type: sftp
  host: x.x.x.x  
  user: xxx
  pass: xxx
  remotePath: /public/
  port: 22
noraj commented 4 years ago

@lucascaro ?

lucascaro commented 4 years ago

interesting, I have not experienced this before, what is the root cause? is it a network issue causing the timeout and thus causing a problem when not all files are synced? or is it a code issue?

noraj commented 4 years ago

A code issue. The files synced were random between two command. Like if all assets were copied except some HTML file in _post. But it was maybe caused by one of the outdated dependency. Can you now release a new version and publish it on npm so I can try again and see if it still happens after the sftp-sync-deploy upgrade.

noraj commented 4 years ago

I'm waiting for #6 to test if #3 fixed this (#2)

Update: I still have the bug after v0.3.0 and #7 fix. I also tried with the beta v0.8.0 instead of v0.7.1 of the dependency sftp-sync-deploy

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

lucascaro commented 4 years ago

@noraj I just published a new version (v0.4.0 that uses sftp-sync-deploy v0.8.0) you can try that one, and I also made concurrency a parameter so you may try setting that to a lower value in case that might be causing problems for you

lucascaro commented 4 years ago

make that 0.4.1 XD

noraj commented 4 years ago

Yeah the issue is definitely upstream in sftp-sync-deploy, it happens when using forceUpload: true. I already tried with v0.7.1 and v0.8.0. So moving to v0.8.0 won't fix it. I'm not impacted anymore as I moved to forceUpload: false now. To fix it there is nothing to do be wait for upstream to fix and release a new version.

So with hexo-deployer-sftp 0.3.2 and forceUpload: false I have no timeout anymore.

update: with hexo-deployer-sftp 0.4.1 and forceUpload: false I still have timeout. It may not be due to forceUpload but to too many ssh key loaded in the ssh agent because when I try to ssh manually I get Too many authentication failures error, see https://serverfault.com/questions/36291/how-to-recover-from-too-many-authentication-failures-for-user-root. I created an upstream issue: https://github.com/dobbydog/sftp-sync-deploy/issues/18

glor commented 3 years ago

I had this problem too although I could not get it fixed by editing the ssh server config. In the end I realized that rsync (hexo-deployer-rsync) could get me a nearly identical (and even faster) setup (using ssh with a key).

suyin-long commented 2 years ago

使用 hexo-deployer-sftp@0.4.1 后仍然遇到了这个问题,经测试只有第一次上传会遇到该问题(等待超时),之后的上传正常。 或者设置 concurrency: 50 可以解决该问题。