codecov-action icon indicating copy to clipboard operation
codecov-action copied to clipboard

Not valid tokenless upload

Open greg0ire opened this issue 1 year ago • 13 comments
trafficstars

I believe this has been happening for a few weeks now, but many of our PRs using tokenless upload (they are PRs from open source forks) fail with Report creating failed: {"detail":"Not valid tokenless upload"}

Here is an example: https://github.com/doctrine/dbal/actions/runs/9554014292/job/26334506168

greg0ire avatar Jun 18 '24 15:06 greg0ire

@joseph-sentry do you mind taking a look here?

thomasrockhu-codecov avatar Jun 18 '24 16:06 thomasrockhu-codecov

@thomasrockhu-codecov since we made the API changes for the new tokenless, unless a user is using the updated CLI (which hasn't been released yet) and the updated action, tokenless won't work

joseph-sentry avatar Jun 18 '24 19:06 joseph-sentry

Hi, I encounter a similar issue.

The new CLI version was released recently (https://github.com/codecov/codecov-cli/releases/tag/v0.7.0), but my problem still occurs.

Here's the failed log of a fork PR in the stylelint repo (https://github.com/stylelint/stylelint/pull/7777):

==> Fork detected, tokenless uploading used

at https://github.com/stylelint/stylelint/actions/runs/9605083708/job/26494382161?pr=7777#step:7:16

==> Running version v0.7.0

at https://github.com/stylelint/stylelint/actions/runs/9605083708/job/26494382161?pr=7777#step:7:33

Error: Codecov token not found. Please provide Codecov token with -t flag.

at https://github.com/stylelint/stylelint/actions/runs/9605083708/job/26494382161?pr=7777#step:7:44

It would be great if you could help. Thanks. 🙏🏼

ybiquitous avatar Jun 20 '24 23:06 ybiquitous

In addition, here's a successful log with the CLI v0.6.0:

==> Running version v0.6.0

at https://github.com/stylelint/stylelint/actions/runs/9601142978/job/26479023288?pr=7776#step:7:33

ybiquitous avatar Jun 20 '24 23:06 ybiquitous

Looks like this is introduced by the Codecov CLI v0.7.0. ~~Since the GPG SUM of v0.6.0 does not exist any more, is it possible to reset the Codecov CLI back to 0.6.0 without checking the GPG sum?~~ Downgrade CLI to v0.6.0 works.

qweeah avatar Jun 21 '24 01:06 qweeah

We have the same issue with Apport. Example failed upload: https://github.com/canonical/apport/actions/runs/9506858733/job/26508430770?pr=355

bdrung avatar Jun 21 '24 08:06 bdrung

Hi all, indeed tokenless uploads were broken for v0.7.0 of the CLI, we just released v0.7.1 which should fix that bug. If you've already versioned to v0.6.0, that should work fine as well.

joseph-sentry avatar Jun 21 '24 16:06 joseph-sentry

@joseph-sentry Thanks for the quick patch! I'll try it soon. 👍🏼

By the way, the release notes and the changelog link seem incorrect to me in https://github.com/codecov/codecov-cli/releases/tag/v0.7.1 because of too many items. 👀

ybiquitous avatar Jun 21 '24 16:06 ybiquitous

@joseph-sentry Unfortunately, the problem doesn't seem to be resolved. 😢

Error: Codecov token not found. Please provide Codecov token with -t flag.

https://github.com/stylelint/stylelint/actions/runs/9617068584/job/26528019385?pr=7783#step:7:44

PR: https://github.com/stylelint/stylelint/pull/7783


EDIT: I confirmed v0.7.1 was used:

==> Running version v0.7.1

https://github.com/stylelint/stylelint/actions/runs/9617068584/job/26528019385?pr=7783#step:7:33

ybiquitous avatar Jun 21 '24 16:06 ybiquitous

@ybiquitous would you mind trying to re-run again? I think this may have just been a caching thing on our side

thomasrockhu-codecov avatar Jun 26 '24 14:06 thomasrockhu-codecov

@thomasrockhu-codecov - We tried 0.7.1 and are still getting the issue: https://github.com/Pyomo/pyomo/actions/runs/9682305560/job/26718272498?pr=3303

mrmundt avatar Jun 26 '24 16:06 mrmundt

@thomasrockhu-codecov Thanks for your reply. Uploading is now successful! 🎉

Here's the log: ⬇️

==> Fork detected, tokenless uploading used

https://github.com/stylelint/stylelint/actions/runs/9688239908/job/26734397467?pr=7804#step:7:10

==> Running version v0.7.1

https://github.com/stylelint/stylelint/actions/runs/9688239908/job/26734397467?pr=7804#step:7:33

info - 2024-06-26 23:42:35,916 -- Your upload is now processing. When finished, results will be available at: https://app.codecov.io/github/stylelint/stylelint/commit/da38c532a0f23843b24f723f664a8ec187a9538c
info - 2024-06-26 23:42:36,095 -- Process Upload complete

https://github.com/stylelint/stylelint/actions/runs/9688239908/job/26734397467?pr=7804#step:7:54

ybiquitous avatar Jun 26 '24 23:06 ybiquitous

@greg0ire @qweeah @bdrung @mrmundt we made some changes to the Action and CLI, would you mind uploading again and see if you are running into the issue?

thomasrockhu-codecov avatar Jun 28 '24 15:06 thomasrockhu-codecov

@thomasrockhu-codecov I've tried re-running the build in my original message, and sadly, the result appears to be the same: https://github.com/doctrine/dbal/actions/runs/9554014292/job/26861037163

The output indicates that 0.7.2 was in use.

greg0ire avatar Jun 30 '24 17:06 greg0ire

@thomasrockhu-codecov Switched to v0.7.2 and the upload is successful, thank you all for the quick response.

qweeah avatar Jul 01 '24 01:07 qweeah

@thomasrockhu-codecov - Also still not working over here: https://github.com/Pyomo/pyomo/actions/runs/9751098274/job/26913971560?pr=3303

mrmundt avatar Jul 01 '24 22:07 mrmundt

I'm stuck on this as well. Specifying the v0.6.0 downgrade doesn't solve it. I still get:

Commit creating failed: {"detail":"Not valid tokenless upload"}

Here's the failing job: https://github.com/aravinda0/qtile-bonsai/actions/runs/9873228232/job/27272344047

aravinda0 avatar Jul 10 '24 14:07 aravinda0

In case this helps anyone else: our (Pyomo) problem was that we upload from multiple sources (GHA, Jenkins), and the uploader used on Jenkins was outdated / causing issues. Once we switched to a the codecov-cli uploader, our problems were resolved.

mrmundt avatar Jul 10 '24 14:07 mrmundt

~~Also failing for me: https://github.com/NethermindEth/juno/actions/runs/9870665136/job/27256902195~~

~~It doesn't even detect that it's a forked repo, am I missing anything??~~

Edit: It turns out I was using an older version, v4.2.0. Updating it to the latest v4.5.0 fixed the problem.

derrix060 avatar Jul 12 '24 13:07 derrix060

This issue has been patched. Please open a new issue if problems arise.

trent-codecov avatar Jul 30 '24 14:07 trent-codecov

@trent-codecov I'm still experiencing the issue, and I'm not sure what I need to upgrade in order to obtain the patch, if it has been released. I see the latest tag on this repo is from June, but maybe the fix was contributed in a dependency?

greg0ire avatar Aug 13 '24 18:08 greg0ire

@greg0ire I think you need to remove the double-quotes from this line

thomasrockhu-codecov avatar Aug 13 '24 19:08 thomasrockhu-codecov

@thomasrockhu-codecov that line is not used at all when using tokenless upload, is it?

As you can see, that line does it job when the upload is not tokenless

greg0ire avatar Aug 14 '24 06:08 greg0ire

@thomasrockhu-codecov sorry for doubting you, the fix you suggested appears to work: https://github.com/doctrine/dbal/pull/6501

I don't understand why, could you please explain?

greg0ire avatar Aug 15 '24 14:08 greg0ire

@greg0ire I actually need to dig in and figure it out for myself, but it smelled like an empty string vs null value thing. I would assume somewhere (probably CLI), we take "" to mean you want to use that as the token. That's probably a bug on our side, but I wanted to unblock you quickly.

thomasrockhu-codecov avatar Aug 15 '24 18:08 thomasrockhu-codecov

Thank you! null vs string does make sense, since the secret is probably null in the case of a fork 👍

greg0ire avatar Aug 15 '24 19:08 greg0ire

@thomasrockhu-codecov I'm sad to say that this job failed with the infamous "Not valid tokenless upload". It contains my commit that removes the quotes, I checked.

greg0ire avatar Aug 17 '24 10:08 greg0ire

@greg0ire just checking, was this during our outage?

thomasrockhu-codecov avatar Aug 19 '24 17:08 thomasrockhu-codecov

I don't think so, your outage was marked as resolved on Aug 17, 2024 - 03:58 UTC , and the job failed later the same day at 11:46 GMT+2

greg0ire avatar Aug 19 '24 20:08 greg0ire