I'm trying to setup SonarQube 7.8 version. Once i start sonar.sh file it is running but after that sonar stops.
root#automation:/opt/sonarqube-7.8/bin/linux-x86-64# ./sonar.sh start
Starting SonarQube...
Started SonarQube.
root#automation:/opt/sonarqube-7.8/bin/linux-x86-64# ./sonar.sh status
SonarQube is not running.
I checked the logs and this is what i get:
--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
2019.10.15 21:01:37 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube-7.8/temp
2019.10.15 21:01:37 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2019.10.15 21:01:37 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube-7.8/elasticsearch]: /opt/sonarqube-7.8/elasticsearch/bin/elasticsearch
2019.10.15 21:01:37 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2019.10.15 21:01:38 INFO app[][o.e.p.PluginsService] no modules loaded
2019.10.15 21:01:38 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2019.10.15 21:01:41 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2019.10.15 21:01:41 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped
2019.10.15 21:01:41 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
es.log file is here :
2019.10.15 21:01:41 ERROR es[][o.e.b.Bootstrap] Exception
java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:103) ~[elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170) ~[elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) [elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) [elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) [elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) [elasticsearch-cli-6.8.0.jar:6.8.0]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) [elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) [elasticsearch-6.8.0.jar:6.8.0]
I'm not sure why SonarQube stops. Could you help me with that please?
SOLVED:
First, don't run sonarqube as the root user
Create user
command: useradd username (put username as sonaradmin(if you don't want to change any command)
Create a password command: passwd username
goto /opt/ directory
3.1) Rename sonarqube.x.x.x to sonarqube command:sudo mv sonarqube.x.x.x sonarqube(X.X.X you should change directory name)
Change permissions command:chmod 775 -R sonarqube(folder name may change Sonarqube )
Add Created user to sonaradmin group command: chown -R sonaradmin:sonaradmin sonarqube
goto : cd /opt/sonarqube/bin/linux-x86-64/
Command: su sonaradmin
Enter password
command:./sonar.sh start
Command:./sonar.sh status
Now goto browser check http://localhost:9000/sonar
Hoping this helps.... I have gone through the same issue,solved
ok, i found the solution. All i had to do is to change #RUN_AS_USER= in /opt/sonarqube-7.8/bin/linux-x86-64/sonar.sh line 48 to RUN_AS_USER=sonar
Your solution for me doesn't works, cause console show me this messagge (after edit to sonar.sh file)
groups: "sonar": no such user
chown: utente non valido: "sonar:sonar"
su: user sonar does not exist
if baya prakash reddy's answer doesn't work, so you can look at the documentation https://docs.sonarqube.org/latest/requirements/requirements/ where it says that you must ensure that:
vm.max_map_count is greater than or equal to 524288
yo can set it like this:
sysctl -w vm.max_map_count=524288
Ensure your sonarQube server has at least 4GB of RAM. I had this issue after installing SonarQube with 1GB of RAM. Running SonarQube as sonar did not resolve the issue. Once I installed on RHL with 4GB RAM, issue was resolved
Related
I have created a fat-jar for my apache camel 3 route. I put that on my raspberry pi (bullseye) in /opt/myhome and could start it successfully with java 17 (also works with sudo):
/usr/bin/java -jar /opt/myhome/myhome-1.0-SNAPSHOT-jar-with-dependencies.jar
Then I have added /lib/systemd/system/myhome.service as:
[Unit]
Description=My home automation with apache camel 3.
After=network.target
[Service]
ExecStart=/usr/bin/java -jar /opt/myhome/myhome-1.0-SNAPSHOT-jar-with-dependencies.jar > /var/log/myhome.log 2>&1
[Install]
WantedBy=network.target
Then I did:
sudo systemctl daemon-reload
sudo systemctl enable myhome.service
sudo systemctl start myhome.service
After starting and waiting for some seconds I executed
systemctl status myhome.service
Which displays me
● myhome.service - My home automation with apache camel 3.
Loaded: loaded (/lib/systemd/system/myhome.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Fri 2022-10-07 18:28:52 CEST; 1h 18min ago
Process: 18159 ExecStart=/usr/bin/java -jar /opt/myhome/myhome-1.0-SNAPSHOT-jar-with-dependencies.jar > /var/>
Main PID: 18159 (code=exited, status=0/SUCCESS)
CPU: 10.174s
systemd[1]: Started My home automation with apache camel 3..
java[18159]: WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
java[18159]: Apache Camel Runner takes the following options
java[18159]: -h or -help = Displays the help screen
java[18159]: -r or -routers <routerBuilderClasses> = Sets the router builder classes which will be loaded while starting the camel context
java[18159]: -d or -duration <duration> = Sets the time duration (seconds) that the application will run for before terminating.
java[18159]: -dm or -durationMaxMessages <durationMaxMessages> = Sets the duration of maximum number of messages that the application will process before terminating.
java[18159]: -di or -durationIdle <durationIdle> = Sets the idle time duration (seconds) duration that the application can be idle before terminating.
java[18159]: -t or -trace = Enables tracing
java[18159]: -ts or -traceStandby = Enables tracing standby
java[18159]: -e or -exitcode <exitcode> = Sets the exit code if duration was hit
java[18159]: -pl or -propertiesLocation <propertiesLocation> = Sets location(s) to load properties, such as from classpath or file system.
systemd[1]: myhome.service: Succeeded.
systemd[1]: myhome.service: Consumed 10.174s CPU time.
So this means the process was started, but then not the same as when starting the jar manually happens, but a help message seems to appear.
So the question is, why did the jar behaves differently as when started manually?
I also tested to change the code in myhome.service to:
/usr/bin/java -jar /opt/myhome/myhome-1.0-SNAPSHOT-jar-with-dependencies.jar -e 10 -d 60 -r de.powerstat.camel.homeautomation.HomeautomationRouteBuilder > /var/log/myhome.log 2>&1
Which results in the same as above. So no different exit code because of a timeout, or a not found route class.
What point did I miss here?
Update 1:
Completed the systemctl status output. Looks like this comes from org.apache.camel.main.MainCommandLineSupport
So the question is still why this shows up when starting in systemd context and not when starting within the bash?
Within my jar file the META-INF/MANIFEST.MF looks like:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: PowerStat
Build-Jdk: 17.0.2
Main-Class: de.powerstat.camel.homeautomation.MainApp
while the MainApp class is defined as follows:
public class HomeautomationRouteBuilder extends RouteBuilder
After some research I found out that "> /var/log/myhome.log 2>&1" will be passed as three parameters to args. Because these parameters are not recognized results in the shown help message.
I've tried everything I can think of to get WebDriverManager to detect the correct version of the chrome browser that I can think of, nothing works. I want to detect the browser driver version from the chrome.exe located at C:\Program Files\Google\Chrome Beta\Application. However, no matter what I do it runs the following command to detect the version:
io.github.bonigarcia.wdm.versions.Shell - Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="%PROGRAMFILES(X86):\=\\%\\Google\\Chrome\\Application\\chrome.exe", get, Version, /value]
I have tried so far:
For all the below:
sBrowserBinaryLocation = "C:\Program Files\Google\Chrome Beta\Application";
setting
options.setBinary(sBrowserBinaryLocation);
WebDriverManager.chromedriver().clearDriverCache().setup();
Setting:
options.setBinary(sBrowserBinaryLocation);
WebDriverManager.chromedriver().clearDriverCache().arch64().setup();
Setting:
options.setBinary(sBrowserBinaryLocation);
WebDriverManager.chromedriver().clearDriverCache().browserVersionDetectionCommand(sBrowserBinaryLocation + " --version").arch64().setup();
Every one of those produced the same
io.github.bonigarcia.wdm.versions.Shell - Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="%PROGRAMFILES(X86):\=\\%\\Google\\Chrome\\Application\\chrome.exe", get, Version, /value]
Which picked up the non-beta version 99. How do I tell WebDriverManager to use "C:\Program Files\Google\Chrome Beta\Application" rather than "C:\Program Files(x86)\Google\Chrome\Application"?
Although it is tricky, it can be done using the WebDriverManager method browserVersionDetectionCommand(). Supposing that Chrome Beta is in this path:
C:\Program Files\Google\Chrome Beta\Application\chrome.exe
... we need to run the following command in the shell:
cmd.exe /C wmic datafile where name="%PROGRAMFILES:\=\\%\\Google\\Chrome Beta\\Application\\chrome.exe" get Version /value
The problem is that, when running this command in Java, the blank space (in "Chrome Beta" folder) makes this command to be interpreted incorretly. The solution is to find the Windows path name using the ~ sintax. You can discover these names by running dir /X in the Windows shell (e.g, C:\Program Files becomes C:\PROGRA~1).
You can see a test using this feature here. The traces of this test are as follows:
2022-03-23 13:35:00 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(65) -- Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="C:\\PROGRA~1\\GOOGLE\\CHROME~1\\APPLIC~1\\CHROME.EXE", get, Version, /value]
2022-03-23 13:35:00 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(69) -- Result: Version=100.0.4896.46
2022-03-23 13:35:00 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getDriverVersionFromRepository(127) -- Latest version of chromedriver according to https://chromedriver.storage.googleapis.com/LATEST_RELEASE_100 is 100.0.4896.20
2022-03-23 13:35:00 [main] INFO i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1093) -- Using chromedriver 100.0.4896.20 (resolved driver for Chrome 100)
2022-03-23 13:35:00 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) -- Storing resolution chrome=100 in cache (valid until 14:35:00 23/03/2022 CET)
2022-03-23 13:35:00 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) -- Storing resolution chrome100=100.0.4896.20 in cache (valid until 13:35:00 24/03/2022 CET)
2022-03-23 13:35:00 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.manage(1049) -- Driver chromedriver 100.0.4896.20 found in cache
2022-03-23 13:35:00 [main] INFO i.g.bonigarcia.wdm.WebDriverManager.exportDriver(1148) -- Exporting webdriver.chrome.driver as C:\Users\boni\.cache\selenium\chromedriver\win32\100.0.4896.20\chromedriver.exe
Running the latest version of sonarcube 7.1.2 and getting the following error.:
Command executed: sudo ./sonar.sh
Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
2018.07.01 18:36:05 INFO app[][o.s.a.AppFileSystem] Cleaning or
creating temp directory /Users/aneeshgoel/Downloads/sonarqube-7.2.1/temp
2018.07.01 18:36:05 INFO app[][o.s.a.es.EsSettings] Elasticsearch
listening on /127.0.0.1:9001
2018.07.01 18:36:05 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch
process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from
[/Users/aneeshgoel/Downloads/sonarqube-7.2.1/elasticsearch]:
/Users/aneeshgoel/Downloads/sonarqube-
7.2.1/elasticsearch/bin/elasticsearch -
Epath.conf=/Users/aneeshgoel/Downloads/sonarqube-7.2.1/temp/conf/es
2018.07.01 18:36:05 INFO app[][o.s.a.SchedulerImpl] Waiting for
Elasticsearch to be up and running
2018.07.01 18:36:10 INFO app[][o.e.p.PluginsService] no modules loaded
2018.07.01 18:36:10 INFO app[][o.e.p.PluginsService] loaded plugin
[org.elasticsearch.transport.Netty4Plugin]
2018.07.01 18:36:16 WARN app[][o.s.a.p.AbstractProcessMonitor] Process
exited with exit value [es]: 1
2018.07.01 18:36:16 INFO app[][o.s.a.SchedulerImpl] Process [es] is
stopped
2018.07.01 18:36:16 INFO app[][o.s.a.SchedulerImpl] SonarQube is
stopped
<-- Wrapper Stopped
Then I tried with non sudo user. Command ./sonar.sh
Error got is :
--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
2018.07.01 18:18:16 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /Users/aneeshgoel/Downloads/sonarqube-7.2.1/temp
WrapperSimpleApp: Encountered an error running main: java.nio.file.AccessDeniedException: /Users/aneeshgoel/Downloads/sonarqube-7.2.1/temp/conf/es/elasticsearch.yml
java.nio.file.AccessDeniedException: /Users/aneeshgoel/Downloads/sonarqube-7.2.1/temp/conf/es/elasticsearch.yml
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:244)
at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
at java.nio.file.Files.delete(Files.java:1126)
at org.sonar.process.FileUtils2$DeleteRecursivelyFileVisitor.visitFile(FileUtils2.java:170)
I have tried giving write access also to the directory , but still no luck. Please can someone help in debugging the issue.
SonarQube installation guide, unfortunately, doesn’t say a thing about configuring user for the analysis server. People that are installing it can later forget about it, leaving SonarQube running with root rights for a while.
It is, however pretty simple and straightforward. Prepare sonar system user and change installation directory rights:
You have to run the sonar in the context of sonar user. To create a user called sonar, follow these steps:
groupadd sonar useradd -c "Sonar System User" -d /opt/sonarqube -g
sonar -s /bin/bash sonar chown -R sonar:sonar /opt/sonarqube
Then edit the file present here:
/opt/sonarqube/bin/sonar.sh
Find the line which reads RUN_AS_USER=sonar which will be commented, and then change as sonar and try to run the app now.
I am new to Apache OFBiz. I have downloaded and installing the OFBiz by instructions. I have loaded the data successfully.
But when am running OFBiz using gradlew it stopped at birt-container. I have added the console information here.
Build process stopped at 91% with the message of "Started container birt-container" for 5 hours and I have stopped the process. Still no idea why it is stopping here.
2017-05-04 11:01:42,143 |main |CatalinaContainer |I| Connector HTTP/1.1 # 8443 - secure [org.apache.coyote.http11.Http11NioProtocol] started.
2017-05-04 11:01:42,143 |main |CatalinaContainer |I| Started Apache Tomcat/8.0.37
2017-05-04 11:01:42,143 |main |ContainerLoader |I| Started container catalina-container
2017-05-04 11:01:42,143 |main |ContainerLoader |I| Starting container birt-container
2017-05-04 11:01:42,143 |main |BirtContainer |I| Start BIRT container
2017-05-04 11:01:42,152 |main |BirtContainer |I| Startup BIRT platform
2017-05-04 11:01:43,034 |main |BirtContainer |I| Create factory object
2017-05-04 11:01:43,052 |main |BirtContainer |I| Create report engine
2017-05-04 11:01:43,130 |main |BirtContainer |I| BIRT supported formats: xlsx, postscript, docx, pptx, pdf, ppt, xls_spudsoft, doc, html,
odp, xls, odt, ods
2017-05-04 11:01:43,130 |main |ContainerLoader |I| Started container birt-container
> Building 91% > :ofbiz
The Gradle percentage is bit misleading here, it does not reach 100% as long as OFBiz is running. I think you just assumed after building the service will be up. Not like that. Once the Service is up it will be in 91%. But the Service has been started. You can access the E-Commerce and other services. Once you are running service get the following URL (ex).
localhost:8443/ap/control/main
You will be redirected to admin login page. Give user as "admin" and password as "ofbiz". Do the changes and test your data as you want in Accounting, Manufacturing, HR , etc..
Note: After completed your process stop the process using "stopofbiz" shell script file under tools folder. After stop the service you can able to see the build will be reach 100% in service console.
This is a duplicate to Installing OfBiz in debug mode hangs
I think OFBiz does not hang and that you should be able to access and work with it without problems. The Gradle percentage is bit misleading here, it does not reach 100% as long as OFBiz is running.
See also https://lists.apache.org/thread.html/26543a82adf1f8d9a8bec47975e8d87f750c2de2f2da7e242b04a72e#%3Cuser.ofbiz.apache.org%3E
Prepare OFBiz:
Clean all:
gradlew cleanAll loadDefault testIntegration
Note: Depending on your Internet connection speed it might take a long time for this step to complete if you are using OFBiz for the first time as it needs to download all dependencies. So please be patient!
MS Windows: gradlew cleanAll loadDefault
Unix-like OS: ./gradlew cleanAll loadDefault
Start OFBiz:
MS Windows: gradlew ofbiz
Unix-like OS: ./gradlew ofbiz
Reference: After download http://www.apache.org/dyn/closer.lua/ofbiz/apache-ofbiz-16.11.02.zip , unzip, look for
apache-ofbiz-16.11.02/tools/documentation/README.md.html
I'm having an issue running the Selenium standalone server -- it just hangs partway through loading. I've tried several different versions of the standalone server but the same issue arises. From the command line I run...
java -jar selenium-server-standalone-2.25.0.jar
And get back...
Oct 16, 2012 8:29:34 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
20:29:40.190 INFO - Java: Apple Inc. 20.10-b01-428
20:29:40.193 INFO - OS: Mac OS X 10.7.4 x86_64
20:29:40.202 INFO - v2.25.0, with Core v2.25.0. Built from revision 17137
20:29:40.322 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
20:29:40.324 INFO - Version Jetty/5.1.x
20:29:40.324 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
20:29:40.326 INFO - Started HttpContext[/selenium-server,/selenium-server]
20:29:40.326 INFO - Started HttpContext[/,/]
20:29:40.376 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler#1f8b81e3
20:29:40.377 INFO - Started HttpContext[/wd,/wd]
20:29:40.382 INFO - Started SocketListener on 0.0.0.0:4444
20:29:40.383 INFO - Started org.openqa.jetty.jetty.Server#4ee1d5ea
If the comment does not help, try changing start command to
java -jar lib/selenium-server-standalone-2.25.0.jar -role hub
(It is command for starting Selenium Grid, so it might be wrong for you, but I dont know what are you trying to achieve)
And as mentioned above, after the command is run
DO NOT CLOSE COMMAND LINE
Open browser and load http://127.0.0.1:4444/
You should see something like this:
You are using grid 2.25.0
Find help on the official selenium wiki : more help here
default monitoring page : console