PCF Sonarqube installation getting max file descriptors [16384] for elasticsearch process is too low

  • SonarQube : Community Edition Version 7.8 to 9.3
  • While installing sonarqube Community Edition Version 7.8 to 9.3 in PCF getting max file descriptors [16384] for elasticsearch process is too low
  • We cannot execute kernal commands in PCF container - not able to execute below commands in PCF
sysctl vm.max_map_count
sysctl fs.file-max
ulimit -n
ulimit -u

Sonar buildpack used: (Customized to use java 11)

PCF logs: While installing Community Edition Version 7.8 to 9.3
022-04-06T18:19:23.096+05:30 [APP/PROC/WEB/0] [OUT] bootstrap check failure [1] of [2]: max file descriptors [16384] for elasticsearch process is too low, increase to at least [65535]
2022-04-06T18:19:23.096+05:30 [APP/PROC/WEB/0] [OUT] bootstrap check failure [2] of [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

We are able to install SonarQube Community Edition Version from 7.1 to 7.7 in PCF but not able to install from 7.8 to 9.3
What is the solution to deploy SonarQube Community Edition Version 7.8 to 8.9.7 in PCF?

Hi, Ambrish

I have same issue.
I was able to run SonarQube 9.3 on Cloud Foundry (PCF 2.11) without bootstrap checking by SONAR_ES_BOOTSTRAP_CHECKS_DISABLE: true . I know this option will cause another problem, but it works for me.

Could you try this?

This option (sonar.es.bootstrap.checks.disable) is discribed in here.

my manifest.yml for CF:

applications:
- name: sonar-v9
  memory: 4g
  instances: 1
  health-check-type: http
  health-check-http-endpoint: /
  routes:
    - route: sonar-v9.((domain))
  command: |
    wget -q -P /opt/sonarqube/extensions/plugins/ https://github.com/sleroy/sonar-slack-notifier-plugin/releases/download/2.6.0/cks-slack-notifier-2.6.0.jar && \
    ./bin/run.sh
  docker:
    image: sonarqube:9.3.0-community
  env:
    SONARQUBE_JDBC_USERNAME: ((username))
    SONARQUBE_JDBC_PASSWORD: ((password))
    SONARQUBE_JDBC_URL: jdbc:postgresql://((hostname)):((port))/((name))?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false
    SONAR_ES_BOOTSTRAP_CHECKS_DISABLE: true

startup logs:

2022-05-12T14:28:00.71+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:00 INFO  es[][o.e.n.Node] initialized
2022-05-12T14:28:00.71+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:00 INFO  es[][o.e.n.Node] starting ...
2022-05-12T14:28:00.84+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:00 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:36057}, bound_addresses {127.0.0.1:36057}
2022-05-12T14:28:00.99+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:00 WARN  es[][o.e.b.BootstrapChecks] max file descriptors [16384] for elasticsearch process is too low, increase to at least [65535]
2022-05-12T14:28:00.99+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:00 WARN  es[][o.e.b.BootstrapChecks] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
2022-05-12T14:28:01.01+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:01 INFO  es[][o.e.c.c.Coordinator] setting initial configuration to VotingConfiguration{tAXYmImDRvWONoi5C2PxfQ}
2022-05-12T14:28:01.17+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:01 INFO  es[][o.e.c.s.MasterService] elected-as-master ([1] nodes joined)[{sonarqube}{tAXYmImDRvWONoi5C2PxfQ}{x-h4BdBnRUCT9uznhKgC5A}{127.0.0.1}{127.0.0.1:36057}{cdfhimrsw} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 1, version: 1, delta: master node changed {previous [], current [{sonarqube}{tAXYmImDRvWONoi5C2PxfQ}{x-h4BdBnRUCT9uznhKgC5A}{127.0.0.1}{127.0.0.1:36057}{cdfhimrsw}]}
2022-05-12T14:28:01.21+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:01 INFO  es[][o.e.c.c.CoordinationState] cluster UUID set to [uxTQBjPgTv2lb_ogKiQLZQ]
2022-05-12T14:28:01.25+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:01 INFO  es[][o.e.c.s.ClusterApplierService] master node changed {previous [], current [{sonarqube}{tAXYmImDRvWONoi5C2PxfQ}{x-h4BdBnRUCT9uznhKgC5A}{127.0.0.1}{127.0.0.1:36057}{cdfhimrsw}]}, term: 1, version: 1, reason: Publication{term=1, version=1}
2022-05-12T14:28:01.29+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:01 INFO  es[][o.e.h.AbstractHttpServerTransport] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2022-05-12T14:28:01.29+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:01 INFO  es[][o.e.n.Node] started
2022-05-12T14:28:01.30+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:01 INFO  es[][o.e.g.GatewayService] recovered [0] indices into cluster_state
2022-05-12T14:28:01.51+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:01 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2022-05-12T14:28:01.53+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:01 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-11-openjdk/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -XX:-OmitStackTraceInFastThrow --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-9.3.0.51899.jar:/opt/sonarqube/lib/jdbc/postgresql/postgresql-42.3.1.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process4113674642106244900properties
2022-05-12T14:28:02.04+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:02 INFO  web[][o.s.p.ProcessEntryPoint] Starting web
2022-05-12T14:28:02.63+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:02 INFO  web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2022-05-12T14:28:03.11+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:03 INFO  web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [http://localhost:9001]
2022-05-12T14:28:03.63+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:03 INFO  web[][o.s.s.p.LogServerVersion] SonarQube Server / 9.3.0.51899 / 1a276267d04cd4df862d57201082413946b6b3fa
2022-05-12T14:28:03.64+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:03 INFO  web[][o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://q-i0.mysql.bosh.pxc.bosh:5432/sonar_db?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false
2022-05-12T14:28:05.09+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube
2022-05-12T14:28:05.09+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2022-05-12T14:28:05.32+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin C# Code Quality and Security / 8.34.0.42011 / 7e01861b987ff6ebaef0ce378b5d90a3c8012f96
2022-05-12T14:28:05.32+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin CKS Slack Notifier / 2.6.0 / null
2022-05-12T14:28:05.32+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Configuration detection fot Code Quality and Security / 1.2.0.267 / 4f37ba9ffb37a96d5883e52ad392ed32c5c6eaab
2022-05-12T14:28:05.33+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Flex Code Quality and Security / 2.7.0.2865 / 9e61d9774455b25eefd0b71bf8903cb030641864
2022-05-12T14:28:05.33+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Go Code Quality and Security / 1.9.0.3429 / faf3c08c0ebf3a877186442cd4a0ddd50de079a8
2022-05-12T14:28:05.33+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin HTML Code Quality and Security / 3.6.0.3106 / 963bdc9f051f5dcb698b418790364231aeea04f2
2022-05-12T14:28:05.33+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin IaC Code Quality and Security / 1.5.0.1600 / 49f85d3bb8f38ae65ec0edf4fc109761e68fb488
2022-05-12T14:28:05.33+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin JaCoCo / 1.1.1.1157 / 83478572b9f23efac29de15e30c7758bbb0c0e47
2022-05-12T14:28:05.33+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Java Code Quality and Security / 7.7.0.28547 / be7b25484ea63cc345b695fc5b1d40ccacc3e0b6
2022-05-12T14:28:05.33+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin JavaScript/TypeScript Code Quality and Security / 8.8.0.17228 / a3815936a51aa720d54bf0e04a9e351c3c0ad642
2022-05-12T14:28:05.33+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Kotlin Code Quality and Security / 2.9.0.1147 / 6ce439214a685d4aabde6461fd609a9a9c1df1c6
2022-05-12T14:28:05.33+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin PHP Code Quality and Security / 3.22.1.8626 / 68787fc2bf0b446b0fa5e3c1943ee14fd91ee79d
2022-05-12T14:28:05.33+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Python Code Quality and Security / 3.9.0.9230 / 8241f6a6f0bdd5175741f8b4e302fc6942f2f248
2022-05-12T14:28:05.33+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Ruby Code Quality and Security / 1.9.0.3429 / faf3c08c0ebf3a877186442cd4a0ddd50de079a8
2022-05-12T14:28:05.33+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Scala Code Quality and Security / 1.9.0.3429 / faf3c08c0ebf3a877186442cd4a0ddd50de079a8
2022-05-12T14:28:05.33+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Text file Code Quality and Security / 1.0.0.120 / b7539037caf5df01cc49bb7820a0c23f35196f0e
2022-05-12T14:28:05.33+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin VB.NET Code Quality and Security / 8.34.0.42011 / 7e01861b987ff6ebaef0ce378b5d90a3c8012f96
2022-05-12T14:28:05.33+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:05 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin XML Code Quality and Security / 2.5.0.3376 / 3b089c16cf0736c56f4fdb2fc88ddad59e7ca45d
2022-05-12T14:28:06.68+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:06 INFO  web[][o.s.s.p.d.m.c.PostgresCharsetHandler] Verify that database charset supports UTF8
2022-05-12T14:28:06.79+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:06 WARN  web[][o.s.a.s.w.WebService$Action] Description is not set on action api/monitoring/metrics
2022-05-12T14:28:06.79+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:06 WARN  web[][o.s.a.s.w.WebService$Action] Since is not set on action api/monitoring/metrics
2022-05-12T14:28:06.79+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:06 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/monitoring/metrics
2022-05-12T14:28:06.80+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:06 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/system/liveness
2022-05-12T14:28:06.84+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:06 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.platform.web.WebServiceFilter@652bade9 [pattern=UrlPattern{inclusions=[/api/system/migrate_db.*, ...], exclusions=[/api/components/update_key, ...]}]
2022-05-12T14:28:06.95+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:06 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2022-05-12T14:28:06.97+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:06 INFO  web[][o.s.s.p.DetectPluginChange] Detect plugin changes
2022-05-12T14:28:07.00+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:07 INFO  web[][o.s.s.p.DetectPluginChange] No plugin change detected
2022-05-12T14:28:08.25+0900 [APP/PROC/WEB/0] OUT 2022.05.12 05:28:08 INFO  web[][o.s.s.p.UpdateCenterClient] Update center: https://update.sonarsource.org/update-center.properties (no proxy)
2022-05-12T14:28:08.52+0900 [CELL/0] OUT Container became healthy
1 Like

@daichi703n @sonarsourcers
With the above docker image manifest Sonar is getting installed,

But I want to install with CF buildpack - While installing CF build pack Iā€™m still getting the max file descriptors [16384] error, @sonarsourcers @SonarSorcerer Could you please help on resolving max file descriptors error for CF buildpack installation?
This setting is not taking any effect for CF build pack
SONAR_ES_BOOTSTRAP_CHECKS_DISABLE: true

Manifest file:

applications:
- name: sonar-v9
  buildpack: https://github.com/Ambarisha-006/cf-sonarqube-buildpack
  disk_quota: 4G
  env:
    JDBC_PASS: ((password))
    JDBC_URL: ((jdbcurl))
    JDBC_NAME: ((username))
    SONARQUBE_VERSION: "8.9.7.52159"
    SONAR_ES_BOOTSTRAP_CHECKS_DISABLE: true
   JAVA_OPTS: -Dsonar.es.bootstrap.checks.disable=true
  instances: 1
  memory: 4G
  routes:
  - route: sonar-v9.((domain))
  services:
  - sonar-db
  stack: cflinuxfs3
  timeout: 180