Codecov GitHub Action fails: 'Could not find a repository, try using upload token'

Description

Similar to https://github.com/codecov/codecov-action/issues/330 I am getting a failure to build my CI when using the codecov-action repo GitHub Action.

The error is:

Run codecov/codecov-action@v1
  with:
    fail_ci_if_error: true
  env:
    USING_COVERAGE: 3.8
    TOX_PARALLEL_NO_SPINNER: 1
    CONDA_PKGS_DIR: /home/runner/conda_pkgs_dir
/usr/bin/bash codecov.sh -n  -F  -Q github-action-v1.5.2 -Z

  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                              Bash-1.0.3


==> git version 2.32.0 found
==> curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Release-Date: 2020-01-08
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 brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets
==> GitHub Actions detected.
    Env vars used:
      -> GITHUB_ACTIONS:    true
      -> GITHUB_HEAD_REF:   
      -> GITHUB_REF:        refs/heads/master
      -> GITHUB_REPOSITORY: lmmx/impscan
      -> GITHUB_RUN_ID:     1079804835
      -> GITHUB_SHA:        f100b3b655cccd7694c1d0f54022555d9b6e0bcd
      -> GITHUB_WORKFLOW:   CI
    project root: .
    Yaml found at: codecov.yml
==> Running gcov in . (disable via -X gcov)
==> Searching for coverage reports in:
    + .
    -> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
    + ./coverage.xml bytes=47231
==> Appending adjustments
    https://docs.codecov.io/docs/fixing-reports
    + Found adjustments
==> Gzipping contents
        108K	/tmp/codecov.d6DgsW.gz
==> Uploading reports
    url: https://codecov.io
    query: branch=master&commit=f100b3b655cccd7694c1d0f54022555d9b6e0bcd&build=1079804835&build_url=http%3A%2F%2Fgithub.com%2Flmmx%2Fimpscan%2Factions%2Fruns%2F1079804835&name=&tag=&slug=lmmx%2Fimpscan&service=github-actions&flags=&pr=&job=CI&cmd_args=n,F,Q,Z
->  Pinging Codecov
https://codecov.io/upload/v4?package=github-action-v1.5.2-1.0.3&token=secret&branch=master&commit=f100b3b655cccd7694c1d0f54022555d9b6e0bcd&build=1079804835&build_url=http%3A%2F%2Fgithub.com%2Flmmx%2Fimpscan%2Factions%2Fruns%2F1079804835&name=&tag=&slug=lmmx%2Fimpscan&service=github-actions&flags=&pr=&job=CI&cmd_args=n,F,Q,Z
{'detail': ErrorDetail(string='Could not find a repository, try using upload token', 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
100  105k  100   103  100  105k    313   320k --:--:-- --:--:-- --:--:--  320k
100  105k  100   103  100  105k    313   320k --:--:-- --:--:-- --:--:--  320k
    {'detail': ErrorDetail(string='Could not find a repository, try using upload token', code='not_found')}

Commit SHAs

f100b3b655cccd7694c1d0f54022555d9b6e0bcd

Repository

CI/CD or Build URL

Uploader

Codecov Output

See above

Expected Results

I’ve used this in another repo and the upload proceeds fine.

P.S. after re-running 4 times it finally succeeded (?), but this is going to cause problems if it keeps happening so I thought I should report it!

@lmmx this looks to be an older version of the bash uploader, I would recommend bumping up to v2 to use our new uploader.

1 Like

I’m experiencing the same issue, and I’m using the v2 action. I have one repo where everything is working fine (Downgrade Node.js version in workflows · snout-router/router-path@b609ce9 · GitHub) and an almost identical repo where the upload fails every time (Update GitHub Actions workflows · snout-router/regexp@b832c01 · GitHub).

@ezzatron, I pushed some fixes for the uploader and I noticed we started to get commits from you in the past 2 days. Has this been resolved for you?

1 Like

Thanks @tom! Pretty sure my issue is resolved.

I did also add the Codecov GitHub app to the snout-router org just recently too. I kind of did that out of desperation, because I was fairly certain that wasn’t necessary just to upload reports. But things started working after that. So I suppose it could have also been that, but I’m leaning more towards your fixes working :+1:

1 Like

@tom We’ve got the same issue for someone on my team: docs: Fix some typos · bjonkman/openfast@e4c8337 · GitHub

Is it required that GitHub accounts have the Codecov app installed?

@rafmudaf installing the Codecov app should resolve the issue you are running to. It is not required for public projects but ensures API stability between Codecov and GitHub.

@tom Currently, everyone working on my projects who does not have the CodeCov app installed on GitHub is getting the same error message. Could this be due to how I’ve configured the uploader?

@rafmudaf as mentioned in drazisil’s response here that should not be the case. If you are still willing, I’d be happy to take a look as to why this is happening if you still have a repository with us.