hexo-deployer-git icon indicating copy to clipboard operation
hexo-deployer-git copied to clipboard

Deployment failed with `send-pack: unexpected disconnect while reading sideband packet`

Open ttzytt opened this issue 1 year ago • 2 comments

Check List

  • [X] I have already read Docs page & Troubleshooting page.
  • [X] I have already searched existing issues and they are not help to me.
  • [X] I examined error or warning messages and it's difficult to solve.
  • [X] I am using the latest version of Hexo. (run hexo version to check)
  • [X] My Node.js is matched the required version.

Expected behavior

Succesfully deploy hexo blog on github.

Actual behavior

The following is the error message for deployment.

I have tried several things I found, like increasing git buffer size git config --global http.postBuffer 157286400

(base) PS E:\hexo blog\blog> hexo d
INFO  Validating config
INFO  
  ===================================================================
      #####  #    # ##### ##### ###### #####  ###### #      #   #    
      #    # #    #   #     #   #      #    # #      #       # #     
      #####  #    #   #     #   #####  #    # #####  #        #      
      #    # #    #   #     #   #      #####  #      #        #      
      #    # #    #   #     #   #      #   #  #      #        #      
      #####   ####    #     #   ###### #    # #      ######   #      
                            4.13.0
  ===================================================================
INFO  Deploying: git
INFO  Clearing .deploy_git folder...
INFO  Copying files from public folder...
INFO  Copying files from extend dirs...
02:09:21.406760 exec-cmd.c:237          trace: resolved executable dir: E:/git/Git/mingw64/bin
02:09:21.406760 git.c:455               trace: built-in: git add -A
02:09:22.752703 exec-cmd.c:237          trace: resolved executable dir: E:/git/Git/mingw64/bin
02:09:22.752703 git.c:455               trace: built-in: git commit -m 'Site updated: 2024-10-13 02:09:20'
On branch master
nothing to commit, working tree clean
02:09:23.000577 exec-cmd.c:237          trace: resolved executable dir: E:/git/Git/mingw64/bin
02:09:23.000577 git.c:455               trace: built-in: git push -u [email protected]:ttzytt/ttzytt.github.io.git HEAD:main --force
02:09:23.000577 run-command.c:666       trace: run_command: unset GIT_PREFIX; ssh [email protected] 'git-receive-pack '\''ttzytt/ttzytt.github.io.git'\'''
02:09:27.911470 pkt-line.c:80           packet:         push< 40c474ecb73557fe3ee3e4c11cad497de2dfbf29 refs/heads/main\0report-status report-status-v2 delete-refs side-band-64k ofs-delta atomic object-format=sha1 quiet agent=github/spokes-receive-pack-1d804546671de420aa655499b351a8f50a3f552d session-id=ff1fdbbd19f2190bdfb52b83aa6e9af0 push-options
02:09:27.911470 pkt-line.c:80           packet:         push< 0000
02:09:27.911470 pkt-line.c:80           packet:         push> 40c474ecb73557fe3ee3e4c11cad497de2dfbf29 5a655b57ab92604f4ed0c2867f1dc3770049a5cc refs/heads/main\0 report-status-v2 side-band-64k object-format=sha1 agent=git/2.33.1.windows.1
02:09:27.911470 pkt-line.c:80           packet:         push> 0000
02:09:27.911470 run-command.c:666       trace: run_command: git pack-objects --all-progress-implied --revs --stdout --thin --delta-base-offset --progress
02:09:27.937153 exec-cmd.c:237          trace: resolved executable dir: E:/git/Git/mingw64/libexec/git-core   
02:09:27.952126 git.c:455               trace: built-in: git pack-objects --all-progress-implied --revs --stdout --thin --delta-base-offset --progress
Enumerating objects: 4238, done.
Counting objects: 100% (4238/4238), done.
Delta compression using up to 16 threads
Compressing objects: 100% (1690/1690), done.
send-pack: unexpected disconnect while reading sideband packet
Connection to github.com closed by remote host.
fatal: sha1 file '<stdout>' write error: Broken pipe
fatal: the remote end hung up unexpectedly
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshoot
ing.html
Error: Spawn failed
    at ChildProcess.<anonymous> (E:\hexo blog\blog\node_modules\hexo-deployer-git\node_modules\hexo-util\lib\spawn.js:51:21)
    at ChildProcess.emit (node:events:511:28)
    at cp.emit (E:\hexo blog\blog\node_modules\cross-spawn\lib\enoent.js:34:29)
    at ChildProcess._handle.onexit (node:internal/child_process:293:12)

How to reproduce?

  1. hexo cl
  2. hexo d

Is the problem still there under Safe mode?

Not in the safe mode

Your Node.js & npm version

node -v      
v20.2.0
npm -v
9.7.2


### Your Hexo and Plugin version

_No response_

### Your `package.json`

```json
{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "7.3.0"
  },
  "dependencies": {
    "@neilsustc/markdown-it-katex": "^1.0.0",
    "hexo": "^7.0.0",
    "hexo-algoliasearch": "^0.3.2",
    "hexo-deployer-git": "^3.0.0",
    "hexo-filter-mermaid-diagrams": "^1.0.5",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-baidu-sitemap": "^0.1.9",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-feed": "^3.0.0",
    "hexo-generator-i18n": "^0.0.10",
    "hexo-generator-index": "^2.0.0",
    "hexo-generator-search": "^2.4.3",
    "hexo-generator-sitemap": "^3.0.1",
    "hexo-generator-tag": "^1.0.0",
    "hexo-pdf": "^1.0.0",
    "hexo-reference": "^1.0.4",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-markdown-it": "^6.0.1",
    "hexo-renderer-pug": "^3.0.0",
    "hexo-renderer-stylus": "^2.1.0",
    "hexo-server": "^3.0.0",
    "hexo-theme-butterfly": "^4.9.0",
    "hexo-theme-landscape": "^0.0.3",
    "hexo-wordcount": "^6.0.1",
    "valine": "^1.4.18",
    "which": "^5.0.0"
  }
}


### Your site's `_config.yml` (Optional)

_No response_

### Others

_No response_

ttzytt avatar Oct 13 '24 06:10 ttzytt

Some other information:

  • my internet is very stable
  • the website includes some photos; maybe the file sizes are too large (but mostly under 5mb)?
  • I've tried to switched the repo to https link, but there are still errors:
hexo d
INFO  Validating config
INFO  
  ===================================================================
      #####  #    # ##### ##### ###### #####  ###### #      #   #    
      #    # #    #   #     #   #      #    # #      #       # #     
      #####  #    #   #     #   #####  #    # #####  #        #      
      #    # #    #   #     #   #      #####  #      #        #      
      #    # #    #   #     #   #      #   #  #      #        #      
      #####   ####    #     #   ###### #    # #      ######   #      
                            4.13.0
  ===================================================================
INFO  Deploying: git
INFO  Clearing .deploy_git folder...
INFO  Copying files from public folder...
INFO  Copying files from extend dirs...
On branch master
nothing to commit, working tree clean
Enumerating objects: 4856, done.
Counting objects: 100% (4856/4856), done.
Delta compression using up to 16 threads 
Compressing objects: 100% (2019/2019), done.
Writing objects: 100% (4512/4512), 319.13 MiB | 229.65 MiB/s, done.
Total 4512 (delta 2012), reused 1485 (delta 544), pack-reused 0    
error: RPC failed; curl 56 OpenSSL SSL_read: error:140943FC:SSL routines:ssl3_read_bytes:sslv3 alert bad record mac, errno 0
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date
FATAL Something's wrong. Maybe you can find the solution here: https://hex
o.io/docs/troubleshooting.html
Error: Spawn failed
    at ChildProcess.<anonymous> (E:\hexo blog\blog\node_modules\hexo-deployer-git\node_modules\hexo-util\lib\spawn.js:51:21)
    at ChildProcess.emit (node:events:511:28)
    at cp.emit (E:\hexo blog\blog\node_modules\cross-spawn\lib\enoent.js:34:29)
    at ChildProcess._handle.onexit (node:internal/child_process:293:12)

ttzytt avatar Oct 13 '24 06:10 ttzytt

It turns out that the commit I'm pushing is too large. I read this post on StackOverflow. After used this command git repack --max-pack-size=100M -a -d in .deploy_git, I was able to push it.

ttzytt avatar Oct 13 '24 18:10 ttzytt

I try to reproduce with a large commit, but everything works. image

AFAIK, Connection to github.com closed by remote host., the remote end hung up unexpectedly usually is a network issue. I would guess that you just encountered network problems

uiolee avatar Jan 09 '25 06:01 uiolee