Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while uploading to Codecov (Not Found) #222

Closed
jlimas opened this issue Jul 20, 2021 · 13 comments
Closed

Error while uploading to Codecov (Not Found) #222

jlimas opened this issue Jul 20, 2021 · 13 comments
Assignees

Comments

@jlimas
Copy link

jlimas commented Jul 20, 2021

We started getting the following error message on our Bitbucket Pipelines.

Detected Bitbucket as the CI provider.
Pinging Codecov: https://codecov.io/upload/v4?package=uploader-0.1.0&token=*******....................
Error!: Error: Error uploading to https://codecov.io: Error: Error uploading to Codecov: Error: Not Found

Didn't see any incident on your website regarding this.

@TriplEight
Copy link

TriplEight commented Jul 20, 2021

I'm getting the same:

codecov --token "$CODECOV_TOKEN" --file lcov-w-branch.info --nonZero
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/
  Codecov report uploader 0.1.0
=> Project root located at: /builds/parity/ink
Processing lcov-w-branch-fixed.info...
Detected GitLab CI as the CI provider.
Pinging Codecov: https://codecov.io/upload/v4?package=uploader-0.1.0&token=*******&branch=863&build=1021957&build_url=&commit=fc6e87b1cf458139f9cf869bfbbfa45c93d426a8&job=&pr=&service=gitlab&slug=parity/ink&name=&tag=&flags=&parent=
Error!: Error: Error uploading to https://codecov.io: Error: Error uploading to Codecov: Error: Not Found

@thomasrockhu
Copy link
Contributor

@jlimas I made an update to the uploader, would you mind trying to see if you are still experiencing the issue?

@jlimas
Copy link
Author

jlimas commented Jul 21, 2021

Hello @thomasrockhu thanks for the follow up, I'm doing a test right now downloading the tool with this command and the env has the CODECOV_TOKEN setup correctly.

curl -Os https://uploader.codecov.io/latest/linux/codecov
./codecov -t ${CODECOV_TOKEN} -f reports/workflows-interpreter.xml

Not sure if this latest build includes the update you mention but the output still is the same.

Processing reports/xxxxxx-xxxxxxx.xml...
Detected Local as the CI provider.
Pinging Codecov: https://codecov.io/upload/v4?package=uploader-0.1.0&token=*******&branch=develop&build=&build_url=&commit=65c152d8d3340c59a1983da1e77a2889f5551418&job=&pr=&service=&slug=xxxxxxxxx/workflows&name=&tag=&flags=&parent=
Error!: Error: Error uploading to https://codecov.io: Error: Error uploading to Codecov: Error: Bad Request

@thomasrockhu thomasrockhu self-assigned this Jul 21, 2021
@drazisil-codecov
Copy link
Contributor

Error!: Error: Error uploading to https://codecov.io: Error: Error uploading to Codecov: Error: Not Found

That is a disgusting amount of nested throws. 🤦‍♀️

@drazisil-codecov
Copy link
Contributor

I received a note from another customer that the action is working, are you still seeing this error when running the uploader directly? Either way, I'm adding better logging.

@RA80533
Copy link
Contributor

RA80533 commented Jul 22, 2021

"Not Found" (404) and "Bad Request" (400) are errors delivered from the server. Was there a recent change on the backend?

@drazisil-codecov
Copy link
Contributor

"Not Found" (404) and "Bad Request" (400) are errors delivered from the server. Was there a recent change on the backend?

No. I'm operating on the assumption that we are passing bad values. Trust me here, please.

@jlimas
Copy link
Author

jlimas commented Jul 22, 2021

It's really weird because we use it in bitbucket pipelines and for some branches the upload works and for others it shows that error message, it would be useful to know what Not Found means, I'm guessing it's not about the URL.

@jlimas
Copy link
Author

jlimas commented Jul 22, 2021

I'm trying to replicate the issue directly on my computer again using the bin downloaded from this location

curl -Os https://uploader.codecov.io/latest/linux/codecov

image

@RA80533
Copy link
Contributor

RA80533 commented Jul 22, 2021

function validateToken(token) {
return validator.isAlphanumeric(token)
}

The validation is too strict. It's probably not necessary to perform this kind of validation on the client since it's not authoritative with regards to whatever tokens are actually being issued. Furthermore, whatever validation is occurring here would have to occur on the server anyway—keeping track of the validation logic in both places is cumbersome and often error-prone.

It might be a good idea to fail early if a value exists but just isn't valid since it indicates there to be some issue with input on the user's end that should be communicated rather than implicitly forgotten through a fallback.

for (const option of options) {
if (option[0] && validateHelpers.validateToken(option[0])) {
log(`-> Token set by ${option[1]}`)
return option[0]
}
}

uploader/src/index.js

Lines 88 to 91 in 677c7ca

const token = await tokenHelpers.getToken(inputs, projectRoot)
if (token === '') {
log('-> No token specified or token is empty')
}

@jlimas
Copy link
Author

jlimas commented Jul 22, 2021

Maybe use isUUID(str [, version]) | check if the string is a UUID (version 3, 4 or 5). since it seems your tokens are UUID Version 4, just not sure if all the tokens are the same.

@thomasrockhu
Copy link
Contributor

Hi all, we have deployed another fix for this which should be live shortly

This was referenced Jul 22, 2021
@jlimas
Copy link
Author

jlimas commented Jul 22, 2021

Yes! That was it. Thanks a lot for the great support, keep it up guys.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants