codecov / codecov-exe

.exe report uploader for Codecov https://codecov.io
MIT License
25 stars 21 forks source link

Codecov.exe returns 400 (bad request) #30

Closed horenmar closed 4 years ago

horenmar commented 6 years ago

I am trying to upload cobertura xmls from AppVeyor server, using codecov.exe like this: codecov -f cobertura1.xml cobertura2.xml cobertura3.xml cobertura4.xml cobertura5.xml. No token because according my understanding of the documentation, codecov.exe shouldn't require token for public AppVeyor builds.

I installed from chocolatey, version 1.0.1

Relevant part of the logs:

[00:02:55] 
[00:02:56] 
[00:02:56]               _____          _
[00:02:56]              / ____|        | |
[00:02:56]             | |     ___   __| | ___  ___ _____   __
[00:02:56]             | |    / _ \ / _  |/ _ \/ __/ _ \ \ / /
[00:02:56]             | |___| (_) | (_| |  __/ (_| (_) \ V /
[00:02:56]              \_____\___/ \____|\___|\___\___/ \_/
[00:02:56]                                          exe-1.0.1
[00:02:56]             
[00:02:56] 2017-11-28 08:12:17 [Information] AppVeyor detected.
[00:02:56] 2017-11-28 08:12:17 [Warning] No VCS detected.
[00:02:56] 2017-11-28 08:12:17 [Information] Project root: C:\projects\catch2\Build
[00:02:56] 2017-11-28 08:12:17 [Information] Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
[00:02:56] 2017-11-28 08:12:17 [Information] Reading reports.
[00:02:56] 2017-11-28 08:12:17 [Information] cobertura1.xml
[00:02:56] cobertura2.xml
[00:02:56] cobertura3.xml
[00:02:56] cobertura4.xml
[00:02:56] cobertura5.xml
[00:02:56] 2017-11-28 08:12:17 [Information] Uploading Reports.
[00:02:56] 2017-11-28 08:12:18 [Information] url: https://codecov.io
[00:02:56] 2017-11-28 08:12:18 [Information] query: https://codecov.io/upload/v4?branch=dev-appveyor-coverage&commit=84fd45c2c54f0d032857baa1ed404ce05ac14c03&build=0bsavgpucd4lvgja&tag=&pr=&name=&flags=&slug=catchorg%2FCatch2&token=&package=exe-1.0.1&build_url=&yaml=&job=CatchOrg%2Fcatch2%2Fdev-appveyor-coverage - 84fd45c2c54f0d032857baa1ed404ce05ac14c03&service=appveyor
[00:02:56] 2017-11-28 08:12:18 [Information] Pinging Codecov
[00:02:57] 2017-11-28 08:12:19 [Fatal] One or more errors occurred. (The remote server returned an error: (400) Bad Request.)
[00:02:57]    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
[00:02:57]    at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
[00:02:57]    at Codecov.Upload.Upload.Uploader() in C:\Users\Administrator\github\codecov-exe\Source\Codecov\Upload\Upload.cs:line 34
[00:02:57]    at Codecov.Program.UploadFacade.Uploader() in C:\Users\Administrator\github\codecov-exe\Source\Codecov\Program\UploadFacade.cs:line 119
[00:02:57]    at Codecov.Program.Run.Runner(IEnumerable`1 args) in C:\Users\Administrator\github\codecov-exe\Source\Codecov\Program\Run.cs:line 20
[00:02:58] Build success

Link to the build

larzw commented 6 years ago

Thanks for reporting this @horenmar

axunonb commented 6 years ago

Same problem here in version 1.03. Error throws in line 28 of Upload.cs (Post() fails). One or more errors occurred. (The remote server returned an error: (400) Bad Request.) Url: https://codecov.io/upload/v4?branch=&commit=&build=&tag=&pr=&name=&flags=&slug=&token=TOKEN-GOES-HERE&package=exe-1.0.3&build_url=&yaml=&job=&service=

baynezy commented 6 years ago

I am seeing this issue too (AppVeyor Build)

Any updates?

AdmiringWorm commented 6 years ago

@baynezy no real update on this issue yet, but for you it seems you were hitting a different issue: #32

AdmiringWorm commented 6 years ago

@horenmar @axunonb @baynezy Would it be possible for you guys to test out the latest release (v 1.0.5) and let me know if this still is occurring for you?

I believe that this could possibly have been fixed in a later version.

baynezy commented 6 years ago

@AdmiringWorm - so I ran it again. It doesn't 400 anymore, but the URL I am given back in the response 404s.

             / ____|        | |
            | |     ___   __| | ___  ___ _____   __
            | |    / _ \ / _  |/ _ \/ __/ _ \ \ / /
            | |___| (_) | (_| |  __/ (_| (_) \ V /
             \_____\___/ \____|\___|\___\___/ \_/
                                         exe-1.0.5

2018-07-23 20:07:43 INF AppVeyor detected.
2018-07-23 20:07:44 INF Git detected.
2018-07-23 20:07:45 INF Project root: C:\projects\html2markdown
2018-07-23 20:07:45 INF Reading reports.
2018-07-23 20:07:45 INF .\test\Html2Markdown.Test\Html2Markdown.Test.csproj
2018-07-23 20:07:45 INF Uploading Reports.
2018-07-23 20:07:47 INF url: https://codecov.io
2018-07-23 20:07:49 INF query: https://codecov.io/upload/v4?branch=feature/%2359-issue&commit=99e0b721ac36cbafcb2ae2eb81d2313355f6f77e&build=qsi5erf35o0y6a26&tag=&pr=&name=&flags=&slug=baynezy%2FHtml2Markdown&token=&package=exe-1.0.5&build_url=&yaml=codecov.yml&job=baynezy%2Fhtml2markdown%2F3.2.1.352&service=appveyor
2018-07-23 20:07:49 INF Pinging Codecov
2018-07-23 20:07:53 INF Uploading to S3 https://codecov.s3.amazonaws.com
2018-07-23 20:07:53 INF View reports at: https://codecov.io/github/baynezy/Html2Markdown/commit/99e0b721ac36cbafcb2ae2eb81d2313355f6f77e
AdmiringWorm commented 6 years ago

~@baynezy I see the reason for why that's happening.~ ~I noticed you are specifying a file with the path to .\test\Html2Markdown.Test\coverage.xml. However, it seems that codecov exe isn't picking up that path and instead using the project file instead.~ ~Can you please verify that the path for the coverage file exist?~

~And if it does, this seems to be a new bug.~ ~Can you open a new issue for that if that is true, please?~

I'll be closing this issue for now though, let me know if the 400 error occurs again and we can re-open it.

EDIT: Scratch that, I see you specifically upload the project file. This isn't what codecov is expecting, which is why you're getting the current error. You'll need to upload the report file itself.

axunonb commented 6 years ago

Still won't work here with v1.0.5

.\tools\codecov -f "..\TestResult.xml" -t "<my-token>

2018-08-02 21:43:57 INF Pinging Codecov
2018-08-02 21:43:59 FTL Failed to upload the report.
   at Codecov.Upload.Uploads.Uploader() in D:\Docs\git\contributing\codecov-exe\Source\Codecov\Upload\Uploads.cs:line 34
   at Codecov.Program.UploadFacade.Uploader() in D:\Docs\git\contributing\codecov-exe\Source\Codecov\Program\UploadFacade.cs:line 119
   at Codecov.Program.Run.Runner(IEnumerable`1 args) in D:\Docs\git\contributing\codecov-exe\Source\Codecov\Program\Run.cs:line 20
AdmiringWorm commented 6 years ago

@axunonb I see. I'll try figuring out what's going on sometime this weekend.

AdmiringWorm commented 5 years ago

A new release of codecov-exe was released just now that I believe fixes this issue. (currently indexing of nuget).

If anyone are able to test out the new changes when nuget is done indexing (Version 1.6.0), I would appreciate it.

brondavies commented 5 years ago

This could have also been what fixed my issue #74

MichaelClerx commented 5 years ago

I'm seeing a 400 error today, after it worked fine for over a year.

https://travis-ci.org/MichaelClerx/myokit/jobs/575105338

==> Uploading

    .url https://codecov.io

    .query commit=d090f1da9991a198923eaea1cb66112acea4c17d&branch=develop&job=575105338&pr=373&service=travis&build=1579.4&slug=MichaelClerx%2Fmyokit&package=py2.0.15

    Pinging Codecov...

Error: HTTP 400

Please upload with the Codecov repository upload token to resolve issue.

This is coming from a public project on travis-ci, so shouldn't need a token?

AdmiringWorm commented 5 years ago

This is coming from a public project on travis-ci, so shouldn't need a token?

It should yes. However you are submitting on the wrong repo it seems, from the look of the output you have captured it seems you are using the python version of codecov which is located here: https://github.com/codecov/codecov-python

AdmiringWorm commented 4 years ago

Closing as it is believed to have been fixed in an earlier version.