SonarQube is not connecting to Azure SQL after upgrade to 8.9.2

I’ve been trying to upgrade our SonarQube instance to enterprise but having a problem.

Please see the web.log attached.

We are now on 8.9.1.44547 and we want to upgrade to 8.9.2.46101 (developer edition)
Our SQ running on Windows Server, our database is Azure SQL.
I’ve used the manual for upgrade (as always, and previously I had no issues at all). I’m using the same configuration.
After upgrade, based on the logs, SQ can’t connect to database.

I’ve tried to upgrade to both Enterprise edition (which we recently bought and want to move to this version) and Developer edition (which we are using now) — same error.

When I’m rolling back to the old build everything work absolutely fine, without any errors. Also the connection to database was tested from the server where the SQ is running.

My config:

sonar.jdbc.username=USERNAME@sonarcube-sqlserver
sonar.jdbc.password=PASSWORD
sonar.jdbc.url=jdbc:sqlserver://URL_HIDDEN:1433;databaseName=database-sonarcube;ssl=require;SelectMethod=Cursor
sonar.web.port=9000

sonar.security.realm=LDAP
ldap.url=ldaps://URL_HIDDEN:3269
ldap.bindDn=CN=sonar.service,OU=Service Accounts,OU=Users,OU=Global IT,OU=Valtech,DC=valtech,DC=com
ldap.bindPassword=
#UsersConfig

ldap.user.baseDn=DC=valtech,DC=com
ldap.user.request=(&(objectClass=user)(sAMAccountName={login})(memberOf=CN=GL.SonarQube.Access,OU=SonarQube,OU=Security Groups,OU=Global IT,OU=Valtech,DC=valtech,DC=com))
ldap.user.realNameAttribute=cn
ldap.user.emailAttribute=mail

#GroupsConfig

ldap.group.baseDn=OU=SonarQube,OU=Security Groups,OU=Global IT,OU=Valtech,DC=valtech,DC=com
ldap.group.request=(&(objectClass=group)(member={dn}))

Please advice.

sonar-web-log.txt (9.3 KB)

Hi,

Welcome to the community!

The errors in the web log (kudos for including it in the first post! :slightly_smiling_face:) are pretty clear:

2021.09.20 13:45:37 ERROR web[][o.s.s.p.PlatformImpl] Web server startup failed
java.lang.IllegalStateException: Fail to connect to database
...
Caused by: java.lang.IllegalStateException: Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.').
...
Caused by: java.sql.SQLException: Cannot create PoolableConnectionFactory (Login failed for user ''. ClientConnectionId:ce4f13d1-14b9-4127-a350-5912d227e40e)

So it looks like you need to double-check our DB settings.

 
HTH,
Ann

Hi Ann,

Thanks for your reply.

Apparently the problem was not with the settings itself (because the same settings was working absolutely fine with the old build) but with the way I was editing the config file.
What I was doing earlier it’s just copying all content from the old sonar.properties to the new file (I wasn’t copying the file itself, just the content inside it).
The resolution was to open sonar.properties from the new built, uncomment and edit each required line.
I’m not sure why it is so, because previously I haven’t had any issues with just copying content of the file…

1 Like

Hi,

I guess this must have been about whitespace characters. Anyway, thanks for the followup.

 
Ann

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.