Sonar maven plugin fails to upload analysis with IllegalStateException: closed

Hello,

I’m trying to setup sonarcloud for the Infinitest project with Github actions.
I’ve created a sonarcloud organization but I struggle to setup the analysis through a Github action workflow. The changes are here

The relevant part of the build is:

      - name: Sonarcloud analysis
        run: |
          xvfb-run --auto-servernum \
            mvn -e -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
            -Dsonar.host.url=https://sonarcloud.io \
            -Dsonar.login=$SONAR_TOKEN
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

From what I can see in the logs the build seems to work fine and the analysis as well, but (I think) it fails to upload the analysis.
I’ve checked that the token I’m using works by running an analysis from my computer (it worked) and I’ve used that token in the SONAR_TOKEN secret.
Note that maven runs in xvfb because it needs an X11 environment.
After solving various problems with my setup I’m running out of ideas for this error:

[INFO] CPD Executor 97 files had no CPD blocks
[INFO] CPD Executor Calculating CPD for 148 files
[INFO] CPD Executor CPD calculation finished (done) | time=37ms
[INFO] SCM writing changed lines
[INFO] SCM writing changed lines (done) | time=32ms
[INFO] Analysis report generated in 2249ms, dir size=466 KB
[INFO] Analysis report compressed in 310ms, zip size=338 KB
[INFO] Closing heartbeat service
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Infinitest Parent POM 5.3.2-SNAPSHOT:
[INFO] 
[INFO] Infinitest Parent POM .............................. FAILURE [ 46.896 s]
[INFO] Infinitest Runner .................................. SUCCESS [ 10.637 s]
[INFO] Infinitest ClassLoader ............................. SUCCESS [  0.050 s]
[INFO] Infinitest Lib ..................................... SUCCESS [ 15.245 s]
[INFO] Infinitest for IntelliJ ............................ SUCCESS [ 11.634 s]
[INFO] Infinitest Feature for Eclipse ..................... SUCCESS [  0.014 s]
[INFO] Infinitest Plugin for Eclipse ...................... SUCCESS [ 20.441 s]
[INFO] infinitest-runner-test ............................. SUCCESS [  1.280 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:48 min
[INFO] Finished at: 2022-08-28T15:11:49Z
[INFO] ------------------------------------------------------------------------
Error:  Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project infinitest-parent: closed -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project infinitest-parent: closed
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:375)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: closed
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:67)
    at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:108)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.IllegalStateException: closed
    at okio.RealBufferedSource.select (RealBufferedSource.kt:220)
    at okhttp3.internal.Util.readBomAsCharset (Util.kt:259)
    at okhttp3.ResponseBody.string (ResponseBody.kt:187)
    at org.sonarqube.ws.client.OkHttpResponse.content (OkHttpResponse.java:67)
    at org.sonar.scanner.bootstrap.DefaultScannerWsClient.failIfUnauthorized (DefaultScannerWsClient.java:80)
    at org.sonar.scanner.bootstrap.DefaultScannerWsClient.call (DefaultScannerWsClient.java:61)
    at org.sonar.scanner.report.ReportPublisher.upload (ReportPublisher.java:222)
    at org.sonar.scanner.report.ReportPublisher.execute (ReportPublisher.java:159)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart (ProjectScanContainer.java:408)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:123)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:109)
    at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart (GlobalContainer.java:130)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:123)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:109)
    at org.sonar.batch.bootstrapper.Batch.doExecute (Batch.java:58)
    at org.sonar.batch.bootstrapper.Batch.execute (Batch.java:52)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute (BatchIsolatedLauncher.java:46)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke (IsolatedLauncherProxy.java:60)
    at com.sun.proxy.$Proxy50.execute (Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute (EmbeddedScanner.java:189)
    at org.sonarsource.scanner.api.EmbeddedScanner.execute (EmbeddedScanner.java:138)
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:65)
    at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:108)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Error:  
Error:  Re-run Maven using the -X switch to enable full debug logging.
Error:  
Error:  For more information about the errors and possible solutions, please read the following articles:
Error:  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Error: Process completed with exit code 1.

When you run the analysis locally (and it succeeds), are you also using xvfb-run?

Hi Colin, thanks for looking into this!
The successful analysis on my (windows) computer was without xvfb, I simply used maven
I tried running the workflow on windows so I don’t have to use xvbf and modified my build to:

  sonar-analysis:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Set up JDK 11
        uses: actions/setup-java@v3
        with:
          distribution: 'temurin'
          java-version: 11
          cache: 'maven'
      - name: Sonarcloud analysis
        run: |
          mvn -e -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

Unfortunately I seem to get the same error
Here are the logs of the failing run: build: removed the maven options and use the pom + the env · infinitest/infinitest@a5e53be · GitHub

I’m not sure what is the problem because the error message is not super clear.
Would you know if it might mean that the sonar token is not set correctly?

Initially I was trying to setup sonarcloud in a pull request from a forked repo, but then I understood that in that case the secrets are not accesible. So I switched to a branch on the base repo and now I got out of ideas

You should, of course, make sure the token is correct and that the user it was generated for has Execute Analysis permissions – and, I would expect a different error message if the token isn’t valid.

Could you try adding -X to your Maven command to see if there’s anything more interesting in logs at the Debug level?

I’ve tried with the -X flag but did not see anything that would point me towards the problem. The sonarcloud server seems to return an HTTP code 400:

2022-08-29T16:02:59.7755394Z [INFO] 16:02:59.414 Analysis report generated in D:\a\infinitest\infinitest\target\sonar\scanner-report
2022-08-29T16:02:59.7756138Z [DEBUG] 16:02:59.414 Upload report
2022-08-29T16:03:00.8941709Z [DEBUG] 16:03:00.885 POST 400 https://sonarcloud.io/api/ce/submit?organization=infinitest-github&projectKey=org.infinitest%3Ainfinitest-parent&projectName=Infinitest%20Parent%20POM&characteristic=branch%3Dsonarcloud-setup&characteristic=branchType%3DSHORT | time=1471ms
2022-08-29T16:03:00.8953698Z [INFO] 16:03:00.885 Closing heartbeat service
2022-08-29T16:03:00.9002470Z [INFO] ------------------------------------------------------------------------
2022-08-29T16:03:00.9003092Z [INFO] Reactor Summary for Infinitest Parent POM 5.3.2-SNAPSHOT:
2022-08-29T16:03:00.9003450Z [INFO] 
2022-08-29T16:03:00.9003869Z [INFO] Infinitest Parent POM .............................. FAILURE [01:17 min]
2022-08-29T16:03:00.9004263Z [INFO] Infinitest Runner .................................. SUCCESS [ 33.192 s]
2022-08-29T16:03:00.9004655Z [INFO] Infinitest ClassLoader ............................. SUCCESS [  0.130 s]
2022-08-29T16:03:00.9005027Z [INFO] Infinitest Lib ..................................... SUCCESS [ 28.328 s]
2022-08-29T16:03:00.9005483Z [INFO] Infinitest for IntelliJ ............................ SUCCESS [07:27 min]
2022-08-29T16:03:00.9005875Z [INFO] Infinitest Feature for Eclipse ..................... SUCCESS [  0.079 s]
2022-08-29T16:03:00.9006392Z [INFO] Infinitest Plugin for Eclipse ...................... SUCCESS [ 33.649 s]
2022-08-29T16:03:00.9007059Z [INFO] infinitest-runner-test ............................. SUCCESS [  2.389 s]
2022-08-29T16:03:00.9007626Z [INFO] ------------------------------------------------------------------------
2022-08-29T16:03:00.9007998Z [INFO] BUILD FAILURE
2022-08-29T16:03:00.9008496Z [INFO] ------------------------------------------------------------------------
2022-08-29T16:03:00.9008878Z [INFO] Total time:  10:44 min
2022-08-29T16:03:00.9009341Z [INFO] Finished at: 2022-08-29T16:03:00Z
2022-08-29T16:03:00.9009849Z [INFO] ------------------------------------------------------------------------
2022-08-29T16:03:00.9014267Z [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project infinitest-parent: closed -> [Help 1]
2022-08-29T16:03:00.9015543Z org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project infinitest-parent: closed

But before that I can see that it manages to connect (at the begining of the analysis):

2022-08-29T16:01:55.5599705Z [INFO] 16:01:55.555 Load project branches
2022-08-29T16:01:56.2765543Z [DEBUG] 16:01:56.265 GET 200 https://sonarcloud.io/api/project_branches/list?project=org.infinitest%3Ainfinitest-parent | time=710ms
2022-08-29T16:01:56.2839289Z [INFO] 16:01:56.281 Load project branches (done) | time=726ms
2022-08-29T16:01:56.2878638Z [INFO] 16:01:56.281 Check ALM binding of project 'org.infinitest:infinitest-parent'
2022-08-29T16:01:56.9680919Z [DEBUG] 16:01:56.957 GET 200 https://sonarcloud.io/api/alm_integration/is_project_bound?project=org.infinitest%3Ainfinitest-parent | time=676ms
2022-08-29T16:01:56.9697444Z [INFO] 16:01:56.957 Detected project binding: NOT_BOUND
2022-08-29T16:01:56.9699282Z [INFO] 16:01:56.957 Check ALM binding of project 'org.infinitest:infinitest-parent' (done) | time=676ms
2022-08-29T16:01:56.9725479Z [INFO] 16:01:56.957 Load project pull requests
2022-08-29T16:01:57.6442207Z [DEBUG] 16:01:57.629 GET 200 https://sonarcloud.io/api/project_pull_requests/list?project=org.infinitest%3Ainfinitest-parent | time=657ms

I’ve also tried creating a new token and after the build failed I could see it had been used. I also checked I had the rights to run an analysis:

Here’s the link to the failed build, the exception stacktrace at the end is the same.
Thanks again for looking into it!

If SonarCloud is returning a 400 error… that is something that we can dig into! I’ll flag this for some expert attention – thanks for your patience.

1 Like

Hi Colin,
I’ve contacted the former maintainer of the project and got me access to the sonarcloud org he had created a while ago.
After updating the sonar.organization property from infinitest-github to infinitest and creating a new token the build worked.
So I think the build was fine and the issue was in the infinitest-github, maybe in the way the permissions were configured?

I think I’ll delete the infinitest-github org, unless you need it to investigate the problem?

Hello @gtoison,

I’m reaching out to you to provide you with some details related to the analysis failure on the 29th of August. The reason was that you hit the limit of submission per user/token so that’s why a new token solved the issue.

Regards,
Nawar

Thanks a lot for getting back to me @Nawar_Hamo
I tried again today on the infinitest-github org and got the same error:

Caused by: java.lang.IllegalStateException: closed
    at okio.RealBufferedSource.select (RealBufferedSource.kt:220)
    at okhttp3.internal.Util.readBomAsCharset (Util.kt:259)
    at okhttp3.ResponseBody.string (ResponseBody.kt:187)
    at org.sonarqube.ws.client.OkHttpResponse.content (OkHttpResponse.java:67)
    at org.sonar.scanner.bootstrap.DefaultScannerWsClient.failIfUnauthorized (DefaultScannerWsClient.java:80)
    at org.sonar.scanner.bootstrap.DefaultScannerWsClient.call (DefaultScannerWsClient.java:61)
    at org.sonar.scanner.report.ReportPublisher.upload (ReportPublisher.java:222)
    at org.sonar.scanner.report.ReportPublisher.execute (ReportPublisher.java:159)

I did not run any other analysis today so I’m surprised that the issue would be a limit. Or maybe the limit is reset less frequently than daily?
I tried on the infinitest org with the same sonar token immediately after and was able to submit an analysis.
So the difference between the two is that commit: build: test changing the sonar org to infinitest-github · infinitest/infinitest@6374ce3 · GitHub

Maybe I was hitting the limit because I tried so many things but there’s also a problem with the infinitest-github org?

Here’s the link to the logs of the failed run: build: test changing the sonar org to infinitest-github · infinitest/infinitest@6374ce3 · GitHub
And the analysis that worked: fix: removed unnecessary reference to testng · infinitest/infinitest@120a07b · GitHub

Hello @gtoison,

I would ask you to activate the debug mode in your maven run to get more information.
I need to understand what is happening and where is the issue exactly.

Thanks,

It’s done @Nawar_Hamo, here’s the relevant part of the logs:



2022-09-07T14:31:38.9974599Z [INFO] 14:31:38.985 SCM writing changed lines (done) | time=62ms
2022-09-07T14:31:41.0506859Z [DEBUG] 14:31:41.037 Could not detect the dotnet / msbuild version
2022-09-07T14:31:42.8824716Z [INFO] 14:31:42.876 Analysis report generated in 4171ms, dir size=466 KB
2022-09-07T14:31:43.2942705Z [INFO] 14:31:43.288 Analysis report compressed in 412ms, zip size=338 KB
2022-09-07T14:31:43.2952554Z [INFO] 14:31:43.288 Analysis report generated in D:\a\infinitest\infinitest\target\sonar\scanner-report
2022-09-07T14:31:43.2953437Z [DEBUG] 14:31:43.288 Upload report
2022-09-07T14:31:44.5810011Z [DEBUG] 14:31:44.568 POST 400 https://sonarcloud.io/api/ce/submit?organization=infinitest-github&projectKey=org.infinitest%3Ainfinitest-parent&projectName=Infinitest%20Parent%20POM&characteristic=branch%3Dpr-sonar-org-test&characteristic=branchType%3DSHORT | time=1280ms
2022-09-07T14:31:44.5828620Z [INFO] 14:31:44.568 Closing heartbeat service
2022-09-07T14:31:44.5940119Z [INFO] ------------------------------------------------------------------------
2022-09-07T14:31:44.5941344Z [INFO] Reactor Summary for Infinitest Parent POM 5.3.2-SNAPSHOT:
2022-09-07T14:31:44.5942309Z [INFO] 
2022-09-07T14:31:44.5943204Z [INFO] Infinitest Parent POM .............................. FAILURE [01:45 min]
2022-09-07T14:31:44.5943721Z [INFO] Infinitest Runner .................................. SUCCESS [ 35.583 s]
2022-09-07T14:31:44.5944203Z [INFO] Infinitest ClassLoader ............................. SUCCESS [  0.172 s]
2022-09-07T14:31:44.5944695Z [INFO] Infinitest Lib ..................................... SUCCESS [ 33.828 s]
2022-09-07T14:31:44.5945484Z [INFO] Infinitest for IntelliJ ............................ SUCCESS [ 43.939 s]
2022-09-07T14:31:44.5946852Z [INFO] Infinitest Feature for Eclipse ..................... SUCCESS [  0.093 s]
2022-09-07T14:31:44.5948210Z [INFO] Infinitest Plugin for Eclipse ...................... SUCCESS [ 42.448 s]
2022-09-07T14:31:44.5949199Z [INFO] infinitest-runner-test ............................. SUCCESS [  3.316 s]
2022-09-07T14:31:44.5949783Z [INFO] ------------------------------------------------------------------------
2022-09-07T14:31:44.5951405Z [INFO] BUILD FAILURE
2022-09-07T14:31:44.5952161Z [INFO] ------------------------------------------------------------------------
2022-09-07T14:31:44.5952512Z [INFO] Total time:  04:29 min
2022-09-07T14:31:44.5953300Z [INFO] Finished at: 2022-09-07T14:31:44Z

And the link to the full build logs is: build: enabled maven debug option · infinitest/infinitest@bb9f922 · GitHub

Hello @gtoison,

After checking from our side. you may have a permission issue on this project. Your project is not binding to the organization infinitest-github or you don’t have the right project key associated (maybe this project is still associated to infinitest).
I suggest you check your configuration to make sure that the project key is binding to the right organization and try again. I suggest also closing this thread because the main issue was not related.
Please do not hesitate to open a new thread if you still have the issue then.

Regards,
Nawar

Thanks again @Nawar_Hamo, I think the issue is with the project key and your message gave me the clue I missed.
Here are some assumptions I made that turned out to be incorrect, please don’t hesitate to correct me if I got it wrong again!

Incorrect assumptions I had:

  • When onboarding a Github project, sonarcloud uses the maven groupId:artifactId as project key (wrong: not sure how it’s generated) so you can omit the project key and it will use the default for maven projects
  • The project key identifies a project within an organization (wrong: the project key seems to be globally unique so two projects from different orgs cannot have the same project key)
  • When doing a Pull Request from a forked repo Github Actions will use the SONAR_TOKEN secret of the forked repo (wrong: pull requests from forked repos cannot use either the SONAR_TOKEN secret of the main repo or the forked repo)

So in the end it was user error but I wish that sonarcloud could return clearer error messages. For the last error I made (unrelated project and org keys) there’s simply no error message

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.