codecov / codecov-action

GitHub Action that uploads coverage to Codecov :open_umbrella:
https://www.codecov.io
MIT License
1.46k stars 205 forks source link

After update to v4, forks cannot upload anymore #1275

Closed bkoelman closed 8 months ago

bkoelman commented 8 months ago

I've added the GITHUB_TOKEN secret to the repository settings. Upload from the repository itself succeeds, but it fails when a PR is opened from a fork. While the log contains "The PR is happening in a forked repo. Using tokenless upload.", it fails with a 500 error.

Full log:

Run codecov/codecov-action@v4
  with:
    fail_ci_if_error: true
    verbose: true
  env:
    DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
    DOTNET_CLI_TELEMETRY_OPTOUT: true
    PGSERVICEFILE: /home/runner/work/_temp/pgdata/pg_service.conf
    DOTNET_ROOT: /usr/share/dotnet
    PACKAGE_VERSION_SUFFIX: try-coverage-upload-from-fork-005[2](https://github.com/json-api-dotnet/JsonApiDotNetCore/actions/runs/7807493985/job/21295968913?pr=1454#step:16:2)[3](https://github.com/json-api-dotnet/JsonApiDotNetCore/actions/runs/7807493985/job/21295968913?pr=1454#step:16:3)
    CODECOV_TOKEN: 
==> linux OS detected
https://cli.codecov.io/latest/linux/codecov.SHA256SUM
Received SHA256SUM 103bfefcc56f76[4](https://github.com/json-api-dotnet/JsonApiDotNetCore/actions/runs/7807493985/job/21295968913?pr=1454#step:16:4)73179e600b96eb81[5](https://github.com/json-api-dotnet/JsonApiDotNetCore/actions/runs/7807493985/job/21295968913?pr=1454#step:16:5)0b0f349ad9483[6](https://github.com/json-api-dotnet/JsonApiDotNetCore/actions/runs/7807493985/job/21295968913?pr=1454#step:16:6)b0f63f03ffac469ad[7](https://github.com/json-api-dotnet/JsonApiDotNetCore/actions/runs/7807493985/job/21295968913?pr=1454#step:16:7)  codecov
Received SHA256SUM signature -----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEJwNOf9uFDgu[8](https://github.com/json-api-dotnet/JsonApiDotNetCore/actions/runs/7807493985/job/21295968913?pr=1454#step:16:8)LGL/gGuyiu13mGkFAmW8+QUACgkQgGuyiu13
mGll6A/8CVDQ3LQaqpgQEIekCJUNKU/+tpF1EGpuUsMi7DZZ0RA6cmazUJFUlZK2
GS7Ptcwly+SYTT+a61SzeVlewPLa47XZIFyC+7tgSO6XgUNlJ+KTevyeL6GG0Qs1
YaciuJv8IHAqaaYT4[9](https://github.com/json-api-dotnet/JsonApiDotNetCore/actions/runs/7807493985/job/21295968913?pr=1454#step:16:9)iKpWE99OME1VXY3fIm4uEHlc4pgnmLv+FNdxnit4AYLGlw
2JHzdDMd5aHlnYYIyYJ9UbM8fFVWgddL1venoYl59NKc5gXjH1/+yPPWz2R+4f22
jZfofI04aEJxNhGinfV5Vykb9asyfMupmLUweArgTIF3wzIEoYo/pK0nVgRBiROE
1hiaH5lti8brA2NF+pzp4+xFEyCU1m/mgN/rj1VRkDs0CW4S86eYWVbfuHEb0ymQ
o7Oe/rST6IjqM72B8eleEdT1DKdeX8DYSXnKvR2J1POyoPMMt/HUoCxphiNOq6Ei
416xOCgqWwOEGbeZ1pxp4Eovf6fffbd2F9MUcJTzgWocOqLh3lZB/EX3G9eLKsyf
WLW3s3NXzajS9j4zEPZxGPmnqAadfm9dzffwokFZnqMTJ7HB4qXH87BPgwPbq8R+
y/1Hv7hHEbJJhbE1fitwHFMg4gfUP6q39VtrfooQSBRYYDzrstowO/L2xsr+AkwW
EQGY70I4SY4XPKKzs8tF3Jch7Oa+xgeNMM1qSGyb2Vjn0KKSDMk=
=jEIQ
-----END PGP SIGNATURE-----

==> Running version latest
gpg: directory '/home/runner/.gnupg' created
gpg: keybox '/home/runner/.gnupg/pubring.kbx' created
gpg: /home/runner/.gnupg/trustdb.gpg: trustdb created
gpg: key 806BB28AED779869: public key "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>" imported
gpg: Total number processed: 1
gpg:               imported: 1

gpg: Signature made Fri Feb  2 14:15:33 2024 UTC
gpg:                using RSA key 27034E7FDB850E0BBC2C62FF806BB28AED779869
gpg: Good signature from "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 2703 4E7F DB85 0E0B BC2C  62FF 806B B28A ED77 9869

==> Running version v0.4.6
==> Running command '/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov -v create-commit'
/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov -v create-commit -C 0458c379a768b2680cd3dda3f207bcc8a572e7b8 -Z
==> Uploader SHASUM verified ([10](https://github.com/json-api-dotnet/JsonApiDotNetCore/actions/runs/7807493985/job/21295968913?pr=1454#step:16:10)3bfefcc56f76473179e600b96eb8150b0f349ad94836b0f63f03ffac469ad7  codecov)
info - 2024-02-06 23:30:36,036 -- ci service found: github-actions
debug - 2024-02-06 23:30:36,036 -- versioning system found: <class 'codecov_cli.helpers.versioning_systems.GitVersioningSystem'>
debug - 2024-02-06 23:30:36,037 -- versioning system found: <class 'codecov_cli.helpers.versioning_systems.GitVersioningSystem'>
debug - 2024-02-06 23:30:36,045 -- Loading config from /home/runner/work/JsonApiDotNetCore/JsonApiDotNetCore/codecov.yml
debug - 2024-02-06 23:30:36,054 -- Starting create commit process --- {"commit_sha": "0458c379a768b2680cd3dda3f207bcc8a572e7b8", "parent_sha": null, "pr": "1454", "branch": "try-coverage-upload-from-fork", "slug": "json-api-dotnet/JsonApiDotNetCore", "token": null, "service": "github", "enterprise_url": null}
info - 2024-02-06 23:30:36,234 -- The PR is happening in a forked repo. Using tokenless upload.
info - 2024-02-06 23:30:41,547 -- Process Commit creating complete
debug - 2024-02-06 23:30:41,548 -- Commit creating result --- {"result": "RequestResult(error=RequestError(code='HTTP Error 500', params={}, description='{\"error\": \"Server Error (500)\"}'), warnings=[], status_code=500, text='{\"error\": \"Server Error (500)\"}')"}
error - 2024-02-06 23:30:41,548 -- Commit creating failed: {"error": "Server Error (500)"}
Traceback (most recent call last):
  File "codecov_cli/main.py", line 81, in <module>
  File "codecov_cli/main.py", line 77, in run
  File "click/core.py", line [11](https://github.com/json-api-dotnet/JsonApiDotNetCore/actions/runs/7807493985/job/21295968913?pr=1454#step:16:11)57, in __call__
  File "click/core.py", line 1078, in main
  File "click/core.py", line 1688, in invoke
  File "click/core.py", line 1434, in invoke
  File "click/core.py", line 783, in invoke
  File "click/decorators.py", line 33, in new_func
  File "codecov_cli/commands/commit.py", line 64, in create_commit
  File "codecov_cli/services/commit/__init__.py", line 39, in create_commit_logic
  File "codecov_cli/helpers/request.py", line [13](https://github.com/json-api-dotnet/JsonApiDotNetCore/actions/runs/7807493985/job/21295968913?pr=1454#step:16:14)3, in log_warnings_and_errors_if_any
NameError: name 'exit' is not defined
[10[18](https://github.com/json-api-dotnet/JsonApiDotNetCore/actions/runs/7807493985/job/21295968913?pr=1454#step:16:19)8] Failed to execute script 'main' due to unhandled exception!
Error: Codecov: Failed to properly create commit: The process '/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov' failed with exit code 1
bkoelman commented 8 months ago

Tried to run again; now it succeeds. I'm leaving this issue open, in case you'd like to investigate. Feel free to close if this was just related to a temporary outage.

thomasrockhu-codecov commented 8 months ago

@bkoelman I think this was due to this incident. Thanks for letting us know!

ssbarnea commented 6 months ago

@thomasrockhu-codecov I am not so sure that is an 'incident' or when it becomes the 'norm'. I see https://github.com/ansible/vscode-ansible/actions/runs/8251804751/job/22569753044?pr=1122 and it seems to randomly happen.

escopecz commented 5 months ago

This is happening over and over every day. Example build: https://github.com/mautic/mautic/actions/runs/8848529286/job/24298910753?pr=13697

Can this issue be reopened?

thomasrockhu-codecov commented 5 months ago

@escopecz you will need to add the Codecov token

escopecz commented 5 months ago

@thomasrockhu-codecov thanks for the suggestion! Can you point me to what's wrong with adding it like this?: https://github.com/mautic/mautic/blob/5.x/.github/workflows/tests.yml#L104

thomasrockhu-codecov commented 5 months ago

@escopecz ahhh, I think you hit an edge case, do you mind opening a new ticket for this?

escopecz commented 5 months ago

@thomasrockhu-codecov sure thing. New issue opened here: https://github.com/codecov/feedback/issues/358