My Service for SonarQube does not work, but when I run the StartSonar.bat file it does

I have SonarQube running fine on my VM when I run the StartSonar.bat file, but as a setup service it does not work. I set it up using NSSM.

Logs attached:
es.txt (44.5 KB)
web.txt (25.4 KB)
sonar.txt (2.6 KB)

Hello, do you see the database error in your web.log ?

Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.').

1 Like

Yes I see the error, but why would it work fine in StartSonar.bat?

If I recall correctly, when you use integratedSecurity=true in the connect string the MS SQL Server driver uses the Windows account credentials for authentication.

When you run StartSonar.bat manually it works because you’re running it with your own user.

Normally Windows services run with a “local system account”, maybe this is the reason why it doesn’t work. Have you tried reconfiguring the service with a Windows account?

image

1 Like

Yes. I actually had my server admin setup an admin account for me to use just for the service.

So when I setup the service I override the local user with that created person.

Would that affect how the database is being setup? Or why it’s saying it can’t access it? I did set the database up under my own personal account.