# Why it looks for \[http://localhost:9000\]

**URL:** <https://community.sonarsource.com/t/why-it-looks-for-http-localhost-9000/70246>\
**Category:** SonarQube Cloud\
**Tags:** multi-module, maven\
**Created:** [August 23, 2022, 8:44am UTC](https://community.sonarsource.com/t/why-it-looks-for-http-localhost-9000/70246 "2022-08-23T08:44:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BogdanParashchak](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/bogdanparashchak/32/36406_2.png) [@BogdanParashchak](https://community.sonarsource.com/u/BogdanParashchak)\
**Post date:** [August 23, 2022, 8:44am UTC](https://community.sonarsource.com/t/why-it-looks-for-http-localhost-9000/70246/1 "2022-08-23T08:44:11Z")

</div>

I’m trying to configure my Maven project for SonarCloud use in GitHub actions.  
I have such errors when building on GitHub actions:  
Error: SonarQube server [[http://localhost:9000](http://localhost:9000)] can not be reached  
  
Error: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project goods-partner: Unable to execute SonarScanner analysis: Fail to get bootstrap index from server: Failed to connect to localhost/[0:0:0:0:0:0:0:1]:9000: Connection refused → [Help 1]

What could bed the reason of failure? why does it looks for [http://localhost:9000](http://localhost:9000) though I configured [https://sonarcloud.io](https://sonarcloud.io) (see below)?

Here is sonar-cloud.yml:

```auto
name: Build
on:
  push:
    branches:
      - 76-sonarcloud-integration
  pull_request:
    types: [opened, synchronize, reopened]
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
      - name: Set up JDK 17
        uses: actions/setup-java@v1
        with:
          java-version: 17
      - name: Cache SonarCloud packages
        uses: actions/cache@v1
        with:
          path: ~/.sonar/cache
          key: ${{ runner.os }}-sonar
          restore-keys: ${{ runner.os }}-sonar
      - name: Cache Maven packages
        uses: actions/cache@v1
        with:
          path: ~/.m2
          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
          restore-keys: ${{ runner.os }}-m2
      - name: Build and analyze
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
        run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar

```

And here is pom.xml piece:

```auto
        <sonar.organization>some-text-here</sonar.organization>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>        
        <sonar.projectKey>some-text-here</sonar.projectKey>

```

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [August 23, 2022, 8:52am UTC](https://community.sonarsource.com/t/why-it-looks-for-http-localhost-9000/70246/2 "2022-08-23T08:52:09Z")

</div>

Are you sure you’ve set the configuration in your root _pom.xml_, and not one of the subprojects?

---

<div class="post-metadata">

**Author:** ![BogdanParashchak](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/bogdanparashchak/32/36406_2.png) [@BogdanParashchak](https://community.sonarsource.com/u/BogdanParashchak)\
**Post date:** [August 23, 2022, 4:40pm UTC](https://community.sonarsource.com/t/why-it-looks-for-http-localhost-9000/70246/3 "2022-08-23T16:40:57Z")

</div>

Hi Colin!  
Yo`re right. Now this moved to parent pom.xml:  
  
\<sonar.organization\>some-text-here\</sonar.organization\>  
\<sonar.host.url\>[https://sonarcloud.io](https://sonarcloud.io)\</sonar.host.url\>  
\<sonar.projectKey\>some-text-here\</sonar.projectKey\>

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/f/b/fb9f82632d617cd12c2d2746365e44ddcddfdc8d.jpeg)

But another error occurs:

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/c/7/c73f484882ccc6b02276445cf004df478df02f5d.png)

---

<div class="post-metadata">

**Author:** ![Joe](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/joe/32/14820_2.png) [@Joe](https://community.sonarsource.com/u/Joe)\
**Post date:** [August 23, 2022, 5:01pm UTC](https://community.sonarsource.com/t/why-it-looks-for-http-localhost-9000/70246/4 "2022-08-23T17:01:54Z")

</div>

Please check if these other posts can resolve your issue. You are most likely encountering a problem with how you are defining Sonar analysis parameters of your multimodule project (as defined by the `cleanAllWorkingDirs` method calls):

> [@StackOverflowError at DefaultInputComponent.equals](https://community.sonarsource.com/t/stackoverflowerror-at-defaultinputcomponent-equals/20324):
>
> I’m getting this error when running mvn clean verify sonar:sonar: Exception in thread "main" java.lang.StackOverflowError at org.sonar.api.batch.fs.internal.DefaultInputComponent.equals(DefaultInputComponent.java:48) at com.google.common.collect.SingletonImmutableBiMap.get(SingletonImmutableBiMap.java:56) at com.google.common.collect.ImmutableListMultimap.get(ImmutableListMultimap.java:285) at com.google.common.collect.ImmutableListMultimap.get(ImmutableListMultimap.java:55) at org.sonar.s…

> [@StackOverflowError when building maven multimodule](https://community.sonarsource.com/t/stackoverflowerror-when-building-maven-multimodule/33880):
>
> Hi, I am trying to configure sonarcloud but I get a java.lang.StackOverflowError if I use a multi-module Java maven project. Repository: github CI: Github actions Language Java Error log in github action executed when doing a pull request: Exception in thread "main" java.lang.StackOverflowError at org.sonar.api.batch.fs.internal.DefaultInputComponent.hashCode(DefaultInputComponent.java:43) at java.base/java.util.HashMap.hash(HashMap.java:339) at java.base/java.util.HashMap.getOrDefault(Ha…

> [@SonarScan Recursion Problem With Multi-Module Project](https://community.sonarsource.com/t/sonarscan-recursion-problem-with-multi-module-project/63239):
>
> I am running a SonarScan on a maven project using the maven plugin (SonarQube 9.4.0.54424). I just added a module to the project (previously it was not a multi-module project). Now, when I run the scan, I get a StackOverflowException which seems to be due to a recursion problem. Can you please help me figure out what could be causing the stack overflow error and how to get around it? In the parent-pom, I have the following properties: \<sonar-maven-plugin.version\>3.9.1.2184\</sonar-ma…

> [@SonarQube multip project scanning](https://community.sonarsource.com/t/sonarqube-multip-project-scanning/15274):
>
> Trying to setup my multi-module project (AWS Serveless generated by IntelliJ) to run. This is running on a MacBook pro - Java8 and Maven 3.6.1 When running the following command in the project root, it works 100% mvn sonar:sonar -Dsonar.projectKey=pkey -Dsonar.host.url=http://xyz.xyz.xyz.xyz:9000 -Dsonar.login=genrated-key However, when I set these three properties in the pom.xml it fails with a StackOverflow exception in the following class: org.sonar.scanner.scan.WorkDirectoriesInit…

---

<div class="post-metadata">

**Author:** ![BogdanParashchak](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/bogdanparashchak/32/36406_2.png) [@BogdanParashchak](https://community.sonarsource.com/u/BogdanParashchak)\
**Post date:** [August 23, 2022, 8:12pm UTC](https://community.sonarsource.com/t/why-it-looks-for-http-localhost-9000/70246/5 "2022-08-23T20:12:32Z")

</div>

This helped to solve my StackOverFlowError:

> [@StackOverflowError at DefaultInputComponent.equals](https://community.sonarsource.com/t/stackoverflowerror-at-defaultinputcomponent-equals/20324/5):
>
> I figured it out after attaching my debugger. I have a multi-module Maven project, and in the root POM I had set the property \<sonar.projectKey\>foo\</sonar.projectKey\>, which then propagated into the sub-modules, of course. When WorkDirectoriesInitializer.cleanAllWorkingDirs went to recurse through the project, it calculated a key for each module, but it did this by reading the sonar.projectKey property. Because this had the same value for every module, the recursion never completed and the stack…

So I added \<sonar.moduleKey\>${project.artifactId}\</sonar.moduleKey\> to the root POM  
Thank`s a lot for help!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [August 30, 2022, 8:13pm UTC](https://community.sonarsource.com/t/why-it-looks-for-http-localhost-9000/70246/6 "2022-08-30T20:13:29Z")

</div>

Closed on August 30, 2022, 8:13pm UTC

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