Search code examples
githubyamlgithub-actionsworkflowpipeline

GitHub actions workflow throws error 137 when installing dependencies


I've created a workflow on GitHub actions. The first run worked well, but the next time I push to the main branch fails at install dependencies step. It throws me the following error

##[debug]Evaluating condition for step: 'Install dependencies'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Install dependencies
##[debug]Loading inputs
##[debug]Loading env
Run npm i
##[debug]/usr/bin/bash -e /home/username/actions-runner/server-actions/_temp/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.sh
/home/user/actions-runner/server-actions/_temp/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.sh: line 1: 36323 Killed                  npm i
Error: Process completed with exit code 137.
##[debug]Finishing: Install dependencies

This is the yaml

name: Node.js CI

on:
  push:
    branches: [ "main" ]

jobs:
  build:

    runs-on: self-hosted

    strategy:
      matrix:
        node-version: [16.x]

    steps:
    - uses: actions/checkout@v3
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.node-version }}
        cache: 'npm'
    - name: Install dependencies
      run: npm ci
    - name: Building
      run: npm run build --if-present

What I'm doing wrong? Thanks in advance


Solution

  • Seems like that process is being killed by the OOM (out-of-memory) killer. As you are using a self-hosted runner, you can SSH to that machine and observe the memory and CPU utilization with the top or htop command when the jobs are run.

    If the job is killed, check system logs with:

    dmesg -T | grep -i 'killed process'
    

    If that killed process is there then that's the reason and you may consider beefing up the specs of your self-hosted runner.