"Unable to locate build via Github Actions API" after switching to v2 action, v1 works fine
See original GitHub issueIssue Description
After receiving an email about the pending deprecation of the bash uploader, I decided to start migrating my repos to use the v2 uploader.
I tried switching one of my repos to the v2 (binary) uploader: https://github.com/chris48s/django-apiblueprint-view/commit/c029baeccc22fccdb28d7936bab2f135831fa65a
Unfortunately the upload is failing with the error:
['error'] Error POSTing to https://codecov.io: 404 {'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}
['error'] There was an error running the uploader: Error uploading to https://codecov.io: Error: Not Found
Full output:
Run codecov/codecov-action@v2
with:
file: ./coverage.xml
env:
pythonLocation: /opt/hostedtoolcache/Python/3.6.15/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.6.15/x64/lib
==> linux OS detected
https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (d8fe17b4f8cf960b7b02a44067aab92681c7a983bdb9542c64624fc8281dfb80 codecov)
==> Running version latest
==> Running version v0.1.5
/home/runner/work/_actions/codecov/codecov-action/v2/dist/codecov -n -Q github-action-2.1.0 -f ./coverage.xml
[2021-10-13T17:39:08.177Z] ['info']
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
Codecov report uploader 0.1.5
[2021-10-13T17:39:08.184Z] ['info'] => Project root located at: /home/runner/work/django-apiblueprint-view/django-apiblueprint-view
[2021-10-13T17:39:08.185Z] ['info'] -> No token specified or token is empty
[2021-10-13T17:39:08.190Z] ['info'] Searching for coverage files...
[2021-10-13T17:39:08.203Z] ['info'] => Found 1 possible coverage files:
./coverage.xml
[2021-10-13T17:39:08.204Z] ['info'] Processing ./coverage.xml...
[2021-10-13T17:39:08.207Z] ['info'] Detected GitHub Actions as the CI provider.
[2021-10-13T17:39:08.208Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-2.1.0-uploader-0.1.5&token=*******&branch=master&build=1338587511&build_url=https%3A%2F%2Fgithub.com%2Fchris48s%2Fdjango-apiblueprint-view%2Factions%2Fruns%2F1338587511&commit=c029baeccc22fccdb28d7936bab2f135831fa65a&job=Run+tests&pr=&service=github-actions&slug=chris48s%2Fdjango-apiblueprint-view&name=&tag=&flags=&parent=
[2021-10-13T17:39:08.375Z] ['error'] Error POSTing to https://codecov.io: 404 {'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}
[2021-10-13T17:39:08.376Z] ['error'] There was an error running the uploader: Error uploading to https://codecov.io: Error: Not Found
As I understand the docs, public repos should still be able to upload coverage from GH actions without a token. I switched the repo back to use the v1 (bash) uploader: https://github.com/chris48s/django-apiblueprint-view/commit/77518ba78fc6c558bf435093f7d0ad00fa880267 and that fixes it.
Full output:
Run codecov/codecov-action@v1
with:
file: ./coverage.xml
env:
pythonLocation: /opt/hostedtoolcache/Python/3.6.15/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.6.15/x64/lib
/usr/bin/bash codecov.sh -n -F -Q github-action-v1.5.2 -f ./coverage.xml
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
Bash-1.0.3
==> git version 2.33.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: chris48s/django-apiblueprint-view
-> GITHUB_RUN_ID: 1338646683
-> GITHUB_SHA: 77518ba78fc6c558bf435093f7d0ad00fa880267
-> GITHUB_WORKFLOW: Run tests
project root: .
Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
-> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
+ ./coverage.xml bytes=7556
==> Appending adjustments
https://docs.codecov.io/docs/fixing-reports
-> No adjustments found
==> Gzipping contents
4.0K /tmp/codecov.VO2yno.gz
==> Uploading reports
url: https://codecov.io
query: branch=master&commit=77518ba78fc6c558bf435093f7d0ad00fa880267&build=1338646683&build_url=http%3A%2F%2Fgithub.com%2Fchris48s%2Fdjango-apiblueprint-view%2Factions%2Fruns%2F1338646683&name=&tag=&slug=chris48s%2Fdjango-apiblueprint-view&service=github-actions&flags=&pr=&job=Run%20tests&cmd_args=n,F,Q,f
-> Pinging Codecov
https://codecov.io/upload/v4?package=github-action-v1.5.2-1.0.3&token=secret&branch=master&commit=77518ba78fc6c558bf435093f7d0ad00fa880267&build=1338646683&build_url=http%3A%2F%2Fgithub.com%2Fchris48s%2Fdjango-apiblueprint-view%2Factions%2Fruns%2F1338646683&name=&tag=&slug=chris48s%2Fdjango-apiblueprint-view&service=github-actions&flags=&pr=&job=Run%20tests&cmd_args=n,F,Q,f
-> Uploading to
https://storage.googleapis.com/codecov/v4/raw/2021-10-13/A8B82823B2FC04B2CBA76CF470EF5EC1/77518ba78fc6c558bf435093f7d0ad00fa880267/c57660b7-23a7-4944-be89-a8854e75f288.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EKKHVKCKHW7KBCGM7IHR55T63V2PAVJWLVFNITJHDU5G6R5IRN3LMWJA%2F20211013%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20211013T175743Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=217f3b2e8acbf722d7fd2b58c9dfadc262cd2dc42920f327d266e44ca1d89237
% 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 1240 0 0 100 1240 0 7337 --:--:-- --:--:-- --:--:-- 7337
-> Reports have been successfully queued for processing at https://codecov.io/github/chris48s/django-apiblueprint-view/commit/77518ba78fc6c558bf435093f7d0ad00fa880267
Issue Analytics
- State:
- Created a year ago
- Reactions:8
- Comments:21 (1 by maintainers)
Top Results From Across the Web
Intermittent "Unable to locate build via Github Actions API"
Most jobs triggered by the same commit fail to upload coverage with “Unable to locate build via Github Actions API”, while a few...
Read more >codecov fails in github actions - Stack Overflow
I had failing builds although I had steps setup correctly. In my case what fixed the builds was to change the "alpine" to...
Read more >Configure CI/CD with GitHub Actions - Azure App Service
2. Build the web app. Deploy, 1. Deploy the web app. Use the Deployment Center. You can quickly get started ...
Read more >7 Github Actions Tricks I Wish I Knew Before I Started
#1: How to Use Github Action Triggers ... The above code is pretty much self explanatory. The workflow will trigger on every pull...
Read more >Update a GitHub version 1 source action to a GitHub version 2 ...
Step 1: Replace your version 1 GitHub action · Under Connection, if you have not already created a connection to your provider, choose...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am not sure to which extent this was fixed because lately I seen more and more random errors like this. https://github.com/ansible-community/ansible-lint/runs/5625894991?check_suite_focus=true
@ssbarnea, what have helped me, and what I thought you suggested was adding token not only to secrets, but to CI yaml as well. Like that:
Have you tried it?