webfactory / ssh-agent

GitHub Action to setup `ssh-agent` with a private key
MIT License
1.24k stars 256 forks source link

`npm install` occasionally times out #231

Open pillowfication opened 1 week ago

pillowfication commented 1 week ago

(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/ssh-agent@v0.9.0 so that it can install this package.

jobs:
  build:
    runs-on: windows-2022
    steps:
    - uses: actions/checkout@v4
    - uses: webfactory/ssh-agent@v0.9.0
      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://git@github.com/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 commented 5 days ago

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://git@github.com/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.