Issue: getting `MalformedInputException: Input length = 1` when uploading lcov.info from GitHub Actions

See fix(reduce.algo2): Correction de la détection de défaillances by adrienjoly · Pull Request #323 · signaux-faibles/opensignauxfaibles · GitHub

     ______          __
    / ____/___  ____/ /___ ________  __
   / /   / __ \/ __  / __ `/ ___/ / / /
  / /___/ /_/ / /_/ / /_/ / /__/ /_/ /
  \____/\____/\__,_/\__,_/\___/\__, /
                              /____/

  Codacy Coverage Reporter


######################################################################## 100.0%
 --> Downloading the codacy reporter codacy-coverage-reporter-linux... (11.11.0)

################                                                          23.5%
######################################################################## 100.0%
2021-02-24 14:07:00.967Z  info [ConfigurationRules] API base URL: https://api.codacy.com  - (ConfigurationRules.scala:86)
2021-02-24 14:07:00.969Z  info [CommitUUIDProvider] CI/CD provider GitHub Actions found Commit UUID c4af45b4ee10f0f2c50a8a31fbfb68c540c4f2fd  - (CommitUUIDProvider.scala:131)
2021-02-24 14:07:00.969Z  info [ReportRules] Parsing coverage data from: /github/workspace/go-coverage.xml ...  - (ReportRules.scala:43)
2021-02-24 14:07:01.081Z  info [ReportRules] Coverage parser used is com.codacy.parsers.implementation.CoberturaParser$@25390d5f  - (ReportRules.scala:48)
2021-02-24 14:07:01.089Z  info [ReportRules] Generated coverage report: /tmp/codacy-coverage-13575009642782722109.json (36.8 kB)  - (ReportRules.scala:243)
2021-02-24 14:07:01.089Z  info [ReportRules] Uploading coverage data...  - (ReportRules.scala:244)
2021-02-24 14:07:01.421Z  info [ReportRules] Coverage data uploaded. Coverage received successfully.  - (ReportRules.scala:158)
2021-02-24 14:07:01.421Z  info [ReportRules] Parsing coverage data from: /github/workspace/lcov.info ...  - (ReportRules.scala:43)
Exception in thread "main" java.nio.charset.MalformedInputException: Input length = 1
	at java.nio.charset.CoderResult.throwException(CoderResult.java:274)
	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)
	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
	at java.io.InputStreamReader.read(InputStreamReader.java:181)
	at java.io.BufferedReader.fill(BufferedReader.java:161)
	at java.io.BufferedReader.readLine(BufferedReader.java:326)
	at java.io.BufferedReader.readLine(BufferedReader.java:392)
	at scala.io.BufferedSource$BufferedLineIterator.hasNext(BufferedSource.scala:74)
	at scala.collection.Iterator.foreach(Iterator.scala:943)
	at scala.collection.Iterator.foreach$(Iterator.scala:943)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
	at scala.collection.TraversableOnce.foldLeft(TraversableOnce.scala:189)
	at scala.collection.TraversableOnce.foldLeft$(TraversableOnce.scala:184)
	at scala.collection.AbstractIterator.foldLeft(Iterator.scala:1431)
	at com.codacy.parsers.implementation.LCOVParser$.parseLines(LCOVParser.scala:36)
	at com.codacy.parsers.implementation.LCOVParser$.$anonfun$parse$3(LCOVParser.scala:30)
	at scala.util.Either.flatMap(Either.scala:341)
	at com.codacy.parsers.implementation.LCOVParser$.parse(LCOVParser.scala:30)
	at com.codacy.parsers.CoverageParser$ParsedCoverage$1$.unapply(CoverageParser.scala:44)
	at com.codacy.parsers.CoverageParser$$anonfun$parse$4.applyOrElse(CoverageParser.scala:53)
	at com.codacy.parsers.CoverageParser$$anonfun$parse$4.applyOrElse(CoverageParser.scala:52)
	at scala.collection.TraversableOnce.collectFirst(TraversableOnce.scala:172)
	at scala.collection.TraversableOnce.collectFirst$(TraversableOnce.scala:159)
	at scala.collection.SeqLike$$anon$2.collectFirst(SeqLike.scala:682)
	at com.codacy.parsers.CoverageParser$.parse(CoverageParser.scala:52)
	at com.codacy.rules.ReportRules.$anonfun$sendFilesReportForCommit$2(ReportRules.scala:46)
	at scala.util.Either.flatMap(Either.scala:341)
	at com.codacy.rules.ReportRules.$anonfun$sendFilesReportForCommit$1(ReportRules.scala:45)
	at scala.collection.immutable.List.map(List.scala:290)
	at com.codacy.rules.ReportRules.sendFilesReportForCommit(ReportRules.scala:42)
	at com.codacy.rules.ReportRules.$anonfun$codacyCoverage$2(ReportRules.scala:76)
	at scala.util.Either.flatMap(Either.scala:341)
	at com.codacy.rules.ReportRules.$anonfun$codacyCoverage$1(ReportRules.scala:68)
	at com.codacy.rules.ReportRules.$anonfun$withCommitUUID$4(ReportRules.scala:286)
	at scala.util.Either.flatMap(Either.scala:341)
	at com.codacy.rules.ReportRules.withCommitUUID(ReportRules.scala:286)
	at com.codacy.rules.ReportRules.codacyCoverage(ReportRules.scala:63)
	at com.codacy.CodacyCoverageReporter$.$anonfun$sendReport$1(CodacyCoverageReporter.scala:43)
	at scala.util.Either.flatMap(Either.scala:341)
	at com.codacy.CodacyCoverageReporter$.sendReport(CodacyCoverageReporter.scala:34)
	at com.codacy.CodacyCoverageReporter$.run(CodacyCoverageReporter.scala:19)
	at com.codacy.configuration.parser.ConfigurationParsingApp.run(ConfigurationParser.scala:15)
	at com.codacy.configuration.parser.ConfigurationParsingApp.run(ConfigurationParser.scala:13)
	at caseapp.CommandAppWithPreCommand.$anonfun$main$1(CommandAppWithPreCommand.scala:97)
	at caseapp.CommandAppWithPreCommand.$anonfun$main$1$adapted(CommandAppWithPreCommand.scala:82)
	at scala.Option.foreach(Option.scala:407)
	at caseapp.CommandAppWithPreCommand.main(CommandAppWithPreCommand.scala:82)
	at com.codacy.CodacyCoverageReporter.main(CodacyCoverageReporter.scala)

 --> Failed!

Contents of lcov.info (definitely more than 1 byte): fix(reduce.algo2): Correction de la détection de défaillances by adrienjoly · Pull Request #323 · signaux-faibles/opensignauxfaibles · GitHub

GitHub actions / CI workflow (opensignauxfaibles/ci.yml at master · signaux-faibles/opensignauxfaibles · GitHub):

  coverage:
    name: Send coverage data to Codacy
    needs:
      - mr-tests
      - go-tests
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
      - uses: actions/download-artifact@v2
        with:
          name: go-coverage-report
      - uses: actions/download-artifact@v2
        with:
          name: mr-coverage-report
      - uses: codacy/codacy-coverage-reporter-action@master
        with:
          project-token: ${{ secrets.CODACY_REPOSITORY_TOKEN_FOR_COVERAGE }}
          coverage-reports: go-coverage.xml,lcov.info

FYI, I solved this issue by renaming a file: parPériode.tsparPeriode.ts (i.e. without accentuated character)

Commit: fix(reduce.algo2): Correction de la détection de défaillances by adrienjoly · Pull Request #323 · signaux-faibles/opensignauxfaibles · GitHub

3 Likes

Thanks for sharing the solution that allowed you to overcome the issue @adrienjoly! We will use this feedback to improve our documentation on how to troubleshoot the most common issues while setting up coverage.

1 Like

Hello again @adrienjoly, just a quick note to let you know that we added this new entry to the Codacy Coverage Reporter troubleshooting page:

https://docs.codacy.com/coverage-reporter/troubleshooting-common-issues/#malformedinputexception-while-parsing-report

1 Like