codecov / codecov-exe

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

"Failed to upload the report" from AppVeyor #121

Closed petrsvihlik closed 3 years ago

petrsvihlik commented 3 years ago

Hi, we've been collecting code coverage of our project via codecov for some time now. We use it in combination with AppVeyor. Recently, we started getting the following error:

codecov : [FTL] Failed to upload the report. At line:14 char:1

  • codecov -f coverage.xml
  • 
    + CategoryInfo          : NotSpecified: ([FTL] Failed to upload the report.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Codecov.Exceptions.UploadException: Failed to upload the report. at Codecov.Upload.Uploads.Uploader() at Codecov.Program.UploadFacade.Uploader() at Codecov.Program.Run.Uploader() at Codecov.Program.Run.Ru nner(IEnumerable1 args) Command executed with exception: nner(IEnumerable1 args)

I worked around the problem by adding the repository upload token to the environment variables in AppVeyor (even though this shouldn't be required according to the note that says Token not required for public repositories uploading from Travis, CircleCI or AppVeyor.)

Example: ⚠️ Broken build: https://ci.appveyor.com/project/kentico/kontent-delivery-sdk-net/builds/34696564 ✔️ Working build: https://ci.appveyor.com/project/kentico/kontent-delivery-sdk-net/builds/34696695

We use the following PowerShell script to collect the code coverage: https://github.com/Kentico/kontent-delivery-sdk-net/blob/master/coverage.ps1

Were there any changes in Codecov that could cause this behavior?

AdmiringWorm commented 3 years ago

For codecov-exe you should indeed not need to use a token for Travis and AppVeyor (circleCI isn't supported yet in codecov-exe).

I will look into what could potentially be the issue with the uploading, but I think it may be something to do with the build URL being created.

Were there any changes in Codecov that could cause this behavior?

There hasn't been anything AFAIK, but @hootener or @thomasrockhu may be in a better situation of telling us if that could be the case or not.

AdmiringWorm commented 3 years ago

@petrsvihlik would you be able to run codecov-exe with the --verbose argument? This should include the response error from the server, and hopefully narrow down whether my suspicion is correct or not (without having a codecov token available of course).

petrsvihlik commented 3 years ago

@AdmiringWorm yeah, here: https://ci.appveyor.com/project/kentico/kontent-delivery-sdk-net/builds/34720112

interestingly, with the --verbose on it didn't cause the build to fail...but the exception is there.

AppVeyor detected. Git detected. Project root: C:\projects\kontent-delivery-sdk-net Yaml not found, that's ok! Learn more at https://docs.codecov.io/docs/codecov-yaml Reading reports. coverage.xml Uploading Reports. url: https://codecov.io query: https://codecov.io/upload/v4?branch=master&commit=0a2cf0a3627f4a6837b8275254dc2c2f4b94c71c&build=2o6k1ato6d6rb4hm&tag=&pr=&name=&flags=&slug=Kentico%2Fkontent-delivery-sdk-net&token=&package=exe-1.12.2&build_url=https://ci.appveyor.com/project/kentico/kontent-delivery-sdk-net/builds/34720112/job/2o6k1ato6d6rb4hm&yaml=&job=kentico%2Fkontent-delivery-sdk-net%2F9.0.0-preview539&service=appveyor [VRB] Trying to upload using HttpClient Pinging Codecov [VRB] Error during uploading. System.AggregateException: One or more errors occurred. (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) ---> System.Net.Http.HttpRequestException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task`1.get_Result() at Codecov.Upload.CodecovUploader.Post() at Codecov.Upload.Upload.Uploader() [VRB] Uploader failed. Uploading to Codecov View reports at: https://codecov.io/github/Kentico/kontent-delivery-sdk-net/commit/0a2cf0a3627f4a6837b8275254dc2c2f4b94c71c [VRB] response: https://codecov.io/upload/v2?branch=master&commit=0a2cf0a3627f4a6837b8275254dc2c2f4b94c71c&build=2o6k1ato6d6rb4hm&tag=&pr=&name=&flags=&slug=Kentico%2Fkontent-delivery-sdk-net&token=&package=exe-1.12.2&build_url=https://ci.appveyor.com/project/kentico/kontent-delivery-sdk-net/builds/34720112/job/2o6k1ato6d6rb4hm&yaml=&job=kentico%2Fkontent-delivery-sdk-net%2F9.0.0-preview539&service=appveyor

AdmiringWorm commented 3 years ago

Well, the build didn't fail because the fallback uploader was successful.

[VRB] Uploader failed.
Uploading to Codecov
View reports at: https://codecov.io/github/Kentico/kontent-delivery-sdk-net/commit/0a2cf0a3627f4a6837b8275254dc2c2f4b94c71c

That error message is worrying though, I am not even remotely sure where to try looking for the problem even (I tried to reproduce it in a different repo, setting it up similar to yours, but was unsuccessful).

It almost looks to be something on the server-side, considering the exception message mentions it didn't get a proper response.

petrsvihlik commented 3 years ago

I keep getting exceptions every now and then...like this one: https://ci.appveyor.com/project/kentico/kontent-delivery-sdk-net/builds/35571846

            _____          _
            / ____|        | |
            | |     ___   __| | ___  ___ _____   __
            | |    / _ \ / _  |/ _ \/ __/ _ \ \ / /
            | |___| (_) | (_| |  __/ (_| (_) \ V /
            \_____\___/ \____|\___|\___\___/ \_/
            exe-1.12.3+efce6080b174adb74fb671e7908381c6b4ba1039

AppVeyor detected.
Git detected.
Project root: C:\projects\kontent-delivery-sdk-net
Yaml not found, that's ok! Learn more at https://docs.codecov.io/docs/codecov-yaml
Reading reports.
coverage.xml
Uploading Reports.
url: https://codecov.io
query: https://codecov.io/upload/v4?branch=feature%2Fsource-tracking-header&commit=06ad3a1d87ee90b38b973dd0f8cebc255a5e2c3f&build=5n75pmybqs42kcqn&tag=&pr=&name=&flags=&slug=Kentico%2Fkontent-delivery-sdk-net&package=exe-1.12.3+efce6080b174adb74fb671e7908381c6b4ba1039&build_url=https://ci.appveyor.com/project/kentico/kontent-delivery-sdk-net/builds/35571846/job/5n75pmybqs42kcqn&yaml=&job=kentico%2Fkontent-delivery-sdk-net%2F9.0.0-preview598&service=appveyor
[VRB] Trying to upload using HttpClient
Pinging Codecov
Uploading
[VRB] response: https://codecov.io/github/Kentico/kontent-delivery-sdk-net/commit/06ad3a1d87ee90b38b973dd0f8cebc255a5e2c3f
https://storage.googleapis.com/codecov/v4/raw/2020-10-05/AE0D05F1CBDA70DFD0B04CB6A886BBB1/06ad3a1d87ee90b38b973dd0f8cebc255a5e2c3f/43488b5b-8f1c-4b95-892d-2d119aadef5d.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EQX6OZVJGHKK3633AAFGLBUCOOATRACRQRQF6HMSMLYUP6EAD6XSWAAY%2F20201005%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20201005T115543Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=1949188723db5e0432af01b5c72f1b5ea0763c3b3eb3a4075cd567d90a0a47df
Uploading to S3 https://storage.googleapis.com
View reports at: https://codecov.io/github/Kentico/kontent-delivery-sdk-net/commit/06ad3a1d87ee90b38b973dd0f8cebc255a5e2c3f
Command executed with exception: 
AdmiringWorm commented 3 years ago

@petrsvihlik that is not any exception caused by codecov. From looking at your build log this is your problem: https://ci.appveyor.com/project/kentico/kontent-delivery-sdk-net/builds/35571846#L1092

It isn't noticed until codecov have executed though, due to the way you set the exit code.

petrsvihlik commented 3 years ago

oh, true. please disregard my last comment :)

thomasrockhu commented 3 years ago

Closing this out as it looks resolved. Feel free to re-open if I'm wrong.