Insufficient privileges while restarting server

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)

Currently on 8.5.1, upgrading to 8.9.10

  • what are you trying to achieve
    Trying to upgrade sonarqube

  • what have you tried so far to achieve this
    I have done the procedure given, copied the new installation files, changed the sonar.properties file, stopped the old server using the command <SONARQUBE_HOME>/bin/linux-x86-64/sonar.sh stop and started the new one.

But when I navigate to the web URL and click on ‘Restart Server’ and then restart it as follows, I get an error message ‘Insufficient Priveleges’.

Any idea on how to resolve this? Moreover, when I navigate to [Preformatted text](https://sonarqube.orgname.com/setup), I get the message

Database is up-to-date

What am I doing wrong here?

Trying to stop the new server using the command <SONARQUBE_HOME>/bin/linux-x86-64/sonar.sh stop, I get the message:

Gracefully stopping SonarQube...
SonarQube was not running.

What could be the case here? Why is it not starting?

Hi,

It’s not clear to me why you were trying to use a web link to restart the server during an upgrade. For future reference, those in-app links don’t do a full restart.

To start the server you would use a start command, rather than a stop command…

 
Ann

Sorry, I think I wasn’t that clear.

So first I use start command, then to check, I use thestop command. But then I get the message:

`Gracefully stopping SonarQube…

SonarQube was not running.`

This means that when I first used the start command, it did not start the server. Why was that the case?

Secondly, to do the upgrade, once I kill the old process, and start the new process, then what do I do? I have to go to https://sonarqube.orgname.com/setup, correct?

Hi,

How long did you wait between commands? And what do your server logs say?

Have you read the Upgrade Guide?

 
Ann

The time difference was a couple of minutes at most. I haven’t checked the server logs, will do and post them here.

And yes I have read the upgrade guide. It tell me to stop the old server, start the new one, and then go to https://sonarqube.orgname.com/setup.

But the issues are:

1- New server isn’t starting
2- The URL says ‘Database is up to date’.

Let me check the server logs.

Hi,

If the URL says anything, then something is starting (or perhaps your old server was never shut down).

 
Ann

I changed the sonar.web.port to 9002, and started the server. Now by checking the status, I get

SonarQube is running (38041)

But when I navigate to http://yourSonarQubeServerURL/setup I get the following page:

image

Moreover, the version being displayed on the bottom of the home page is still the old one.

Here are all the logs:

Sonar:

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

2023.01.20 17:32:16 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube_v2/sonarqube-8.9.10.61524/temp
2023.01.20 17:32:16 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:40453, TCP: 127.0.0.1:46249]
2023.01.20 17:32:16 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube_v2/sonarqube-8.9.10.61524/elasticsearch]: /opt/sonarqube_v2/sonarqube-8.9.10.61524/elasticsearch/bin/elasticsearch
2023.01.20 17:32:16 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release
2023.01.20 17:32:24 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2023.01.20 17:32:25 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube_v2/sonarqube-8.9.10.61524]: /usr/lib/jvm/java-11-openjdk-amd64/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube_v2/sonarqube-8.9.10.61524/temp -XX:-OmitStackTraceInFastThrow --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -server -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-8.9.10.61524.jar:/opt/sonarqube_v2/sonarqube-8.9.10.61524/lib/jdbc/postgresql/postgresql-42.3.3.jar org.sonar.server.app.WebServer /opt/sonarqube_v2/sonarqube-8.9.10.61524/temp/sq-process6172102058285683152properties
2023.01.20 17:32:29 WARN  app[][startup] ################################################################################
2023.01.20 17:32:29 WARN  app[][startup] The database must be manually upgraded. Please backup the database and browse /setup. For more information: https://docs.sonarqube.org/latest/setup/upgrading
2023.01.20 17:32:29 WARN  app[][startup] ################################################################################

Web

2023.01.20 17:32:25 INFO  web[][o.s.p.ProcessEntryPoint] Starting web
2023.01.20 17:32:26 INFO  web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2023.01.20 17:32:26 INFO  web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [http://localhost:40453]
2023.01.20 17:32:27 INFO  web[][o.s.s.p.LogServerVersion] SonarQube Server / 8.9.10.61524 / b30ff33db8ea2d93551a6a3d4820452e0037d58f
2023.01.20 17:32:27 INFO  web[][o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://localhost/sonarqube
2023.01.20 17:32:28 INFO  web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube_v2/sonarqube-8.9.10.61524
2023.01.20 17:32:28 INFO  web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2023.01.20 17:32:29 WARN  web[][o.s.s.p.DatabaseServerCompatibility] The database must be manually upgraded. Please backup the database and browse /setup. For more information: https://docs.sonarqube.org/latest/setup/upgrading
2023.01.20 17:32:29 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin C# Code Quality and Security / 8.22.0.31243 / e3cee7838d992e31dcdd90cf4f7406bb20535e8e
2023.01.20 17:32:29 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin CSS Code Quality and Security / 1.4.2.2002 / faa7d4f1407df67df7ada53caf677ab783721173
2023.01.20 17:32:29 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Flex Code Quality and Security / 2.6.1.2564 / bb723840701bda72510b7a47742811d20daad331
2023.01.20 17:32:29 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Go Code Quality and Security / 1.8.3.2219 / d6ad7a5a47fc4785d2e80918fb7424be46e38a7f
2023.01.20 17:32:29 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin HTML Code Quality and Security / 3.4.0.2754 / 38f7ff864ae15152c9f1efc3014594f7e7ca7b6e
2023.01.20 17:32:29 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin JaCoCo / 1.1.1.1157 / 83478572b9f23efac29de15e30c7758bbb0c0e47
2023.01.20 17:32:29 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Java Code Quality and Security / 6.15.1.26025 / 1b1e96715bfa9f6a4ae24e95cc5b91f0edce609f
2023.01.20 17:32:29 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin JavaScript/TypeScript Code Quality and Security / 7.4.4.15624 / 481b2e69339b016b5d7d1eb27f0abf20dd6bd961
2023.01.20 17:32:29 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Kotlin Code Quality and Security / 1.8.3.2219 / d6ad7a5a47fc4785d2e80918fb7424be46e38a7f
2023.01.20 17:32:29 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin PHP Code Quality and Security / 3.17.0.7439 / 44c7760147080c157fa0ff579772f92d3c8e1ebf
2023.01.20 17:32:29 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Python Code Quality and Security / 3.4.1.8066 / 22139ec73fb2f32044f66477ea52734415683668
2023.01.20 17:32:29 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Ruby Code Quality and Security / 1.8.3.2219 / d6ad7a5a47fc4785d2e80918fb7424be46e38a7f
2023.01.20 17:32:29 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Scala Code Quality and Security / 1.8.3.2219 / d6ad7a5a47fc4785d2e80918fb7424be46e38a7f
2023.01.20 17:32:29 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin VB.NET Code Quality and Security / 8.22.0.31243 / e3cee7838d992e31dcdd90cf4f7406bb20535e8e
2023.01.20 17:32:29 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin XML Code Quality and Security / 2.2.0.2973 / 16002945f0725643a7b42f090572795dd8b72a0f
2023.01.20 17:32:29 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin solidity-plugin / 1.0.1 / null
2023.01.20 17:32:31 INFO  web[][o.s.s.p.d.m.c.PostgresCharsetHandler] Verify that database charset supports UTF8
2023.01.20 17:32:31 INFO  web[][o.s.s.p.Platform] Database needs to be migrated. Please refer to https://docs.sonarqube.org/latest/setup/upgrading
2023.01.20 17:32:31 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.platform.web.WebServiceFilter@305ad31b [pattern=UrlPattern{inclusions=[/api/system/migrate_db.*, ...], exclusions=[/api/components/update_key, ...]}]
2023.01.20 17:32:31 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9002

ES

2023.01.20 17:32:18 INFO  es[][o.e.n.Node] version[7.16.2], pid[38073], build[default/tar/2b937c44140b6559905130a8650c64dbd0879cfb/2021-12-18T19:42:46.604893745Z], OS[Linux/5.15.0-1028-aws/amd64], JVM[Ubuntu/OpenJDK 64-Bit Server VM/11.0.17/11.0.17+8-post-Ubuntu-1ubuntu220.04]
2023.01.20 17:32:18 INFO  es[][o.e.n.Node] JVM home [/usr/lib/jvm/java-11-openjdk-amd64]
2023.01.20 17:32:18 INFO  es[][o.e.n.Node] JVM arguments [-XX:+UseG1GC, -Djava.io.tmpdir=/opt/sonarqube_v2/sonarqube-8.9.10.61524/temp, -XX:ErrorFile=../logs/es_hs_err_pid%p.log, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djna.tmpdir=/opt/sonarqube_v2/sonarqube-8.9.10.61524/temp, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j2.formatMsgNoLookups=true, -Djava.locale.providers=COMPAT, -Des.enforce.bootstrap.checks=true, -Xmx512m, -Xms512m, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/opt/sonarqube_v2/sonarqube-8.9.10.61524/elasticsearch, -Des.path.conf=/opt/sonarqube_v2/sonarqube-8.9.10.61524/temp/conf/es, -Des.distribution.flavor=default, -Des.distribution.type=tar, -Des.bundled_jdk=false]
2023.01.20 17:32:19 INFO  es[][o.e.p.PluginsService] loaded module [analysis-common]
2023.01.20 17:32:19 INFO  es[][o.e.p.PluginsService] loaded module [lang-painless]
2023.01.20 17:32:19 INFO  es[][o.e.p.PluginsService] loaded module [parent-join]
2023.01.20 17:32:19 INFO  es[][o.e.p.PluginsService] loaded module [reindex]
2023.01.20 17:32:19 INFO  es[][o.e.p.PluginsService] loaded module [transport-netty4]
2023.01.20 17:32:19 INFO  es[][o.e.p.PluginsService] no plugins loaded
2023.01.20 17:32:19 INFO  es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/ (/dev/root)]], net usable_space [166.7gb], net total_space [193.8gb], types [ext4]
2023.01.20 17:32:19 INFO  es[][o.e.e.NodeEnvironment] heap size [512mb], compressed ordinary object pointers [true]
2023.01.20 17:32:19 INFO  es[][o.e.n.Node] node name [sonarqube], node ID [8OhMiTquQe-JvqqJRhIMRQ], cluster name [sonarqube], roles [data_frozen, master, remote_cluster_client, data, data_content, data_hot, data_warm, data_cold, ingest]
2023.01.20 17:32:23 INFO  es[][o.e.t.NettyAllocator] creating NettyAllocator with the following configs: [name=unpooled, suggested_max_allocation_size=256kb, factors={es.unsafe.use_unpooled_allocator=null, g1gc_enabled=true, g1gc_region_size=1mb, heap_size=512mb}]
2023.01.20 17:32:23 INFO  es[][o.e.d.DiscoveryModule] using discovery type [zen] and seed hosts providers [settings]
2023.01.20 17:32:23 INFO  es[][o.e.g.DanglingIndicesState] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
2023.01.20 17:32:24 INFO  es[][o.e.n.Node] initialized
2023.01.20 17:32:24 INFO  es[][o.e.n.Node] starting ...
2023.01.20 17:32:24 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:46249}, bound_addresses {127.0.0.1:46249}
2023.01.20 17:32:24 INFO  es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
2023.01.20 17:32:24 INFO  es[][o.e.c.c.Coordinator] cluster UUID [JiLGe7g_StGAu8PWHVOB_w]
2023.01.20 17:32:24 INFO  es[][o.e.c.s.MasterService] elected-as-master ([1] nodes joined)[{sonarqube}{8OhMiTquQe-JvqqJRhIMRQ}{j63BWND0TjGJOSOTogc8GA}{127.0.0.1}{127.0.0.1:46249}{cdfhimrsw} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 7, version: 13, delta: master node changed {previous [], current [{sonarqube}{8OhMiTquQe-JvqqJRhIMRQ}{j63BWND0TjGJOSOTogc8GA}{127.0.0.1}{127.0.0.1:46249}{cdfhimrsw}]}
2023.01.20 17:32:24 INFO  es[][o.e.c.s.ClusterApplierService] master node changed {previous [], current [{sonarqube}{8OhMiTquQe-JvqqJRhIMRQ}{j63BWND0TjGJOSOTogc8GA}{127.0.0.1}{127.0.0.1:46249}{cdfhimrsw}]}, term: 7, version: 13, reason: Publication{term=7, version=13}
2023.01.20 17:32:24 INFO  es[][o.e.h.AbstractHttpServerTransport] publish_address {127.0.0.1:40453}, bound_addresses {127.0.0.1:40453}
2023.01.20 17:32:24 INFO  es[][o.e.n.Node] started
2023.01.20 17:32:24 INFO  es[][o.e.g.GatewayService] recovered [0] indices into cluster_state

Any help?

Thanks

Hi,

I don’t know what to tell you. The logs you’ve shared indicate that a DB upgrade is needed. You should make sure you have only one instance running and/or that you’re navigating to the correct URL. Since you’ve changed the ports, it’s quite possible you have 2 instances running at once.

 
HTH,
Ann

I have stopped the old instance first before starting the new one.

Going through the process again, should I keep the port of the new instance the same as the old one and then navigate to the URL?

Since the old instance is stopped, the port should not be already occupied, correct?

Hi,

I knew this felt familiar. We appear to have two threads going about the same topic. I’m not going to give you different advice in this thread than I did in the other one.

 
Ann