Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install occasionally times out #231

Open
pillowfication opened this issue Nov 18, 2024 · 2 comments
Open

npm install occasionally times out #231

pillowfication opened this issue Nov 18, 2024 · 2 comments

Comments

@pillowfication
Copy link

(Sorry if this is not the appropriate place to ask)

My package.json lists a private git repo as dependency as

"dependencies": {
  "@org/package": "github:org/package"
}

I'm using webfactory/[email protected] so that it can install this package.

jobs:
  build:
    runs-on: windows-2022
    steps:
    - uses: actions/checkout@v4
    - uses: webfactory/[email protected]
      with:
        ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
    - name: Use Node.js 22.7
      uses: actions/setup-node@v4
      with:
        node-version: 22.7
    # This step may fail
    - name: Install
      run: npm clean-install
    - name: Build
      run: npm run build

The problem is that npm clean-install occasionally succeeds after ~5min and occasionally fails after ~15min.

npm error code 128
npm error A git connection error occurred
npm error command git --no-replace-objects clone --mirror -q ssh://[email protected]/org/package.git C:\npm\cache\_cacache\tmp\git-clonedca0sa/.git --config core.longpaths=true
npm error Read from remote host github.com: Connection reset by peer
npm error client_loop: send disconnect: Connection reset by peer
npm error fetch-pack: unexpected disconnect while reading sideband packet
npm error fatal: early EOF
npm error fatal: fetch-pack: invalid index-pack output
npm error A complete log of this run can be found in: C:\npm\cache\_logs\xxxx-xx-xxxxx_xx_xx_xxxx-debug-0.log
Error: Process completed with exit code 1.

Is there anything that can be done about this?

@pillowfication
Copy link
Author

These errors are now occasionally seen with no changes to the workflow:

npm error An unknown git error occurred
npm error signal SIGTERM
npm error command git --no-replace-objects clone ssh://[email protected]/org/package.git C:\npm\cache\_cacache\tmp\git-clonedA4wWF --recurse-submodules --depth=1 --config core.longpaths=true
npm error Cloning into 'C:\npm\cache\_cacache\tmp\git-clonedA4wWF'...
npm error Received disconnect from 140.82.112.3 port 22:11: Bye Bye
npm error Disconnected from 140.82.112.3 port 22
npm error fetch-pack: unexpected disconnect while reading sideband packet
npm error fatal: early EOF
npm error fatal: fetch-pack: invalid index-pack output
npm error A complete log of this run can be found in: C:\npm\cache\_logs\xxxx-xx-xxxxx_xx_xx_xxxx-debug-0.log
Error: Process completed with exit code 1.

@jayakrishnankp
Copy link

Facing the same issue.

npm i errors out when cloning one of the dependencies. The command that fails is:

  • git --no-replace-objects clone ssh://[email protected]/org/mypackage.git C:\npm\cache\_cacache\tmp\git-cloneN8ErPm --recurse-submodules --depth=1 --config core.longpaths=true

Any git clone also fail with access denied errors (tested in Powershell and Git bash in the Github runner). The ssh key is able to clone successfully in other systems.

npm ERR! An unknown git error occurred
npm ERR! signal SIGTERM
npm ERR! command git --no-replace-objects clone ssh://[email protected]/org/mypackage.git C:\npm\cache\_cacache\tmp\git-cloneN8ErPm --recurse-submodules --depth=1 --config core.longpaths=true
npm ERR! 10:09:34.108347 exec-cmd.c:266          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
npm ERR! 10:09:34.123950 git.c:479               trace: built-in: git clone ssh://[email protected]/org/mypackage.git 'C:\npm\cache\_cacache\tmp\git-cloneN8ErPm' --recurse-submodules --depth=1 --config core.longpaths=true
npm ERR! 10:09:34.186452 run-command.c:667       trace: run_command: unset GIT_DIR GIT_NO_REPLACE_OBJECTS; GIT_PROTOCOL=version=2 'ssh -oStrictHostKeyChecking=accept-new' -o SendEnv=GIT_PROTOCOL [email protected] 'git-upload-pack '\''/org/mypackage.git'\'''
npm ERR! Cloning into 'C:\npm\cache\_cacache\tmp\git-cloneN8ErPm'...
npm ERR! 10:09:34.186452 run-command.c:928       trace: start_command: 'C:/Program Files/Git/usr/bin/sh.exe' -c 'ssh -oStrictHostKeyChecking=accept-new "$@"' 'ssh -oStrictHostKeyChecking=accept-new' -o SendEnv=GIT_PROTOCOL [email protected] 'git-upload-pack '\''/org/mypackage.git'\'''
npm ERR! 10:09:35.107923 pkt-line.c:86           packet:        clone< version 2
npm ERR! 10:09:35.107923 pkt-line.c:86           packet:        clone< agent=git/github-50ee4bdaf298
npm ERR! 10:09:35.107923 pkt-line.c:86           packet:        clone< ls-refs=unborn
npm ERR! 10:09:35.107923 pkt-line.c:86           packet:        clone< fetch=shallow wait-for-done filter
npm ERR! 10:09:35.107923 pkt-line.c:86           packet:        clone< server-option
npm ERR! 10:09:35.107923 pkt-line.c:86           packet:        clone< object-format=sha1
npm ERR! 10:09:35.107923 pkt-line.c:86           packet:        clone< 0000
npm ERR! 10:09:35.107923 pkt-line.c:86           packet:        clone> command=ls-refs
npm ERR! 10:09:35.107923 pkt-line.c:86           packet:        clone> agent=git/2.47.0.windows.1
npm ERR! 10:09:35.107923 pkt-line.c:86           packet:        clone> object-format=sha1
npm ERR! 10:09:35.107923 pkt-line.c:86           packet:        clone> 0001
npm ERR! 10:09:35.107923 pkt-line.c:86           packet:        clone> peel
npm ERR! 10:09:35.107923 pkt-line.c:86           packet:        clone> symrefs
npm ERR! 10:09:35.107923 pkt-line.c:86           packet:        clone> unborn
npm ERR! 10:09:35.107923 pkt-line.c:86           packet:        clone> ref-prefix HEAD
npm ERR! 10:09:35.107923 pkt-line.c:86           packet:        clone> ref-prefix refs/heads/
npm ERR! 10:09:35.107923 pkt-line.c:86           packet:        clone> ref-prefix refs/tags/
npm ERR! 10:09:35.239893 pkt-line.c:86           packet:        clone< 0000
npm ERR! 10:09:35.244[92](<job_link>)6 pkt-line.c:86           packet:        clone> command=fetch
npm ERR! 10:09:35.244926 pkt-line.c:86           packet:        clone> agent=git/2.47.0.windows.1
npm ERR! 10:09:35.244926 pkt-line.c:86           packet:        clone> object-format=sha1
npm ERR! 10:09:35.244926 pkt-line.c:86           packet:        clone> 0001
npm ERR! 10:09:35.244926 pkt-line.c:86           packet:        clone> thin-pack
npm ERR! 10:09:35.244926 pkt-line.c:86           packet:        clone> no-progress
npm ERR! 10:09:35.244926 pkt-line.c:86           packet:        clone> include-tag
npm ERR! 10:09:35.244926 pkt-line.c:86           packet:        clone> ofs-delta
npm ERR! 10:09:35.244926 pkt-line.c:86           packet:        clone> deepen 1
npm ERR! 10:09:35.244926 pkt-line.c:86           packet:        clone> want 0f7485cb2beceeec9a37355ecd07faf898820c34
npm ERR! 10:09:35.244926 pkt-line.c:86           packet:        clone> want 0f7485cb2beceeec9a37355ecd07faf898820c34
npm ERR! 10:09:35.244926 pkt-line.c:86           packet:        clone> done
npm ERR! 10:09:35.244926 pkt-line.c:86           packet:        clone> 0000
npm ERR! 10:09:35.361681 pkt-line.c:86           packet:        clone< shallow-info
npm ERR! 10:09:35.361681 pkt-line.c:86           packet:        clone< shallow 0f7485cb2beceeec9a37355ecd07faf898820c34
npm ERR! 10:09:35.361681 pkt-line.c:86           packet:        clone< 0001
npm ERR! 10:09:35.361681 pkt-line.c:86           packet:        clone< packfile
npm ERR! 10:09:35.365[95](<job_link>)7 run-command.c:667       trace: run_command: git --shallow-file C:/npm/cache/_cacache/tmp/git-cloneN8ErPm/.git/shallow.lock index-pack --stdin --fix-thin '--keep=fetch-pack 3000 on fv-az658-764'
npm ERR! 10:09:35.365957 run-command.c:928       trace: start_command: git --shallow-file C:/npm/cache/_cacache/tmp/git-cloneN8ErPm/.git/shallow.lock index-pack --stdin --fix-thin '--keep=fetch-pack 3000 on fv-az658-764'
npm ERR! 10:09:35.378377 exec-cmd.c:266          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
npm ERR! 10:09:35.382879 trace.c:316             setup: git_dir: C:/npm/cache/_cacache/tmp/git-cloneN8ErPm/.git
npm ERR! 10:09:35.382879 trace.c:317             setup: git_common_dir: C:/npm/cache/_cacache/tmp/git-cloneN8ErPm/.git
npm ERR! 10:09:35.382879 trace.c:318             setup: worktree: D:/package_name
npm ERR! 10:09:35.382879 trace.c:319             setup: cwd: D:/package_name
npm ERR! 10:09:35.382879 trace.c:320             setup: prefix: (null)
npm ERR! 10:09:35.382879 git.c:479               trace: built-in: git index-pack --stdin --fix-thin '--keep=fetch-pack 3000 on fv-az658-764'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants