Skip to content

422 Client Error: Unprocessable Entity for url: https://coveralls.io/api/v1/jobs for coveralls==4.0.0 #434

@abravalheri

Description

@abravalheri

Describe the Bug
The last builds of validate-pyproject started failing when running coveralls --submit with the following error:

Error running coveralls: Could not submit coverage: 422 Client Error: Unprocessable Entity for url: https://coveralls.io/api/v1/jobs
Traceback (most recent call last):
  File "/tmp/validate-pyproject/.venv/lib/python3.12/site-packages/coveralls/api.py", line 298, in submit_report
    response.raise_for_status()
  File "/tmp/validate-pyproject/.venv/lib/python3.12/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://coveralls.io/api/v1/jobs

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/tmp/validate-pyproject/.venv/lib/python3.12/site-packages/coveralls/cli.py", line 88, in main
    coverallz.submit_report(report_file.read())
  File "/tmp/validate-pyproject/.venv/lib/python3.12/site-packages/coveralls/api.py", line 301, in submit_report
    raise CoverallsException(
coveralls.exception.CoverallsException: Could not submit coverage: 422 Client Error: Unprocessable Entity for url: https://coveralls.io/api/v1/jobs

Things to notice: the build runs on Cirrus CI, so I am using the configuration as described in https://coveralls-python.readthedocs.io/en/latest/usage/configuration.html#other-ci-systems (and it has been working so far until recently).

To Reproduce
This is a script that tries to reproduce locally what we verify in https://cirrus-ci.com/task/6209238735781888:

> docker run --rm -it python:3.12-bookworm /bin/bash

git clone https://github.com/abravalheri/validate-pyproject /tmp/validate-pyproject
cd /tmp/validate-pyproject
python3 -m venv .venv
.venv/bin/python -VV
# Python 3.12.3 (main, Apr 24 2024, 11:17:35) [GCC 12.2.0]

.venv/bin/python -c 'import os, sys; print(os.name, sys.platform, getattr(sys, "abiflags", None))'
# posix linux

.venv/bin/python -m pip install -U pip
.venv/bin/python -m pip -VV
# pip 24.0 from /tmp/validate-pyproject/.venv/lib/python3.12/site-packages/pip (python 3.12)

.venv/bin/python -m pip install -U tox 'coveralls==4.0.0' coverage
.venv/bin/python -m pip list
# Package            Version
# ------------------ --------
# cachetools         5.3.3
# certifi            2024.2.2
# chardet            5.2.0
# charset-normalizer 3.3.2
# colorama           0.4.6
# coverage           7.4.4
# coveralls          4.0.0
# distlib            0.3.8
# docopt             0.6.2
# filelock           3.14.0
# idna               3.7
# packaging          24.0
# pip                24.0
# platformdirs       4.2.1
# pluggy             1.5.0
# pyproject-api      1.6.1
# requests           2.31.0
# tox                4.15.0
# urllib3            2.2.1
# virtualenv         20.26.1
.venv/bin/tox -- -n 5 --randomly-seed=42 -rfEx --durations 10 --color yes

export COVERALLS_REPO_TOKEN=<redacted>
export CI_NAME=local-test
export CI_BRANCH=pre-commit-ci-update-config
export CI_PULL_REQUEST=168
export CI_BUILD_NUMBER=1
export CI_BUILD_URL=https://127.0.0.1:8888/build/${CI_BUILD_NUMBER}

.venv/bin/coverage xml -o coverage.xml
.venv/bin/coveralls --verbose --submit coverage.xml
# Missing .coveralls.yml file. Using only env variables.
# Error running coveralls: Could not submit coverage: 422 Client Error: Unprocessable Entity for url: https://coveralls.io/api/v1/jobs
# Traceback (most recent call last):
#   File "/tmp/validate-pyproject/.venv/lib/python3.12/site-packages/coveralls/api.py", line 298, in submit_report
#     response.raise_for_status()
#   File "/tmp/validate-pyproject/.venv/lib/python3.12/site-packages/requests/models.py", line 1021, in raise_for_status
#     raise HTTPError(http_error_msg, response=self)
# requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://coveralls.io/api/v1/jobs
#
# The above exception was the direct cause of the following exception:
#
# Traceback (most recent call last):
#   File "/tmp/validate-pyproject/.venv/lib/python3.12/site-packages/coveralls/cli.py", line 88, in main
#     coverallz.submit_report(report_file.read())
#   File "/tmp/validate-pyproject/.venv/lib/python3.12/site-packages/coveralls/api.py", line 301, in submit_report
#     raise CoverallsException(
# coveralls.exception.CoverallsException: Could not submit coverage: 422 Client Error: Unprocessable Entity for url: https://coveralls.io/api/v1/jobs

Expected Behavior
There should be no HTTP/API errors when submitting coverage reports.

Package Versions

coverage           7.4.4
coveralls          4.0.0

Pytest plugins:

cov-5.0.0, xdist-3.6.1, randomly-3.15.0

Packages inside of the tox environment:

.tox/default/bin/python -m pip list
Package            Version
------------------ -------------------------
coverage           7.5.1
execnet            2.1.1
fastjsonschema     2.19.1
iniconfig          2.0.0
markdown-it-py     3.0.0
mdurl              0.1.2
packaging          24.0
pip                24.0
pluggy             1.5.0
pytest             8.2.0
pytest-cov         5.0.0
pytest-randomly    3.15.0
pytest-xdist       3.6.1
PyYAML             6.0.1
repo_review        0.11.0
setuptools         69.5.1
trove-classifiers  2024.4.10

Trace Logs
Provide coverage logs w/ DEBUG logging enabled (run coverage debug ...)

I am running pytest-cov instead of coverage.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions