0

If I just run the StartSonar.bat everything works and starts fine.

If I setup a service to run using NSSM using:

  • Path: ..\blah\wrapper.exe
  • Startup directory: ..\blah
  • Arguments: -c ..\blah\conf\wrapper.conf

I get an error in the logs that says:

2019.06.24 16:03:49 INFO  web[][o.s.p.ProcessEntryPoint] Starting web
2019.06.24 16:03:50 INFO  web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2019.06.24 16:03:51 INFO  web[][o.e.p.PluginsService] no modules loaded
2019.06.24 16:03:51 INFO  web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
2019.06.24 16:03:51 INFO  web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2019.06.24 16:03:51 INFO  web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2019.06.24 16:03:52 INFO  web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2019.06.24 16:03:52 INFO  web[][o.s.s.p.LogServerVersion] SonarQube Server / 7.7.0.23042 / 1dcac8b8de36b377a1810cc8f1c4c31744e12729
2019.06.24 16:03:52 INFO  web[][o.sonar.db.Database] Create JDBC data source for jdbc:sqlserver://BRKPRCSQUBE1;databaseName=sonar;integratedSecurity=true
2019.06.24 16:03:53 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.').

That leads me to believe there is a problem with setting up the database correctly, but once again.. if I run the StartSonar.bat everything works fine.

The only thing I can think of is that I am setting up the service as a "Local System account," instead of when I run the bat it would be from my own account.

That being said, I cannot use my account and then login and change my password or something every time my AD changes.

obizues
  • 1,473
  • 5
  • 16
  • 30
  • 1
    You either have to create a database user, and change your connection string - remove IntegratedSecurity and add user name and password, or create technical account in your Active Directory with password that doesn't expire, and run your service under that account. – Peska Jun 25 '19 at 07:09
  • 1
    If you use StartSonar.bat you execute in the context of yourself. That is not the case when running as a service. The best solution is creating an account that has also access to the database (use an integrated login setup, see also the SonarQube documentation) and change the user running the service (see the service properties). – Jeroen Heier Jun 25 '19 at 18:13
  • @Peska thanks, that is likely what I will push for. – obizues Jun 26 '19 at 14:01

0 Answers0