During upgrade of SonarQube 6.7 -> 7.6, running into a few problems:
First problem was a snapshot too old error which came from DB - fixed this by dropping all unused columns for the tables (had to manually recreate project_measures table due to the amount of data and length of time drop command was taking)
Now db migration moves onto the next step:
delete person and file measures
It seems to be running a lot slower than previous step, processing less rows per second, obviously they’re doing different operations so understandable.
Below is the a section of web.log:
2019.05.23 08:15:34 INFO web[][o.s.s.p.d.m.s.MassUpdate] 119165 snapshots processed (8 items/sec)
2019.05.23 08:15:59 WARN web[][o.s.p.ProcessEntryPoint] Fail to start web
java.lang.IllegalArgumentException: Unable to create shared memory :
at org.sonar.process.sharedmemoryfile.AllProcessesCommands.<init>(AllProcessesCommands.java:100)
at org.sonar.process.sharedmemoryfile.DefaultProcessCommands.<init>(DefaultProcessCommands.java:34)
at org.sonar.process.sharedmemoryfile.DefaultProcessCommands.secondary(DefaultProcessCommands.java:52)
at org.sonar.server.app.WebServer.isOperational(WebServer.java:68)
at org.sonar.server.app.WebServer.getStatus(WebServer.java:60)
at org.sonar.process.ProcessEntryPoint.waitForOperational(ProcessEntryPoint.java:145)
at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:120)
at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:100)
at org.sonar.server.app.WebServer.main(WebServer.java:91)
Caused by: java.io.FileNotFoundException: /opt/sonarqube/sonarqube-7.6/temp/sharedmemory (Too many open files in system)
at java.io.RandomAccessFile.open0(Native Method)
at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
at org.sonar.process.sharedmemoryfile.AllProcessesCommands.<init>(AllProcessesCommands.java:97)
... 8 common frames omitted
sonar.log
2019.05.23 05:20:57 WARN app[][startup]
################################################################################
Database must be upgraded. Please backup database and browse /setup
################################################################################
2019.05.23 08:16:06 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
2019.05.23 08:16:07 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2019.05.23 08:16:07 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
2019.05.23 08:16:08 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
<-- Wrapper Stopped
(END)
I seen on requirements page: https://docs.sonarqube.org/latest/requirements/requirements/
it needs to be the below values or higher:
sysctl -w vm.max_map_count=262144
sysctl -w fs.file-max=65536
ulimit -n 65536
ulimit -u 2048
Here are the below values when I log in as the user starting sonarqube:
bash-4.1$ sysctl vm.max_map_count
vm.max_map_count = 262144
bash-4.1$ sysctl fs.file-max
fs.file-max = 175536
bash-4.1$ ulimit -u
3048
bash-4.1$ ulimit -n
125536
We’re using an oracle database 11g.