codecov / codecov-exe

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

(400) bad request from EC2 #72

Closed roozbehid-ic closed 4 years ago

roozbehid-ic commented 5 years ago

I have a server in EC2 and this is what I get

`

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

2019-06-27 16:30:07 WRN No CI detected. 2019-06-27 16:30:07 INF Git detected. 2019-06-27 16:30:08 INF Project root: C:\projects\media-server 2019-06-27 16:30:08 INF Reading reports. 2019-06-27 16:30:08 INF coverage.xml 2019-06-27 16:30:08 INF Uploading Reports. 2019-06-27 16:30:08 INF url: https://codecov.io 2019-06-27 16:30:08 VRB api endpoint: https://codecov.io/upload/v4?branch=&commit=13123123213&build=&tag=&pr=&name=&flags=&slug=%2Frh&token=2313123213&package=exe-1.5.0&build_url=&yaml=codecov.yml&job=&service= 2019-06-27 16:30:08 INF query: https://codecov.io/upload/v4?branch=&commit=12121212&build=&tag=&pr=&name=&flags=&slug=%2Frh&package=exe-1.5.0&build_url=&yaml=codecov.yml&job=&service= 2019-06-27 16:30:08 INF Pinging Codecov 2019-06-27 16:30:08 VRB Trying to upload using HttpWebRequest. 2019-06-27 16:30:09 VRB One or more errors occurred. (The remote server returned an error: (400) Bad Request.) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at Codecov.Upload.HttpWebRequest.Post() in C:\projects\codecov-exe\Source\Codecov\Upload\HttpWebRequest.cs:line 32 at Codecov.Upload.Upload.Uploader() in C:\projects\codecov-exe\Source\Codecov\Upload\Upload.cs:line 28 2019-06-27 16:30:09 VRB Uploader failed. 2019-06-27 16:30:09 VRB Trying to upload using WebClient. 2019-06-27 16:30:09 VRB The remote server returned an error: (400) Bad Request. at System.Net.HttpWebRequest.GetResponse() at System.Net.WebClient.GetWebResponse(WebRequest request) at System.Net.WebClient.DownloadBits(WebRequest request, Stream writeStream) at System.Net.WebClient.UploadBits(WebRequest request, Stream readStream, Byte[] buffer, Int32 chunkSize, Byte[] header, Byte[] footer) at System.Net.WebClient.UploadDataInternal(Uri address, String method, Byte[] data, WebRequest& request) at System.Net.WebClient.UploadString(Uri address, String method, String data) at Codecov.Upload.WebClient.Post() in C:\projects\codecov-exe\Source\Codecov\Upload\WebClient.cs:line 26 at Codecov.Upload.Upload.Uploader() in C:\projects\codecov-exe\Source\Codecov\Upload\Upload.cs:line 28 2019-06-27 16:30:09 VRB Uploader failed. 2019-06-27 16:30:09 FTL Failed to upload the report. at Codecov.Upload.Uploads.Uploader() in C:\projects\codecov-exe\Source\Codecov\Upload\Uploads.cs:line 35 at Codecov.Program.UploadFacade.Uploader() in C:\projects\codecov-exe\Source\Codecov\Program\UploadFacade.cs:line 121 at Codecov.Program.Run.Uploader() in C:\projects\codecov-exe\Source\Codecov\Program\Run.cs:line 51 at Codecov.Program.Run.Runner(IEnumerable1 args) in C:\projects\codecov-exe\Source\Codecov\Program\Run.cs:line 19

`

AdmiringWorm commented 5 years ago

I am sorry, but there is not enough information for me to go on here.

Assuming you have only edited out the commit and the token from the urls (and those are valid), you also are missing the branch name as well.

Running codecov-exe is not fully supported automatically when there isn't a supported CI deteced, because of this you need to specify all necessary information through command line parameters (most likely only the --branch parameter is needed, due to codecov not picking up the branch name itself, including the --token argument).

AdmiringWorm commented 5 years ago

Also, make sure that the commit exists in the remote repository that you run codecov on. Otherwise, the server can't set the status for the commit (assumption). That could also be the cause of the 400 bad request error.

AdmiringWorm commented 5 years ago

It is also possible that you are hitting upon a different issue that relates to not falling back to the previous v2 upload url.

This is now supported in the latest version (1.6.0) which I just submitted.

AdmiringWorm commented 4 years ago

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