Sonarqube 10: no join field has been configured

Hello :slight_smile:

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)

SonarQube : 10.0.0.68432, docker image bitnami/sonarqube:10.0.0-debian-11-r0
Scanner : docker image sonarsource/sonar-scanner-cli:latest (4.8.0 at time of writing)
Orchestration and authentication with gitlab-ce, everything hosted in a kubernetes cluster, deployed with bitnami’s helm chart.
Fresh install (database is postgresql, deployed with helm chart’s depencencies), installed french locals plugin trough admin

  • what are you trying to achieve

Just trying to use Sonarqube

  • what have you tried so far to achieve this

I have many frontend “server errors”, with backend logs like :

[has_child] no join field has been configured

or

[has_parent] no join field has been configured

When I had the has_child error, I saw this kind of problems could be resolved by deleting Elasticsearch data and restarting the container. In the case of the bitnami image, folder is /opt/bitnami/sonarqube/data/es8.

Then I ran successfully a scan, but when I would like to browse result, I had has_parent errors.

I retried the above workaround (delete + restart), but error is persistent.

The last log line :

	Suppressed: org.elasticsearch.client.ResponseException: method [POST], host [http://localhost:9001], URI [/issues/_search?typed_keys=true&max_concurrent_shard_requests=5&search_type=query_then_fetch&batched_reduce_size=512], status line [HTTP/1.1 400 Bad Request]
{"error":{"root_cause":[{"type":"query_shard_exception","reason":"[has_parent] no join field has been configured","index_uuid":"t0nqHJ7_QfqDFsQCpK5Dow","index":"issues"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"issues","node":"hF2s9Je0Tz-KUj1SyOoZ2A","reason":{"type":"query_shard_exception","reason":"[has_parent] no join field has been configured","index_uuid":"t0nqHJ7_QfqDFsQCpK5Dow","index":"issues"}}]},"status":400}

Is there a way to curl to elasticsearch the right index/mapping configuration to fix these errors ?

Hi,

We offer an official helm chart. Can you try again with it, please?

 
Thx,
Ann

Hi :slight_smile:

Is the official chart located at https://github.com/SonarSource/helm-chart-sonarqube/tree/master/charts/sonarqube ?

I have tried it, with a rather simple values.yaml :

nameOverride: sonarqube
fullnameOverride: sonarqube

persistence:
  enabled: true
  size: 10Gi

postgresql:
  enabled: true
  auth:
    postgresPassword: redacted
    password: redacted
  primary:
    persistence:
      enabled: true
      size: 10Gi

The first try was unsuccessfull : 10min before first pod restart, then crash in loop due to initial database schema partially created. Sonarqube tries to create already existing tables. This may be due to slow volumes (replicated ceph).
I will retry with disabled probes.

With a vanilla installation of the official helm :

  • extended probes failureThreshold (slow volumes)
  • persistence enabled (20Gi)
  • installed some plugins from marketplace
  • restarted the server (from UI, to install plugins)
  • configured gitlab for auth and project importation
  • ran an analysis
  • wanted to see issues
org.sonar.server.es.ElasticsearchException: Fail to execute es requestES search request 'SearchRequest{searchType=QUERY_THEN_FETCH, indices=[issues], indicesOptions=IndicesOptions[ignore_unavailable=false, allow_no_indices=true, expand_wildcards_open=true, expand_wildcards_closed=false, expand_wildcards_hidden=false, allow_aliases_to_multiple_indices=true, forbid_closed_indices=true, ignore_aliases=false, ignore_throttled=true], types=[], routing='auth_AYfag7tRz7aakcLbmNzb', preference='null', requestCache=null, scroll=null, maxConcurrentShardRequests=0, batchedReduceSize=512, preFilterShardSize=null, allowPartialSearchResults=null, localClusterAlias=null, getOrCreateAbsoluteStartMillis=-1, ccsMinimizeRoundtrips=true, enableFieldsEmulation=false, source={"from":0,"size":500,"query":{"bool":{"must":[{"match_all":{"boost":1.0}}],"filter":[{"bool":{"must":[{"term":{"indexType":{"value":"issue","boost":1.0}}},{"has_parent":{"query":{"bool":{"filter":[{"bool":{"should":[{"term":{"auth_allowAnyone":{"value":true,"boost":1.0}}},{"term":{"auth_userIds":{"value":"AYfaY3cIeMNR_xJA3_PR","boost":1.0}}},{"term":{"auth_groupIds":{"value":"AYfaY5UaeMNR_xJA3_PS","boost":1.0}}},{"term":{"auth_groupIds":{"value":"AYfaY5UeeMNR_xJA3_PT","boost":1.0}}}],"adjust_pure_negative":true,"boost":1.0}}],"adjust_pure_negative":true,"boost":1.0}},"parent_type":"auth","score":false,"ignore_unmapped":false,"boost":1.0}},{"bool":{"must_not":[{"exists":{"field":"resolution","boost":1.0}}],"adjust_pure_negative":true,"boost":1.0}},{"terms":{"type":["SECURITY_HOTSPOT"],"boost":1.0}},{"terms":{"status":["TO_REVIEW"],"boost":1.0}},{"terms":{"project":["AYfag7tRz7aakcLbmNzb"],"boost":1.0}},{"term":{"isMainBranch":{"value":"true","boost":1.0}}},{"bool":{"adjust_pure_negative":true,"boost":1.0}}],"adjust_pure_negative":true,"boost":1.0}}],"adjust_pure_negative":true,"boost":1.0}},"_source":false,"sort":[{"vulnerabilityProbability":{"order":"desc","missing":"_first"}},{"sonarsourceSecurity":{"order":"asc","missing":"_first"}},{"ruleUuid":{"order":"asc","missing":"_first"}},{"project":{"order":"asc","missing":"_first"}},{"filePath":{"order":"asc","missing":"_first"}},{"line":{"order":"asc","missing":"_first"}},{"key":{"order":"asc","missing":"_first"}}],"track_total_hits":2147483647,"aggregations":{"effort":{"filter":{"bool":{"adjust_pure_negative":true,"boost":1.0}},"aggregations":{"effort":{"sum":{"field":"effort"}}}}}}}' on indices '[issues]'
{"error":{"root_cause":[{"type":"query_shard_exception","reason":"[has_parent] no join field has been configured","index_uuid":"pn6fmoKUTD-QD8D-Wi54hQ","index":"issues"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":1,"index":"issues","node":"rHtbyaxhQmu2QyE-EMB4Vw","reason":{"type":"query_shard_exception","reason":"[has_parent] no join field has been configured","index_uuid":"pn6fmoKUTD-QD8D-Wi54hQ","index":"issues"}}]},"status":400}

I have deleted data/es8 folder, restarted pod (so it reindex data) : issues are displayed, but I can’t list projects :

{"error":{"root_cause":[{"type":"query_shard_exception","reason":"[has_parent] no join field has been configured","index_uuid":"liHjc3WTRHadR75-xTDDRw","index":"projectmeasures"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"projectmeasures","node":"IzG4zqkESdC-FHPwSSD1nw","reason":{"type":"query_shard_exception","reason":"[has_parent] no join field has been configured","index_uuid":"liHjc3WTRHadR75-xTDDRw","index":"projectmeasures"}}]},"status":400}

Hi,

Thanks for trying. I’ve flagged this for more expert eyes.

 
Ann

Hi @GrosDede,

thanks for trying out SonarQube! Could you please tell us more about your setup (e.g., which OS you are using, #CPUs, Memory size)? We want to know that especially because we find it strange that you had to increase the failureThreshold.

In the meantime, given that your current goal seems to be only to try SonarQube for now, we suggest that you take one of the following measures, that might help in case of less performant hardware:

  • Install the helm chart removing the persistency in order to avoid any delay to due slow disk
  • Install SonarQube as docker image (check the right section here)

Hello,
I am using a kubernetes cluster with various cpu and memory configuration. Actual sonarqube pod limits are cpu=2, memory=6Gi. Postgresql has limits as cpu=2, memory=2Gi.
The volumes are provided by Ceph, with data replication x3 on average SSD drives (samsung evo). All databases are slow on our cluster, we did not take time to optimize it yet.
That is why I increased the failureThreshold, to avoid a failure due to first initialization taking too much time regading the probes and our volumes performances.

With persistence disabled, every plugin I have installed with marketplace in admin have been removed. The the elasticsearch indices are working, since it looks like data has been reindexed.

So what should I do to have persistence active, and working indices ?

Hi @GrosDede,

Thanks for further investigating this. To sum up, it seems that disabling persistence solves the issue you have with reindexing.

In order to keep your plugins installed, please define them programmatically using the plugins.install value.

Example:

plugins:
  install:
    - "https://github.com/jycr/sonar-l10n-fr/releases/download/9.9.0/sonar-l10n-fr-plugin-9.9.0.jar"

Could you please try setting this and give us feedback on the outcome while upgrading?