Bash uploader returns error code on appveyor


I’m using the bash uploader on appveyor to upload coverage reports in cobertura format and although it seems to succeed it returns an error code making the CI job fail





Bash upload form within a PowerShell

Commit SHAs


Codecov YAML

  max_report_age: off
  require_ci_to_pass: yes
    after_n_builds: 2
    wait_for_ci: yes
  layout: "diff, files"
  - "test/test.hpp"

Codecov Output

  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
==> Appveyor CI detected.
    project root: C:/projects/nowide-fr98b
    Fixing merge commit SHA
    Yaml found at: codecov.yml
    -> Found 1 reports
==> Detecting git/mercurial file structure
==> Appending build variables
==> Reading reports
    + cobertura.xml bytes=321895
==> Appending adjustments
    + Found adjustments
==> Gzipping contents
==> Uploading reports
    query: branch=develop&commit=49ee87bc7abe98503dcccb79a1f9af7b56e6eb4e&build=5s7ksf6mbytxsykk&
->  Pinging Codecov
->  Uploading to
bash :   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
At line:7 char:3
+   bash -f cobertura.xml -n Appveyor -e APPVEYOR_BUILD_WORK ...
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (  % Total    % ...  Time  Current:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 12280    0     0  100 12280      0  50954 --:--:-- --:--:-- --:--:-- 50954
    -> View reports at
Command executed with exception: 

Steps to Reproduce

Using this code:

  • ps: |
    If (env:COVERAGE -eq "true") { choco install opencppcoverage Invoke-WebRequest -Uri '' -OutFile OpenCppCoverage.exe --quiet --export_type cobertura:cobertura.xml ` --sources {env:APPVEYOR_BUILD_FOLDER} --modules “$PWD” `
    –cover_children --working_dir “$PWD” – ctest -C Debug
    bash -f cobertura.xml -n Appveyor -e APPVEYOR_BUILD_WORKER_IMAGE -X gcov -X search -Z

Expected behavior: [What you expect to happen]

Return with zero exit code

Actual behavior: [What actually happens]

Unknown Exception

Flakiness? [Does this happen all the time or only sometimes?]

Started happing recently but seems to persist (restarted the failing job and it failed again) although only cpp code was changed.

This is strange @Flamefire, could you re-run with the -v argument? I’d like to see a more verbose output here, if possible.

Done. See the job at

Hi @Flamefire, I think it has to do with this

[00:00:57] curl: (3) URL using bad/illegal format or missing URL
[00:00:57] curl: (3) URL using bad/illegal format or missing URL
[00:00:57] curl: (3) URL using bad/illegal format or missing URL

I will be merging in a PR to fix this today, and we will deploy early next week. I’ll update you when this happens.

1 Like

Thanks for your reply. May I kindly ask if the deployment already happened or if there is a new estimate?
I’ll retrigger the PR to verify the result once the happened, but as that takes time too I’d do it rather sooner than later

Hi @Flamefire, we pushed late last night, would you be able to retrigger?

The “URL missing” issue seems to be fixed but it still fails:

I’m puzzled that it shows an exit 0 at the end. Maybe it is the installed TERM trap?

Hello @tom ,

I have been following this thread as we were having the same ‘URL using bad/illegal format or missing URL’ issue.

After you pushed the changes, I do not see any bad URL issue.
However, it still fails.

@Flamefire Thank you for pointing this out.

@Flamefire @apatil19, thinking about how to make this more automated, but you should be able to add -U "-s" -A "-s" to the bash script which will fix the issue.

bash -f cobertura.xml -n Appveyor -e APPVEYOR_BUILD_WORKER_IMAGE -X gcov -X search -Z -v -U "-s" -A "-s"

bash -f "./coverage_pathsfixed.xml" -U "-s" -A "-s"

@tom I can confirm that this is working. I’m a bit puzzled that this is only now required as my CI jobs worked fine till some time around last month ago

Anyway, thanks for your help!

@Flamefire, this is an issue with the way the bash script has been updated and with Powershell. We’re working on a fix to make the extra parameters unnecessary. Sorry for the breakage here, but glad it’s working now.

Hi @tom

Thank you for the prompt response.
With your suggested change, It surely works for me as well.!

I really appreciate the help you have provided.

1 Like

Hi @tom,

Even though our build passes successfully, I am still puzzled how these additional parameters fix the issue.
Is there any document you can point me to, or could you please help me understand?

Hi @apatil19, this deals with the way Powershell handles curl. Apparently, it doesn’t like the curl-like output, so the -s arguments silence them. This is what led me to suggesting the arguments.

Hi @tom,

Thank you.! That helps.!

1 Like