Codecov failing with Build has already finished, uploads rejected

Description

When uploading, codecov occasionally fails with {'detail': ErrorDetail(string='Build has already finished, uploads rejected.', code='not_found')}

Commit SHAs

Repository

CI/CD or Build URL

https://app.circleci.com/pipelines/github/mui-org/material-ui/38342/workflows/75fca409-6997-4307-a762-229c86727191/jobs/226389

Uploader

bash <(curl -s https://codecov.io/bash) -Z -F $REACT_DIST_TAG

Codecov Output

https://app.circleci.com/pipelines/github/mui-org/material-ui/38342/workflows/75fca409-6997-4307-a762-229c86727191/jobs/226389/parallel-runs/0/steps/0-112


  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                              Bash-20210129-7c25fce


==> git version 2.11.0 found
==> curl 7.52.1 (x86_64-pc-linux-gnu) libcurl/7.52.1 OpenSSL/1.0.2u zlib/1.2.8 libidn2/0.16 libpsl/0.17.0 (+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL 
==> Circle CI detected.
    project root: .
    Yaml found at: .codecov.yml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
    + .
    -> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
    + ./coverage/lcov.info bytes=270074
==> Appending adjustments
    https://docs.codecov.io/docs/fixing-reports
    + Found adjustments
==> Gzipping contents
        156K	/tmp/codecov.5s4Vdd.gz
==> Uploading reports
    url: https://codecov.io
    query: branch=dependabot%2Fnpm_and_yarn%2Fstylelint-13.11.0&commit=5c237af6fd6d9dd10ee68e143c80a1ff98f83045&build=226389&build_url=&name=&tag=&slug=mui-org%2Fmaterial-ui&service=circleci&flags=stable&pr=25024&job=0&cmd_args=Z,F
->  Pinging Codecov
https://codecov.io/upload/v4?package=bash-20210129-7c25fce&token=secret&branch=dependabot%2Fnpm_and_yarn%2Fstylelint-13.11.0&commit=5c237af6fd6d9dd10ee68e143c80a1ff98f83045&build=226389&build_url=&name=&tag=&slug=mui-org%2Fmaterial-ui&service=circleci&flags=stable&pr=25024&job=0&cmd_args=Z,F
{'detail': ErrorDetail(string='Build has already finished, uploads rejected.', code='not_found')}
404
==> Uploading to Codecov
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
 52  153k  100    97   52 81920    509   420k --:--:-- --:--:-- --:--:--  418k
 52  153k  100    97   52 81920    509   419k --:--:-- --:--:-- --:--:--  418k
    {'detail': ErrorDetail(string='Build has already finished, uploads rejected.', code='not_found')}

Exited with code exit status 1

Expected Results

Passes

Actual Results

Fails

Additional Information

Restarting the build did not reproduce the error: https://app.circleci.com/pipelines/github/mui-org/material-ui/38342/workflows/98194c63-79e9-4cf2-932f-1fdb3469a0cd/jobs/226501

@eps1lon, we made a fix for this. Please let me know if you are still experiencing it.

Thanks for the response!

Will monitor this over the weekend. If it persists, I’ll share the PR. If not, I’ll mark your answer as the solution.