codecov / feedback

A place to discuss feedback about the pull request and web product experience.
37 stars 7 forks source link

GitHub Actions upload failure: Failed to properly create report (status code 202, "msg": "Field required") #577

Closed lbianchi-lbl closed 1 week ago

lbianchi-lbl commented 1 week ago

Describe the bug

Report upload using codecov/codecov-action@v4 on a PR fails with a 202 error code:

error - 2024-11-13 20:17:01,906 -- Report creating failed: [{"input":{"branch":"johnson12742/watertap:johnson12742:looptool_doc","commit_id":"148cb19abef99b1af0b68f3a20a120f042d6c78a","repo_id":13222320,"repo_name":"watertap"},"loc":["id"],"msg":"Field required","type":"missing","url":"https://errors.pydantic.dev/2.4/v/missing"}]

Environment (please complete the following information):

Environment: GitHub Actions (codecov/codecov-action@v4)

Runner information:

Operating System
  Ubuntu
  22.04.5
  LTS
Runner Image
  Image: ubuntu-22.04
  Version: 20241103.1.0

codecov/codecov-action@v4 configuration:

https://github.com/watertap-org/watertap/blob/532ce63868ca0dc949731866a7caa4e9d8c468ac/.github/workflows/checks.yml#L163-L172

To Reproduce

Use codecov/codecov-action@v4 in a GitHub Actions workflow (triggered by a pull_request event) for a public repository

Expected behavior The upload process completes successfully

Screenshots Image

Additional context Add any other context about the problem here.

jagerber48 commented 1 week ago

I think I'm seeing this same issue at https://github.com/lmfit/uncertainties/pull/269. The seems to be related to the PR coming from a forked repo and using tokenless uploading. If I include the token explicitly (instead of as a secret), I've found this error message to go away and the github action job to succeed. However, the coverage reports don't actually appear on codecov.io. I'm confused.

drazisil-codecov commented 1 week ago

Hi @jagerber48 Can you share the SHA for the one that "worked", but isn't showing on Codecov? Can you also check the uploader output and make sure it was uploaded under the same SHA you expected?

jagerber48 commented 1 week ago

@drazisil-codecov what SHA do you mean? https://app.codecov.io/gh/lmfit/uncertainties/commit/332898b6259474896a6d55504623dde3e948e688 here's the codecov page for the last commit that got an upload to appear on codecov.io and this is the github action run https://github.com/lmfit/uncertainties/actions/runs/11812705246/job/32908343823.

The other jobs in that same workflow all have the failed message under discussion in this issue (I think).

larseggert commented 1 week ago

Same issue here:

Linux (https://github.com/mozilla/neqo/actions/runs/11839045971/job/32989585647#step:9:106) and Windows (https://github.com/mozilla/neqo/actions/runs/11839045971/job/32989588896#step:9:152) failing, MacOS still succeeds (https://github.com/mozilla/neqo/actions/runs/11839045971/job/32989587215#step:9:97).

drazisil-codecov commented 1 week ago

Hi @jagerber48 I was referring to this:

If I include the token explicitly (instead of as a secret), I've found this error message to go away and the github action job to succeed. However, the coverage reports don't actually appear on codecov.io.

drazisil-codecov commented 1 week ago

@larseggert Why does it look like the two failing ones are tryingto upload to https://errors.pydantic.dev/2.4/v/missing, instead of Codecov? Am I missing where you are setting an env or override somewhere?

larseggert commented 1 week ago

I don't think so? Haven't touched the CodeCov CI pipeline in a while.

Not an expert on what this output means; to me it looked like the pydantic stuff was an error coming back from CodeCov?

drazisil-codecov commented 1 week ago

@jagerber48 Your failure looks a lot of https://github.com/codecov/engineering-team/issues/2882. I hope to have a chance to dig into that today, but my fellow support engineer is on vacation, so it's been hectic.

drazisil-codecov commented 1 week ago

Not an expert on what this output means; to me it looked like the pydantic stuff was an error coming back from CodeCov?

It did, but I think that's became the CLI was being told that was the upload URL. Can you enable verbose for me please?

larseggert commented 1 week ago

Linux debug run: https://github.com/mozilla/neqo/actions/runs/11839045971/job/32991914319#step:9:153 MacOS debug run: https://github.com/mozilla/neqo/actions/runs/11839045971/job/32991915533#step:9:144 Windows debug run: https://github.com/mozilla/neqo/actions/runs/11839045971/job/32991916742#step:9:199

drazisil-codecov commented 1 week ago

@larseggert Ah, I meant setting verbose: true for the action, sorry. I need it to make more logs πŸ˜…

larseggert commented 1 week ago

It has verbose: true? https://github.com/mozilla/neqo/blob/68e19fc0ae9c906cf98c2a501b95f38e7fc4a7b9/.github/workflows/check.yml#L119

drazisil-codecov commented 1 week ago

It has verbose: true? https://github.com/mozilla/neqo/blob/68e19fc0ae9c906cf98c2a501b95f38e7fc4a7b9/.github/workflows/check.yml#L119

Sorry, I saw the debug logs from GitHub and stopped reading πŸ€¦β€β™€

I think we know what's going on here, and I'm trying to follow the internal Slack thread. For now, I think using the token will fix it, but I expect a fix version soon.

larseggert commented 1 week ago

How do I use the token from a fork?

drazisil-codecov commented 1 week ago

How do I use the token from a fork?

Ugg. You can't. Checking on the fix...

lbianchi-lbl commented 1 week ago

@larseggert Why does it look like the two failing ones are tryingto upload to https://errors.pydantic.dev/2.4/v/missing, instead of Codecov? Am I missing where you are setting an env or override somewhere?

Not sure if this matters, but it looks like the https://errors.pydantic.dev URL is part of the default error message emitted when the Pydantic validation fails (in this specific case, signaling that the field id is missing, i.e. required in the model definition, but not present in the input dict that's being parsed): https://docs.pydantic.dev/2.4/#pydantic-examples

drazisil-codecov commented 1 week ago

Thank you both! https://github.com/codecov/shelter/pull/222 should fix this error, once merged

lbianchi-lbl commented 1 week ago

Thank you both! https://github.com/codecov/shelter/pull/222 should fix this error, once merged

Thanks a lot for looking into this! It looks like I can't access that link (private repository?). Could you notify us here once it happens so we can try to re-run the upload jobs and see if the issue is resolved?

drazisil-codecov commented 1 week ago

oh! πŸ€¦β€β™€

I forgot that repo isn't ready for source available yet. It's merged now and it's Google Cloudrun.... so it's probably a very fast deploy? 🀞

drazisil-codecov commented 1 week ago

oh! πŸ€¦β€β™€

I forgot that repo isn't ready for source available yet. It's merged now and it's Google Cloudrun.... so it's probably a very fast deploy? 🀞

Not yet, sorry.

drazisil-codecov commented 1 week ago

Gah. I forgot to come back. It should be good now.

lbianchi-lbl commented 1 week ago

It looks like our Codecov report upload jobs are now passing, without any changes needed on our side: Image

Thanks again for looking into this. As far as I'm concerned this fully resolves my original issue, but I'll defer the decision to close the issue to you in case you want to get more feedback from the other commenters.

jagerber48 commented 1 week ago

Seems to be working on our end as well, thank you!