Help with 8.9 setup

  • version 8.9
  • set up on Ubuntu( x86-64) 20.04
  • Errors:
    GET /%WEB_CONTEXT%/js/vendors-main.m.f8a28baa.chunk.js 400
    GET /%WEB_CONTEXT%/js/main.m.613bc2d0.js 400
    GET /%WEB_CONTEXT%/favicon.ico 400

Hi @Shawn and welcome to the community :wave:

these are not many information that you are sharing. can you elaborate a bit about your setup, like which java version is installed, do you use a reverse proxy, can you share your configuration and the log files, a detailed description of the error that you are facing etc. else there is not much what we can do here to help you :slight_smile:

Hi Tibias,
My java version is:
java version: openjdk version "14.0.2" 2020-07-14

My Sonarqube setup:

sonar.jdbc.username=sonar
sonar.jdbc.password=PWORD
sonar.jdbc.url=jdbc:postgresql://localhost/sonarqube
sonar.web.javaAdditionalOpts=-localsonarqube
sonar.web.host=localsonarqube
sonar.web.port=80
sonar.search.javaOpts=-Xmx512m -Xms512m -XX:MaxDirectMemorySize=256m -XX:+HeapDumpOnOutOfMemoryError
sonar.log.level=INFO
sonar.path.logs=logs ```

My web virtual host configure is as(Not ngix but Apache): 
ServerName localsonarqube 
ServerAdmin webmaster@localhost
DocumentRoot /opt/sonarqube/web 
<Directory /opt/sonarqube/web>
	Options Indexes FollowSymLinks
	AllowOverride None
	Order allow,deny
	Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/sonar_error.log
CustomLog ${APACHE_LOG_DIR}/sonar_access.log combined

Hi @Shawn ,

there is a lot that does not end up for me and i fear that this just can not work.

as you can see in the docs → requirements we currently only support java 11.

this is a port that requires special permissions on a UNIX system, like root or www-data. don’t use this port as it will probably be allocated by your web server anyway.

This property makes no sense. where do you got it from?

This is not a reverse proxy configuration. please configure apache to be a reverse proxy to sonarqube and not a webserver that thinks sonarqube servers static html in /opt/sonarqube/web.

i would really recommend that you start over and have a look at our documentation how to secure sonarqube behind a reverse proxy here: Operating the server

Hi Tobias,
Thanks.
I read the document on how to configure Reverseproxy: It assumes there is a site http://private_sonar_host:sonar_port/ existing. But my problem is how to set up this private site?
Thanks again,
Shawn

when you start SonarQube (the application) it starts a tomcat server underneath that creates this “site”. you can bind it to localhost when you define sonar.web.host=127.0.0.1 and then let your reverse proxy take care of routing external traffic to sonarqube on localhost.
if you don’t define a specific sonar.web.host, sonarqube will be reachable from all ip adresses dedicated to the system it’s running on

Hi Tobias, Thank you very much. Now I seem to get it.
But I have 503 error: “Service Unavailable”
From apache2 log, error message is:

[Wed May 12 09:24:57.543738 2021] [proxy_http:error] [pid 2012245] [client [127.0.0.1:54614](http://127.0.0.1:54614)] AH01114: HTTP: failed to make connection to backend: private_sonar
[Wed May 12 09:24:57.762993 2021] [proxy:error] [pid 2012246] (111)Connection refused: AH00957: HTTP: attempt to connect to [127.0.0.1:9000](http://127.0.0.1:9000) (private_sonar) failed
[Wed May 12 09:24:57.763041 2021] [proxy_http:error] [pid 2012246] [client [127.0.0.1:54616](http://127.0.0.1:54616)] AH01114: HTTP: failed to make connection to backend: private_sonar, referer: [http://public_sonar/](http://public_sonar/)

From Sonarqube log, I have:

<-- Wrapper Stopped
--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) [http://wrapper.tanukisoftware.org](http://wrapper.tanukisoftware.org)
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.

2021.05.12 09:40:05 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2021.05.12 09:40:05 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: [127.0.0.1:9001](http://127.0.0.1:9001), TCP: [127.0.0.1:40737](http://127.0.0.1:40737)]
2021.05.12 09:40:05 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME
2021.05.12 09:40:05 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
bootstrap check failure [1] of [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
ERROR: Elasticsearch did not exit normally - check the logs at /opt/sonarqube/logs/sonarqube.log
2021.05.12 09:40:12 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 78
2021.05.12 09:40:12 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped
2021.05.12 09:40:12 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped

So the problem is that sonar is running normally.
I need your further help. Thanks in advance.
Regards,
Shawn

so sonarqube is not running normally. you need to make sure that you fulfill the host requirements

Thanks, Tobias.
I made some progress … After run command: sudo sysctl -w vm.max_map_count=262144,
http://127.0.0.1:9000/” displays “Log into Sonarqube”, but I do not have the credentials.
On “http://public_sonar/”, there is error “400 Bad Request”

What is the problem & how to solve it?
Thank you very much for your help.
Shawn

Hi Tobias,
I looked at sonar log, it shows: “Default Administrator credentials are still being used.” What is it? And how to change it?
Thanks,
Shawn

this log message indicates that the default admin credentials (admin:admin) are currently in place and should be changed. when you first log in with these credentials you will be forced to change them.

well not much what i can say about this. you need to check your reverse proxy configuration. we have some snippets in the documentation i linked you (Operating the server) that are like a minimal configuration that is tested and working on a default installation of nginx and apache2, but what is wrong in your particular case is something that you need to check in the logs of your reverse proxy.