0
votes

I'm trying to update a SonarQube 5.3 instance to 5.6.3 LTS. To update the database schema I browse to "http://mysonarqube/setup", but when I click on the "Upgrade" button I get just redirected to the "http://mysonarqube/maintanance" page and according to the server log not much is happening. I would have expected to get some sort of progress indication in the browser.

When I click "Upgrade" the log on the server (sonar.log) doesn't show any activity at all. So I'm guessing it simply doesn't trigger the actual schema migration.

Has anyone an idea what's going on or how I can further debug why nothing is happening?

Update 2016-11-15: Here's the log when starting the SonarQube server. When I click on "Upgrade" on the setup page, not one single line is added to this log

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

2016.11.15 08:41:34 INFO  app[o.s.a.AppFileSystem] Cleaning or creating temp directory C:\tools\sonarqube_playground\temp
2016.11.15 08:41:35 INFO  app[o.s.p.m.JavaProcessLauncher] Launch process[es]: c:\tools\java\jdk1.8.0_66\jre\bin\java -Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=C:\tools\sonarqube_playground\temp -javaagent:c:\tools\java\jdk1.8.0_66\jre\lib\management-agent.jar -cp ./lib/common/*;./lib/search/* org.sonar.search.SearchServer C:\tools\sonarqube_playground\temp\sq-process934155640727080349properties
2016.11.15 08:41:37 INFO   es[o.s.p.ProcessEntryPoint]  Starting es
2016.11.15 08:41:37 INFO   es[o.s.s.EsSettings]  Elasticsearch listening on 127.0.0.1:9003
2016.11.15 08:41:38 INFO   es[o.elasticsearch.node]  [sonar-1479195694200] version[1.7.5], pid[4920], build[00f95f4/2016-02-02T09:55:30Z]
2016.11.15 08:41:38 INFO   es[o.elasticsearch.node]  [sonar-1479195694200] initializing ...
2016.11.15 08:41:38 INFO   es[o.e.plugins]  [sonar-1479195694200] loaded [], sites []
2016.11.15 08:41:38 INFO   es[o.elasticsearch.env]  [sonar-1479195694200] using [1] data paths, mounts [[(C:)]], net usable_space [47.6gb], net total_space [69.4gb], types [NTFS]
2016.11.15 08:41:42 WARN   es[o.e.bootstrap]  JNA not found. native methods will be disabled.
2016.11.15 08:41:43 INFO   es[o.elasticsearch.node]  [sonar-1479195694200] initialized
2016.11.15 08:41:43 INFO   es[o.elasticsearch.node]  [sonar-1479195694200] starting ...
2016.11.15 08:41:43 INFO   es[o.e.transport]  [sonar-1479195694200] bound_address {inet[/127.0.0.1:9003]}, publish_address {inet[/127.0.0.1:9003]}
2016.11.15 08:41:43 INFO   es[o.e.discovery]  [sonar-1479195694200] sonarqube/uESU6pKmQN2-u4e3ITgQRQ
2016.11.15 08:41:46 INFO   es[o.e.cluster.service]  [sonar-1479195694200] new_master [sonar-1479195694200][uESU6pKmQN2-u4e3ITgQRQ][sonarqube][inet[/127.0.0.1:9003]]{rack_id=sonar-1479195694200}, reason: zen-disco-join (elected_as_master)
2016.11.15 08:41:46 INFO   es[o.elasticsearch.node]  [sonar-1479195694200] started
2016.11.15 08:41:47 INFO   es[o.e.gateway]  [sonar-1479195694200] recovered [0] indices into cluster_state
2016.11.15 08:41:47 INFO  app[o.s.p.m.Monitor] Process[es] is up
2016.11.15 08:41:47 INFO  app[o.s.p.m.JavaProcessLauncher] Launch process[web]: c:\tools\java\jdk1.8.0_66\jre\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Djruby.compile.invokedynamic=false -Xmx2G -Xms512m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -server -Djava.io.tmpdir=C:\tools\sonarqube_playground\temp -javaagent:c:\tools\java\jdk1.8.0_66\jre\lib\management-agent.jar -cp ./lib/common/*;./lib/server/*;C:\tools\sonarqube_playground\extensions\jdbc-driver\oracle\ojdbc7.jar org.sonar.server.app.WebServer C:\tools\sonarqube_playground\temp\sq-process4855516278340356405properties
2016.11.15 08:41:48 INFO  web[o.s.p.ProcessEntryPoint] Starting web
2016.11.15 08:41:49 INFO  web[o.s.s.a.TomcatContexts] Webapp directory: C:\tools\sonarqube_playground\web
2016.11.15 08:41:50 INFO  web[o.a.c.h.Http11NioProtocol] Initializing ProtocolHandler ["http-nio-0.0.0.0-9001"]
2016.11.15 08:41:50 INFO  web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2016.11.15 08:41:55 INFO  web[o.s.s.p.ServerImpl] SonarQube Server / 5.6.3 / 3fcc98a73d6afb99388e39f46272909a6d6600b2
2016.11.15 08:41:55 INFO  web[o.sonar.db.Database] Create JDBC data source for jdbc:oracle:thin:[dbconnectionargumentsommittedforsecurity]
2016.11.15 08:41:59 WARN  web[o.s.s.p.DatabaseServerCompatibility] Database must be upgraded. Please backup database and browse /setup
2016.11.15 08:41:59 INFO  web[o.s.s.p.DefaultServerFileSystem] SonarQube home: C:\tools\sonarqube_playground
2016.11.15 08:42:00 INFO  web[o.e.plugins] [sonar-1479195694200] loaded [], sites []
2016.11.15 08:42:01 INFO  web[o.s.s.p.RailsAppsDeployer] Deploying Ruby on Rails applications
2016.11.15 08:42:02 INFO  web[o.s.s.p.Platform] DB needs migration, entering safe mode
2016.11.15 08:42:02 INFO  web[jruby.rack] jruby 1.7.9 (ruby-1.8.7p370) 2013-12-06 87b108a on Java HotSpot(TM) 64-Bit Server VM 1.8.0_66-b17 [Windows Server 2012 R2-amd64]
2016.11.15 08:42:02 INFO  web[jruby.rack] using a shared (threadsafe!) runtime
2016.11.15 08:42:25 INFO  web[jruby.rack] keeping custom (config.logger) Rails logger instance
2016.11.15 08:42:25 INFO  web[o.a.c.h.Http11NioProtocol] Starting ProtocolHandler ["http-nio-0.0.0.0-9001"]
2016.11.15 08:42:25 INFO  web[o.s.s.a.TomcatAccessLog] Web server is started
2016.11.15 08:42:25 INFO  web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9001
2016.11.15 08:42:25 INFO  app[o.s.p.m.Monitor] Process[web] is up
2016.11.15 08:42:25 INFO  app[o.s.p.m.JavaProcessLauncher] Launch process[ce]: c:\tools\java\jdk1.8.0_66\jre\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Xmx2G -Xms512m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -server -Djava.io.tmpdir=C:\tools\sonarqube_playground\temp -javaagent:c:\tools\java\jdk1.8.0_66\jre\lib\management-agent.jar -cp ./lib/common/*;./lib/server/*;./lib/ce/*;C:\tools\sonarqube_playground\extensions\jdbc-driver\oracle\ojdbc7.jar org.sonar.ce.app.CeServer C:\tools\sonarqube_playground\temp\sq-process8088446918777658625properties
2016.11.15 08:42:27 INFO  ce[o.s.p.ProcessEntryPoint] Starting ce
2016.11.15 08:42:27 INFO  ce[o.s.c.a.WebServerWatcherImpl] Waiting for Web Server to be operational...
2016.11.15 08:42:28 INFO  ce[o.s.c.a.WebServerWatcherImpl] Still waiting for WebServer...
2016.11.15 08:42:30 INFO  ce[o.s.c.a.WebServerWatcherImpl] Still waiting for WebServer...
2016.11.15 08:42:35 INFO  ce[o.s.c.a.WebServerWatcherImpl] Still waiting for WebServer...
2016.11.15 08:42:48 INFO  ce[o.s.c.a.WebServerWatcherImpl] Still waiting for WebServer...
2016.11.15 08:43:23 INFO  ce[o.s.c.a.WebServerWatcherImpl] Still waiting for WebServer...
2016.11.15 08:44:58 INFO  ce[o.s.c.a.WebServerWatcherImpl] Still waiting for WebServer...
2016.11.15 08:49:17 INFO  ce[o.s.c.a.WebServerWatcherImpl] Still waiting for WebServer...
2016.11.15 09:01:01 INFO  ce[o.s.c.a.WebServerWatcherImpl] Still waiting for WebServer...
2016.11.15 09:32:55 INFO  ce[o.s.c.a.WebServerWatcherImpl] Still waiting for WebServer...
1
Can you send the full logs/sonar.logs please ? - Simon Brandhof - SonarSource
Added log to my description as requested - Markus Hastreiter
One option is that the DB connection has access to multiple Oracle schemas of SonarQube. You should restrict the privilege of user to only one schema. - Simon Brandhof - SonarSource
Problem solved: forceAuthentication was set to "true", but Setup page didn't offer me a login. Apparently I was not authorized to start the schema update. After setting forceAuthentication to false and restarting the service clicking on Upgrade finally started the schema update. Thanks for the help and suggestions. - Markus Hastreiter

1 Answers

0
votes

I inspected the HTML of the setup page, extracted the URL the button would call and tried to use it manually. I got a "Not authorized" response. This got me thinking about authorization.

Long story short: in my sonar.properties file the option sonar.forceAuthentication" was set to "true" because I don't want anonymous access. Everybody should be logged-in when using Sonarqube. But the setup page doesn't have any "login" option. So apparently to start the schema update I needed to be logged-in, but the page did not support to log-in.

After setting sonar.forceAuthentication to "false" in the sonar.properties file and restarting the service I was finally able to start the schema update.