Invalid request parameters

Please search for similar issues before creating a ticket.
All fields below are required.

Description

I’m receiving “Invalid request parameters” errors when using the bitrise step (https://github.com/codecov/codecov-bitrise/i). Using the bash script works fine. Is there a bug in the step?

Uploader

https://github.com/codecov/codecov-bitrise/i

Codecov Output


/ | | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / ` |/ _ / / _ \ \ / /
| |
| (
) | (
| | __/ (
| (
) \ V /
______/ _,|_|____/ _/
Bash-1.0.5
==> git version 2.31.1 found
==> curl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets
==> Bitrise CI detected.
project root: .
→ token set from env
Yaml not found, that’s ok! Learn more at About the Codecov yaml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
+ .
→ Found 6 reports
==> Detecting git/mercurial file structure
==> Reading reports


==> Appending adjustments
Fixing Reports
+ Found adjustments
==> Gzipping contents
96K /tmp/codecov.WVuoAM.gz
==> Uploading reports
url: https://codecov.io
query: branch=[branch]
→ Pinging Codecov
https://codecov.io/upload/v4?package=bitrise-step-1.0.5&token=&package=bitrise-step-1.0.5&token=[REDACTED]&branch=fix%2Fcodecov&commit=d25127e76e8e&build=453&build_url=&service=bitrise&flags=&pr=126&job=&cmd_args=Q,Z,C
Invalid request parameters
400

Expected Results

It should upload to codecov

Actual Results

I’m receiving an error

@gumil strange, it looks like it’s using the short-form of the commit SHA. Can you share the Codecov output of it working?

I’m getting the same issue, I raised it on github as an issue: https://github.com/codecov/codecov-bitrise/issues/10

+------------------------------------------------------------------------------+

| (13) codecov@3                                                               |
+------------------------------------------------------------------------------+
| id: codecov                                                                  |
| version: 3.0.1                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: bash                                                                |
| time: 2021-09-07T14:24:13Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/trustedkeys.gpg' created

100  3187  100  3187    0     0  20561      0 --:--:-- --:--:-- --:--:-- 20561
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 806BB28AED779869: public key "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpgv: can't allocate lock for '/root/.gnupg/trustedkeys.gpg'
gpgv: Signature made Tue 24 Aug 2021 08:58:39 PM UTC
gpgv:                using RSA key 27034E7FDB850E0BBC2C62FF806BB28AED779869
gpgv: Good signature from "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>"
codecov: OK
[2021-09-07T14:24:15.093Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/
  Codecov report uploader 0.1.0
[2021-09-07T14:24:15.098Z] ['info'] => Project root located at: /bitrise/src
[2021-09-07T14:24:15.099Z] ['info'] ->  Token found by environment variables
[2021-09-07T14:24:15.189Z] ['info'] Searching for coverage files...
[2021-09-07T14:24:15.341Z] ['info'] => Found 2 possible coverage files:
  codecov.SHA256SUM
  codecov.SHA256SUM.sig
[2021-09-07T14:24:15.341Z] ['info'] Processing /bitrise/src/codecov.SHA256SUM...
[2021-09-07T14:24:15.343Z] ['info'] Processing /bitrise/src/codecov.SHA256SUM.sig...
[2021-09-07T14:24:15.353Z] ['info'] Detected Local as the CI provider.
[2021-09-07T14:24:15.360Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=bitrise-step-3.0.0-uploader-0.1.0&token=*******&branch=HEAD&build=&build_url=&commit= 18832323a83445c00f5e3bcf17b8abad9bab6157&job=&pr=&service=&slug=//git@bitbucket.org/*****/*****-android&name=&tag=&flags=&parent=
[2021-09-07T14:24:15.542Z] ['error'] Error POSTing to https://codecov.io: 400 Invalid request parameters
[2021-09-07T14:24:15.543Z] ['error'] Error: Error uploading to https://codecov.io: Error: Bad Request
WARN[14:24:15] Step (codecov@3) failed, but was marked as skippable 
|                                                                              |
+---+---------------------------------------------------------------+----------+
| ! | codecov@3 (exit code: 255)                                    | 2.75 sec |
+---+---------------------------------------------------------------+----------+
| Issue tracker: https://community.codecov.io                                  |
| Source: https://github.com/codecov/codecov-bitrise                           |
+---+---------------------------------------------------------------+----------+

Hi @kaylanx, can you make a new issue for this?

2 Likes

Hi @tom, is this bug has been resolved yet? Any update on this, please, as I’m facing the same issue.

+------------------------------------------------------------------------------+

| (4) codecov@3.1                                                              |
+------------------------------------------------------------------------------+
| id: codecov                                                                  |
| version: 3.1.2                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: bash                                                                |
| time: 2021-11-17T12:15:49Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  3187  100  3187    0     0  24143      0 --:--:-- --:--:-- --:--:-- 24143
gpg: directory '/Users/vagrant/.gnupg' created
gpg: keybox '/Users/vagrant/.gnupg/trustedkeys.gpg' created
gpg: /Users/vagrant/.gnupg/trustdb.gpg: trustdb created
gpg: key 806BB28AED779869: public key "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpgv: can't allocate lock for '/Users/vagrant/.gnupg/trustedkeys.gpg'
gpgv: Signature made Tue Nov  9 18:53:32 2021 GMT
gpgv:                using RSA key 27034E7FDB850E0BBC2C62FF806BB28AED779869
gpgv: Good signature from "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>"
codecov: OK
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   642  100   642    0     0  12840      0 --:--:-- --:--:-- --:--:-- 12840
"version":"v0.1.9"
[2021-11-17T12:15:52.929Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/
  Codecov report uploader 0.1.12
[2021-11-17T12:15:52.947Z] ['info'] => Project root located at: /Users/vagrant/git
[2021-11-17T12:15:52.948Z] ['info'] ->  Token found by environment variables
[2021-11-17T12:15:52.967Z] ['info'] Searching for coverage files...
[2021-11-17T12:15:53.019Z] ['info'] => Found 1 possible coverage files:
  coverage/lcov.info
[2021-11-17T12:15:53.019Z] ['info'] Processing /Users/vagrant/git/coverage/lcov.info...
[2021-11-17T12:15:53.023Z] ['info'] Using manual override from args.
[2021-11-17T12:15:53.037Z] ['info'] Detected Local as the CI provider.
[2021-11-17T12:15:53.067Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=bitrise-step-3.0.0-uploader-0.1.12&token=*******&branch=chore%2Fvsmf-95-ci-codecov-integration&build=&build_url=&commit=true&job=&pr=&service=&slug=cloud_arv%2Fagritech%2Fservice-matching%2Fvarun-matchmaking-flutter&name=&tag=&flags=&parent=
[2021-11-17T12:15:53.185Z] ['error'] There was an error running the uploader: Error uploading to https://codecov.io: Error: There was an error fetching the storage URL during POST: 400 - Bad Request - Invalid request parameters
WARN[12:15:53] Step (codecov@3.1) failed, but was marked as skippable 
|                                                                              |
+---+---------------------------------------------------------------+----------+
| ! | codecov@3.1 (exit code: 255)                                  | 5.34 sec |
+---+---------------------------------------------------------------+----------+
| Issue tracker: https://community.codecov.io                                  |
| Source: https://github.com/codecov/codecov-bitrise                           |
+---+---------------------------------------------------------------+----------+

@tom any update on this issue, please?

@luongvo can you provide the Codecov section of the bitrise.yml you are using? Are you using their step builder or yaml to configure?

@tom here you are:

  codecov:
    steps:
    - activate-ssh-key@4:
        run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
    - git-clone@6: {}
    - flutter-installer@0:
        title: Setup the flutter environment
    - flutter-test@1:
        title: Run widget tests, unit tests
        inputs:
        - additional_params: "--coverage"
    - codecov@3.1:
        inputs:
        - OS: macos
        - CODECOV_TOKEN: "$CODECOV_TOKEN"
    - deploy-to-bitrise-io@2: {}

I don’t know exactly what does OS field mean as I can’t find any official document

@luongvo, can you try adding

    - codecov@3.1:
        inputs:
        - OS: macos
        - CODECOV_TOKEN: "$CODECOV_TOKEN"
        - other_options: "-C $BITRISE_GIT_COMMIT"

As for OS, it is posted alongside the step like this:

image

which is sourced here. Are you using the step builder or yaml to configure? It would be useful to know where you looked for documentation so that we can add/update accordingly.

@tom FYI it just works properly without any changes, I still don’t why. I did not change any config here

      - codecov@3:
          inputs:
            - OS: macos
            - CODECOV_TOKEN: "$CODECOV_TOKEN"

I’m using step builder to configure.

1 Like

I am seeing this same issue. Have tried the suggestions from @tom which didn’t work. Is this something that breaks regularly? It seems like it fixed itself for the others in this thread.

@bratxdy can you open a new topic for this?