Upgrading from v7.0.0 to v7.1.2, upon startup cant auth to Azure SQL Server using old jdbc string

database
azure

(Andrew) #1

Have been using SQ for 18 months, and have upgraded several times from our initial installed version of 6.7 LTS. We are currently using the Dev edition, v7.0.0.

We have a VM in azure as the SQ host, and using a Azure SQL DB.

When attempting to upgrade from v7.0.0 to v7.1.2, I have copy/pasted the JDBC connection string into the sonar.properties files; however, StartSonar.bat fails and complains of a DB auth error.

It appears that this is not a unique issue:


https://groups.google.com/forum/#!topic/sonarqube/GMOu-IwuUAE

From the threads above, I have tried to restructure my existing JDBC connection string (which works under v7.0.0) to break out the sonar.jdbc.url to now use the sonar.jdbc.username and sonar.jdbc.password properties without any luck to get v7.1.2 started.

My v7 sonar.jdbc.url is:
sonar.jdbc.url=jdbc:sqlserver://SERVER.database.windows.net:1433;database=DATABASE;user=USERNAME@SERVER;password=PASSWORD

I have also tried the following and get the same error:
sonar.jdbc.username=USERNAME@SERVER
sonar.jdbc.password=PASSWORD
sonar.jdbc.url=jdbc:sqlserver://SERVER.database.windows.net:1433;database=DATABASE;ssl=require;SelectMethod=Cursor

There have been zero changes on the DB side, and I can flip back to v7.0.0 and auth upon startup with no issues so I feel that this issue is specifically around the SQ version change from v7.0.0 to v7.1.2.

Is there a documented config change or fix for this auth error, or URL string adjustments?

Here is the output log file and complaint of "Login failed for user ‘’
*note, I have blanked out the sensitive info.

2018.08.01 17:00:36 INFO  web[][o.s.p.ProcessEntryPoint] Starting web
2018.08.01 17:00:37 INFO  web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2018.08.01 17:00:38 INFO  web[][o.e.p.PluginsService] no modules loaded
2018.08.01 17:00:38 INFO  web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
2018.08.01 17:00:38 INFO  web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2018.08.01 17:00:38 INFO  web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.08.01 17:00:40 INFO  web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2018.08.01 17:00:40 INFO  web[][o.s.s.p.LogServerVersion] SonarQube Server / 7.2.1.14109 / ec3b36b6cbe32cd9f53fa82c7ba617c703a18e4c
2018.08.01 17:00:40 INFO  web[][o.sonar.db.Database] Create JDBC data source for jdbc:sqlserver://VMNAME.database.windows.net:1433;database=DNAME;user=USER@HOST;password=PASSWORD
2018.08.01 17:00:41 ERROR web[][o.s.s.p.Platform] Web server startup failed
java.lang.IllegalStateException: Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.').
	at org.sonar.db.DefaultDatabase.checkConnection(DefaultDatabase.java:108)
	at org.sonar.db.DefaultDatabase.start(DefaultDatabase.java:75)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
	at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
	at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
	at org.picocontainer.behaviors.Stored.start(Stored.java:110)
	at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
	at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
	at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
	at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:90)
	at org.sonar.server.platform.Platform.start(Platform.java:211)
	at org.sonar.server.platform.Platform.startLevel1Container(Platform.java:170)
	at org.sonar.server.platform.Platform.init(Platform.java:86)
	at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:45)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Login failed for user ''. ClientConnectionId:c0fbe5df-1f25-4c32-9214-75f212db7049)
	at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
	at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
	at org.sonar.db.profiling.NullConnectionInterceptor.getConnection(NullConnectionInterceptor.java:31)
	at org.sonar.db.profiling.ProfiledDataSource.getConnection(ProfiledDataSource.java:322)
	at org.sonar.db.DefaultDatabase.checkConnection(DefaultDatabase.java:106)
	... 29 common frames omitted
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user ''. ClientConnectionId:c0fbe5df-1f25-4c32-9214-75f212db7049
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:258)
	at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:256)
	at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:108)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:4290)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:3157)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$100(SQLServerConnection.java:82)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:3121)
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7151)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2478)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:2026)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1687)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1528)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:866)
	at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:569)
	at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
	at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
	at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
	at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
	... 34 common frames omitted

Upgrade from 6.7 to 7.3 failed