Skip to content
Latchkey

Coveralls "Bad response: 422" upload error in CI

Coveralls accepted the connection but returned 422, meaning the request was well-formed HTTP but the coverage payload was unprocessable: a bad or missing repo token, an unknown service, or a malformed/empty report.

What this error means

The Coveralls step fails with "Bad response: 422 {\"message\":\"...\",\"error\":true}" or "Unprocessable Entity" while submitting coverage.

Coveralls
Error from lcovParse: 'Failed to submit coverage: Bad response: 422 {"message":
"Couldn't find a repository matching this job.","error":true}'

Common causes

Missing or wrong repo token / service config

Coveralls cannot match the job to a repository without a correct COVERALLS_REPO_TOKEN (or GitHub token), so it rejects the submission with 422.

The coverage payload is empty or malformed

An empty lcov file or a report Coveralls cannot parse yields a 422 because there is no valid coverage to record.

How to fix it

Provide the correct token for the run

  1. Set COVERALLS_REPO_TOKEN (or pass the GitHub token to the official action).
  2. For Actions, use the maintained coverallsapp action which derives service identity automatically.
  3. Confirm the lcov file is non-empty before submitting.
.github/workflows/ci.yml
- uses: coverallsapp/github-action@v2
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    path-to-lcov: ./coverage/lcov.info

Verify the report has content

Check the coverage file is generated and non-empty before the upload step runs.

Terminal
test -s coverage/lcov.info && wc -l coverage/lcov.info

How to prevent it

  • Use the official coverallsapp/github-action so service identity is set correctly.
  • Keep COVERALLS_REPO_TOKEN in secrets for non-Actions CI.
  • Generate a non-empty lcov report before uploading.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →