Closed blueyed closed 3 years ago
Using the previously working version (https://raw.githubusercontent.com/codecov/codecov-bash/5ad85e34cb5e93e330220d746997f53efaab8e7d/codecov) now also fails:
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
Bash-tbd
==> git version 2.26.2.windows.1 found
==> curl 7.55.1 (Windows) libcurl/7.55.1 WinSSL
Release-Date: [unreleased]
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL
==> Appveyor CI detected.
project root: C:/projects/pdbpp
Yaml found at: codecov.yml
-> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
+ coverage-ci.xml bytes=97234
==> Gzipping contents
12K /tmp/codecov.I3LsRn.gz
==> Uploading reports
url: https://codecov.io
query: branch=master&commit=b95f82de1cf8dc38a97e77a3f23e2eb6d3d50163&build=765sql0hx1m39yq3&build_url=https%3A%2F%2Fci.appveyor.com%2Fproject%2Fpdbpp%2Fpdbpp%2Fbuilds%2F38526803%2Fjob%2F765sql0hx1m39yq3&name=py27-coverage-Windows&tag=&slug=pdbpp%2Fpdbpp&service=appveyor&flags=AppVeyor,Windows&pr=435&job=blueyed%2Fpdbpp%2F1.0.237&cmd_args=Z,X,X,f,n,F
==> Uploading to Codecov
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8456 100 227 100 8229 227 8229 0:00:01 --:--:-- 0:00:01 11274
{"message": "Coverage reports upload successfully", "uploaded": true, "queued": true, "id": "f45744a1-2d69-4cc1-b220-f7e94f02ed17", "url": "https://codecov.io/github/pdbpp/pdbpp/commit/b95f82de1cf8dc38a97e77a3f23e2eb6d3d50163"}
Therefore this appears to be an issue due to the server's response / and/or curl's output having changed?
Yeah, it fails to parse the server's response:
==> Uploading to Codecov
++ curl -X POST --data-binary @/tmp/codecov.cFhsDr.gz --retry 5 --retry-delay 2 --connect-timeout 2 -H 'Content-Type: text/plain' -H 'Content-Encoding: gzip' -H 'X-Content-Encoding: gzip' -H 'Accept: text/plain' 'https://codecov.io/upload/v2?package=bash-tbd&token=&branch=master&commit=483102a77fa459b91cb04ae866f52fb41ea4a2e5&build=dbbkk3rj2krr4258&build_url=https%3A%2F%2Fci.appveyor.com%2Fproject%2Fpdbpp%2Fpdbpp%2Fbuilds%2F38526896%2Fjob%2Fdbbkk3rj2krr4258&name=py38-coverage-Windows&tag=&slug=pdbpp%2Fpdbpp&service=appveyor&flags=AppVeyor,Windows&pr=435&job=blueyed%2Fpdbpp%2F1.0.239&cmd_args=v,Z,X,X,f,n,F&attempt=woff|eot|otf|gif|png|jpg|jpeg|psd|ptt|pptx|numbers|pages|md|txt|xlsx|docx|doc|pdf|csv|.gitignore|html|yml|yaml'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8599 100 227 100 8372 227 8372 0:00:01 --:--:-- 0:00:01 13435
+ res='{"message": "Coverage reports upload successfully", "uploaded": true, "queued": true, "id": "f5894529-3e3c-4f70-9c2a-8df2d7690e5f", "url": "https://codecov.io/github/pdbpp/pdbpp/commit/483102a77fa459b91cb04ae866f52fb41ea4a2e5"}'
++ echo '{"message": "Coverage reports upload successfully", "uploaded": true, "queued": true, "id": "f5894529-3e3c-4f70-9c2a-8df2d7690e5f", "url": "https://codecov.io/github/pdbpp/pdbpp/commit/483102a77fa459b91cb04ae866f52fb41ea4a2e5"}'
++ head -1
++ cut '-d ' -f2
+ status='"Coverage'
+ '[' '"Coverage' = '' ']'
+ '[' '"Coverage' = 200 ']'
+ say ' \033[0;32m{"message": "Coverage reports upload successfully", "uploaded": true, "queued": true, "id": "f5894529-3e3c-4f70-9c2a-8df2d7690e5f", "url": "https://codecov.io/github/pdbpp/pdbpp/commit/483102a77fa459b91cb04ae866f52fb41ea4a2e5"}\033[0m'
+ echo -e ' \033[0;32m{"message": "Coverage reports upload successfully", "uploaded": true, "queued": true, "id": "f5894529-3e3c-4f70-9c2a-8df2d7690e5f", "url": "https://codecov.io/github/pdbpp/pdbpp/commit/483102a77fa459b91cb04ae866f52fb41ea4a2e5"}\033[0m'
{"message": "Coverage reports upload successfully", "uploaded": true, "queued": true, "id": "f5894529-3e3c-4f70-9c2a-8df2d7690e5f", "url": "https://codecov.io/github/pdbpp/pdbpp/commit/483102a77fa459b91cb04ae866f52fb41ea4a2e5"}
+ exit 1
@thomasrockhu are you aware of this issue? It appears changes on the server side (response) make -Z
fail always now.
@blueyed no I wasn't aware of it, but I will take a look next week.
Note that there is --fail-with-body
(only added recently) and --fail
which might be useful here - in case parsing JSON is out of scope / the server's response does not get adjusted/reverted.
Note that it probably could have different responses for different user agents (codecov-bash uses the old format, codecov-python the new(?) one).
@blueyed I'll be honest I dug in a little and I'm not sure why we are throwing an exit code 1. Would you be able to run in verbose mode and reproduce?
@thomasrockhu https://github.com/codecov/codecov-bash/issues/415#issuecomment-812477810 is in verbose mode, isn't it? From what I can tell the server's output changed.
@thomasrockhu the issue is now two months old already.
Am I supposed to remove -Z
, or add custom parsing of the response?
(there is the GitHub Action, which uses -Z
actually, but then ignores any non-zero return value instead! (https://github.com/codecov/codecov-action/issues/286))
I've just noticed that this happens only with "-X s3", i.e. the method that gets used as a fallback.
That certainly explains why it is not getting more attention, since it is usually "only" flaky then (given that users using -Z
typically do not use -X s3
also, which I've only added as a workaround for a temporary issue initially).
@blueyed sorry for the delay here, I've opened a PR here
codecov-bash appears to have started exiting non-zero although the upload worked (when using
-Z
).I am using this script:
Build log on AppVeyor (Windows) (https://ci.appveyor.com/project/blueyed/pdbpp/builds/38280556/job/jrkm6mo1sckjubd2#L374):
It worked 3 months ago using Bash-20201223-5ad85e3 (https://ci.appveyor.com/project/blueyed/pdbpp/builds/37052549/job/k86598o8359e97oy#L364):