2019.12.02 12:55:26 ERROR web[][o.s.s.p.PlatformImpl] Web server startup failed: Current version is too old. Please upgrade to Long Term Support version firstly

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) : Upgraded Sonarqube-6.7.6 to Sonarqube-8.0
  • what are you trying to achieve: Trying to integrate AWS RDS Postgresql DB in sonarqube
  • what have you tried so far to achieve this

Connection Details: sonar.properties
sonar.jdbc.username=xxxx
sonar.jdbc.password=xxxx
sonar.jdbc.url=jdbc:postgresql://sonarpostgres.ccix2qp0lqjg.eu-west-1.rds.amazonaws.com:5432/sonardb

sonar.log ::::

ā€“> 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.

2019.12.02 12:55:04 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonar/sonarqube-8.0/temp
2019.12.02 12:55:04 INFO app[o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2019.12.02 12:55:04 INFO app[o.s.a.ProcessLauncherImpl] Launch process[[key=ā€˜esā€™, ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonar/sonarqube-8.0/elasticsearch]: /opt/sonar/sonarqube-8.0/elasticsearch/bin/elasticsearch
2019.12.02 12:55:04 INFO app[o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
Java HotSpotā„¢ 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2019.12.02 12:55:05 INFO app[o.e.p.PluginsService] no modules loaded
2019.12.02 12:55:05 INFO app[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2019.12.02 12:55:19 INFO app[o.s.a.SchedulerImpl] Process[es] is up
2019.12.02 12:55:19 INFO app[o.s.a.ProcessLauncherImpl] Launch process[[key=ā€˜webā€™, ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonar/sonarqube-8.0]: /usr/java/jdk-12.0.2/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonar/sonarqube-8.0/temp --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 -Dhttp.nonProxyHosts=localhost|127.|[::1] -cp ./lib/common/:/opt/sonar/sonarqube-8.0/lib/jdbc/postgresql/postgresql-42.2.5.jar org.sonar.server.app.WebServer /opt/sonar/sonarqube-8.0/temp/sq-process3138926842772280881properties
2019.12.02 12:55:26 INFO app[o.s.a.SchedulerImpl] Process[web] is stopped
2019.12.02 12:55:27 WARN app[o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 143
2019.12.02 12:55:27 INFO app[o.s.a.SchedulerImpl] Process[es] is stopped
2019.12.02 12:55:27 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped

es.log :::

2019.12.02 12:55:09 INFO es[o.e.e.NodeEnvironment] using [1] data paths, mounts [[/ (/dev/nvme0n1p1)]], net usable_space [4.9gb], net total_space [7.9gb], types [xfs]
2019.12.02 12:55:09 INFO es[o.e.e.NodeEnvironment] heap size [495.3mb], compressed ordinary object pointers [true]
2019.12.02 12:55:09 INFO es[o.e.n.Node] node name [sonarqube], node ID [Mx98bokRTPSNSw3Pr8y0yg]
2019.12.02 12:55:09 INFO es[o.e.n.Node] version[6.8.0], pid[8523], build[default/tar/65b6179/2019-05-15T20:06:13.172855Z], OS[Linux/4.14.138-114.102.amzn2.x86_64/amd64], JVM[Oracle Corporation/Java HotSpotā„¢ 64-Bit Server VM/12.0.2/12.0.2+10]
2019.12.02 12:55:09 INFO es[o.e.n.Node] JVM arguments [-XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -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, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/opt/sonar/sonarqube-8.0/temp, -XX:ErrorFile=ā€¦/logs/es_hs_err_pid%p.log, -Des.enforce.bootstrap.checks=true, -Xmx512m, -Xms512m, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/opt/sonar/sonarqube-8.0/elasticsearch, -Des.path.conf=/opt/sonar/sonarqube-8.0/temp/conf/es, -Des.distribution.flavor=default, -Des.distribution.type=tar]
2019.12.02 12:55:10 INFO es[o.e.p.PluginsService] loaded module [analysis-common]
2019.12.02 12:55:10 INFO es[o.e.p.PluginsService] loaded module [lang-painless]
2019.12.02 12:55:10 INFO es[o.e.p.PluginsService] loaded module [mapper-extras]
2019.12.02 12:55:10 INFO es[o.e.p.PluginsService] loaded module [parent-join]
2019.12.02 12:55:10 INFO es[o.e.p.PluginsService] loaded module [percolator]
2019.12.02 12:55:10 INFO es[o.e.p.PluginsService] loaded module [reindex]
2019.12.02 12:55:10 INFO es[o.e.p.PluginsService] loaded module [repository-url]
2019.12.02 12:55:10 INFO es[o.e.p.PluginsService] loaded module [transport-netty4]
2019.12.02 12:55:10 INFO es[o.e.p.PluginsService] no plugins loaded
2019.12.02 12:55:14 WARN es[o.e.d.c.s.Settings] [http.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.
2019.12.02 12:55:15 INFO es[o.e.d.DiscoveryModule] using discovery type [zen] and host providers [settings]
2019.12.02 12:55:16 INFO es[o.e.n.Node] initialized
2019.12.02 12:55:16 INFO es[o.e.n.Node] starting ā€¦
2019.12.02 12:55:16 INFO es[o.e.t.TransportService] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2019.12.02 12:55:16 INFO es[o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
2019.12.02 12:55:19 INFO es[o.e.c.s.MasterService] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {sonarqube}{Mx98bokRTPSNSw3Pr8y0yg}{5hZCYswRTnSqCaBjlWCIBQ}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}
2019.12.02 12:55:19 INFO es[o.e.c.s.ClusterApplierService] new_master {sonarqube}{Mx98bokRTPSNSw3Pr8y0yg}{5hZCYswRTnSqCaBjlWCIBQ}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}, reason: apply cluster state (from master [master {sonarqube}{Mx98bokRTPSNSw3Pr8y0yg}{5hZCYswRTnSqCaBjlWCIBQ}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
2019.12.02 12:55:19 INFO es[o.e.n.Node] started
2019.12.02 12:55:19 INFO es[o.e.g.GatewayService] recovered [0] indices into cluster_state
2019.12.02 12:55:26 INFO es[o.e.n.Node] stopping ā€¦
2019.12.02 12:55:26 INFO es[o.e.n.Node] stopped
2019.12.02 12:55:26 INFO es[o.e.n.Node] closing ā€¦
2019.12.02 12:55:26 INFO es[o.e.n.Node] closed
~

web.log :::

2019.12.02 12:55:20 INFO web[o.s.p.ProcessEntryPoint] Starting web
2019.12.02 12:55:21 INFO web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2019.12.02 12:55:22 INFO web[o.e.p.PluginsService] no modules loaded
2019.12.02 12:55:22 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
2019.12.02 12:55:22 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2019.12.02 12:55:22 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2019.12.02 12:55:24 INFO web[o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2019.12.02 12:55:24 INFO web[o.s.s.p.LogServerVersion] SonarQube Server / 8.0.0.29455 / f869d840f12a4dfa69533e17d3b27558617a7f82
2019.12.02 12:55:24 INFO web[o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://sonarpostgres.ccix2qp0lqjg.eu-west-1.rds.amazonaws.com:5432/sonardb
2019.12.02 12:55:26 INFO web[o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonar/sonarqube-8.0
2019.12.02 12:55:26 INFO web[o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2019.12.02 12:55:26 ERROR web[o.s.s.p.PlatformImpl] Web server startup failed: Current version is too old. Please upgrade to Long Term Support version firstly.
2019.12.02 12:55:26 INFO web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2019.12.02 12:55:26 INFO web[o.s.p.ProcessEntryPoint] Hard stopping process

Greetings,

A stop at intermediary LTS versions is required to update to any version of SonarQube (meaning you need to first upgrade to v7.9 LTS, and then you can upgrade to v8.0

Best regards,

Colin

Hi Colin,

I upgraded to v7.9 but still facing the same issue.

I faced the same problemā€¦ I was using verision 7.6 and tried to updated to 8.0ā€¦ at the end I followed these steps:

  1. Downloaded the version 7.9.1 and ran the appā€¦ it asked to upgrade de db ā€œmanuallyā€ accessing the /setup (my case https:IP-SERVER:9000/setup) and there was a button to upgrade the db.
  2. After 1 done, I tested the app was ok, logging in and out.
  3. I ran the verion 8.0 and I needed to do the same process of update the DB navigating to /setup
  4. All good!

I believe this information about upgrade from on version to a new should be informedā€¦ that you need to upgrade version by version.

Hope you can reach out this!

Cheers
Rafael D

Hi,

it is part of the documentation Upgrade guide
maybe more examples woud help !?
Problem is, updating from 7.6 to 8.0 straight doesnā€™t work, as there is a LTS version
in between - 7.9.1 in this case.

as Colin already posted :wink:

Gilbert

1 Like

I ugraded from 6.7 to 7.0 and it is working fine.
But while upgrading, i am facing the following issue.

2019.12.05 06:40:12 INFO web[o.s.p.ProcessEntryPoint] Starting web
2019.12.05 06:40:13 INFO web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2019.12.05 06:40:14 INFO web[o.e.p.PluginsService] no modules loaded
2019.12.05 06:40:14 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin]
2019.12.05 06:40:14 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
2019.12.05 06:40:14 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2019.12.05 06:40:14 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2019.12.05 06:40:16 INFO web[o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2019.12.05 06:40:16 INFO web[o.s.s.p.LogServerVersion] SonarQube Server / 7.0.0.36138 / 3b827a9a9a4b133c9fbe168aec8db44d78efeaeb
2019.12.05 06:40:16 INFO web[o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://sonarpostgres.ccix2qp0lqjg.eu-west-1.rds.amazonaws.com:5432/sonardatabase
2019.12.05 06:40:17 INFO web[o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonar/sonarqube-7.0
2019.12.05 06:40:17 INFO web[o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2019.12.05 06:40:17 WARN web[o.s.s.p.DatabaseServerCompatibility] Database must be upgraded. Please backup database and browse /setup
2019.12.05 06:40:17 INFO web[o.s.s.p.d.m.c.PostgresCharsetHandler] Verify that database charset supports UTF8
2019.12.05 06:40:18 INFO web[o.s.s.p.Platform] Database needs migration
2019.12.05 06:40:18 INFO web[o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceFilter@4779757e [pattern=UrlPattern{inclusions=[/api/system/migrate_db/, ā€¦], exclusions=[/api/properties, ā€¦]}]
2019.12.05 06:40:18 INFO web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2019.12.05 06:40:21 INFO web[o.s.s.p.d.m.DatabaseMigrationImpl] Starting DB Migration and container restart
2019.12.05 06:40:21 INFO web[DbMigrations] Executing DB migrationsā€¦
2019.12.05 06:40:21 INFO web[DbMigrations] #1247 ā€˜Populate column RULES_PROFILES.LAST_USEDā€™ā€¦
2019.12.05 06:40:21 ERROR web[DbMigrations] #1247 ā€˜Populate column RULES_PROFILES.LAST_USEDā€™: failure | time=25ms
2019.12.05 06:40:21 ERROR web[DbMigrations] Executed DB migrations: failure | time=26ms
2019.12.05 06:40:21 ERROR web[o.s.s.p.d.m.DatabaseMigrationImpl] DB migration failed | time=144ms
2019.12.05 06:40:21 ERROR web[o.s.s.p.d.m.DatabaseMigrationImpl] DB migration ended with an exception
org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #1247 ā€˜Populate column RULES_PROFILES.LAST_USEDā€™ failed
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:79)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:67)
at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720)
at java.base/java.util.stream.ReferencePipeline$Head.forEachOrdered(ReferencePipeline.java:668)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:52)
at org.sonar.server.platform.db.migration.engine.MigrationEngineImpl.execute(MigrationEngineImpl.java:50)
at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doUpgradeDb(DatabaseMigrationImpl.java:105)
at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doDatabaseMigration(DatabaseMigrationImpl.java:80)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: smallint = boolean
Hint: No operator matches the given name and argument types. You might need to add explicit type casts.
Position: 169
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2422)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2167)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:118)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.sonar.server.platform.db.migration.step.SelectImpl.scroll(SelectImpl.java:74)
at org.sonar.server.platform.db.migration.version.v60.PopulateLastUsedColumnOfRulesProfiles.buildQualityProfilesMap(PopulateLastUsedColumnOfRulesProfiles.java:62)
at org.sonar.server.platform.db.migration.version.v60.PopulateLastUsedColumnOfRulesProfiles.execute(PopulateLastUsedColumnOfRulesProfiles.java:43)
at org.sonar.server.platform.db.migration.step.DataChange.execute(DataChange.java:44)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:75)
ā€¦ 10 common frames omitted
^C

I changed the datatype by executing the following commands and restarted the sonarqube.
But still i am facing the same issue.

select * from sonar.rules_profiles;

delete from sonar.rules_profiles;

alter table sonar.rules_profiles drop column is_default;

alter table sonar.rules_profiles add column is_default boolean;

alter table sonar.rules_profiles drop column last_used;

alter table sonar.rules_profiles add column last_used bigint;

Why are you upgrading to SonarQube 7.0 instead of 7.9 LTS? You need to make a stop at LTS versions, not other versions. :slight_smile:

Colin

Hi Colin,

When i upgraded to 7.9 from 6.7, i faced the same issue.

2019.12.02 12:55:26 ERROR web[o.s.s.p.PlatformImpl] Web server startup failed: Current version is too old. Please upgrade to Long Term Support version firstly.

So according to the upgrade guide, i upgraded to 7.0 from 6.7 and trying to upgrade the DB.While doing that, i m facing the db issue.
Only if it is successful, i can upgrade further to 7.9 from 7.0

1 Like

That timestamp is from you attempted upgrade to v8.0, not v7.9!

2019.12.02 12:55:24 INFO web[o.s.s.p.LogServerVersion] SonarQube Server / 8.0.0.29455 / f869d840f12a4dfa69533e17d3b27558617a7f82
2019.12.02 12:55:24 INFO web[o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://sonarpostgres.ccix2qp0lqjg.eu-west-1.rds.amazonaws.com:5432/sonardb
2019.12.02 12:55:26 INFO web[o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonar/sonarqube-8.0
2019.12.02 12:55:26 INFO web[o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2019.12.02 12:55:26 ERROR web[o.s.s.p.PlatformImpl] Web server startup failed: Current version is too old. Please upgrade to Long Term Support version firstly.
2019.12.02 12:55:26 INFO web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000

Hi Colin,

I faced the same issue with 7.9 as well.

2019.12.03 08:05:20 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2019.12.03 08:05:20 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2019.12.03 08:05:22 INFO web[o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2019.12.03 08:05:22 INFO web[o.s.s.p.LogServerVersion] SonarQube Server / 7.9.0.26994 / 687d8007c0f62bfaaa44a890d93397de0a588119
2019.12.03 08:05:22 INFO web[o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://sonarpostgres.ccix2qp0lqjg.eu-west-1.rds.amazonaws.com:5432/sonardatabase
2019.12.03 08:05:24 INFO web[o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonar/sonarqube-7.9
2019.12.03 08:05:24 INFO web[o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2019.12.03 08:05:24 ERROR web[o.s.s.p.Platform] Web server startup failed: Current version is too old. Please upgrade to Long Term Support version firstly.
2019.12.03 08:05:24 INFO web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2019.12.03 08:05:24 INFO web[o.s.p.ProcessEntryPoint] Hard stopping process

So according to the upgrade guide, i tried upgrading from 6.7 to 7.0 and this issue no longer occured.
But i am facing issues with DB Migration.

2019.12.05 06:40:12 INFO web[o.s.p.ProcessEntryPoint] Starting web
2019.12.05 06:40:13 INFO web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2019.12.05 06:40:14 INFO web[o.e.p.PluginsService] no modules loaded
2019.12.05 06:40:14 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin]
2019.12.05 06:40:14 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
2019.12.05 06:40:14 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2019.12.05 06:40:14 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2019.12.05 06:40:16 INFO web[o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2019.12.05 06:40:16 INFO web[o.s.s.p.LogServerVersion] SonarQube Server / 7.0.0.36138 / 3b827a9a9a4b133c9fbe168aec8db44d78efeaeb
2019.12.05 06:40:16 INFO web[o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://sonarpostgres.ccix2qp0lqjg.eu-west-1.rds.amazonaws.com:5432/sonardatabase
2019.12.05 06:40:17 INFO web[o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonar/sonarqube-7.0
2019.12.05 06:40:17 INFO web[o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2019.12.05 06:40:17 WARN web[o.s.s.p.DatabaseServerCompatibility] Database must be upgraded. Please backup database and browse /setup
2019.12.05 06:40:17 INFO web[o.s.s.p.d.m.c.PostgresCharsetHandler] Verify that database charset supports UTF8
2019.12.05 06:40:18 INFO web[o.s.s.p.Platform] Database needs migration
2019.12.05 06:40:18 INFO web[o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceFilter@4779757e [pattern=UrlPattern{inclusions=[/api/system/migrate_db/ , ā€¦], exclusions=[/api/properties , ā€¦]}]
2019.12.05 06:40:18 INFO web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2019.12.05 06:40:21 INFO web[o.s.s.p.d.m.DatabaseMigrationImpl] Starting DB Migration and container restart
2019.12.05 06:40:21 INFO web[DbMigrations] Executing DB migrationsā€¦
2019.12.05 06:40:21 INFO web[DbMigrations] #1247 ā€˜Populate column RULES_PROFILES.LAST_USEDā€™ā€¦
2019.12.05 06:40:21 ERROR web[DbMigrations] #1247 ā€˜Populate column RULES_PROFILES.LAST_USEDā€™: failure | time=25ms
2019.12.05 06:40:21 ERROR web[DbMigrations] Executed DB migrations: failure | time=26ms
2019.12.05 06:40:21 ERROR web[o.s.s.p.d.m.DatabaseMigrationImpl] DB migration failed | time=144ms
2019.12.05 06:40:21 ERROR web[o.s.s.p.d.m.DatabaseMigrationImpl] DB migration ended with an exception
org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #1247 ā€˜Populate column RULES_PROFILES.LAST_USEDā€™ failed
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:79)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:67)
at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720)
at java.base/java.util.stream.ReferencePipeline$Head.forEachOrdered(ReferencePipeline.java:668)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:52)
at org.sonar.server.platform.db.migration.engine.MigrationEngineImpl.execute(MigrationEngineImpl.java:50)
at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doUpgradeDb(DatabaseMigrationImpl.java:105)
at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doDatabaseMigration(DatabaseMigrationImpl.java:80)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: smallint = boolean
Hint: No operator matches the given name and argument types. You might need to add explicit type casts.
Position: 169
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2422)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2167)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:118)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.sonar.server.platform.db.migration.step.SelectImpl.scroll(SelectImpl.java:74)
at org.sonar.server.platform.db.migration.version.v60.PopulateLastUsedColumnOfRulesProfiles.buildQualityProfilesMap(PopulateLastUsedColumnOfRulesProfiles.java:62)
at org.sonar.server.platform.db.migration.version.v60.PopulateLastUsedColumnOfRulesProfiles.execute(PopulateLastUsedColumnOfRulesProfiles.java:43)
at org.sonar.server.platform.db.migration.step.DataChange.execute(DataChange.java:44)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:75)
ā€¦ 10 common frames omitted
^C

I changed the datatype by executing the following commands and restarted the sonarqube.
But still i am facing the same issue.

select * from sonar.rules_profiles;

delete from sonar.rules_profiles;

alter table sonar.rules_profiles drop column is_default;

alter table sonar.rules_profiles add column is_default boolean;

alter table sonar.rules_profiles drop column last_used;

alter table sonar.rules_profiles add column last_used bigint;

Hi Colin,

Could you please help on this issue.

When it says LTS versions it means every LTS version between your version and the one you are aiming for. I upgraded from 6.1 to 8.1 and had to stop at 6.7 and 7.9 before proceeding.

HTH

Iā€™m on 9.1.0.47736 community that I downloaded just barely. I get the same issue. for context, I originally used the container sonarqube:8.6.0-community to launch my first database, it loaded in the schema and I decided I wanted to switch to the zipped installation on a single instance for my front end.

2021.10.21 17:21:24 INFO web[o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://localhost:5432/sonar_community
^[[B2021.10.21 17:21:27 INFO web[o.s.s.p.ServerFileSystemImpl] SonarQube home: /home/sonar/sonarqube-9.1.0.47736
^[[A2021.10.21 17:21:27 ERROR web[o.s.s.p.PlatformImpl] Web server startup failed: Current version is too old. Please upgrade to Long Term Support version firstly.
2021.10.21 17:21:27 INFO web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2021.10.21 17:21:27 INFO web[o.s.p.ProcessEntryPoint] Hard stopping process

When you go visit the download website it just hands you a version. Why would it not hand you LTS? How do I determine which release is an LTS version and download it?

https://binaries.sonarsource.com/Distribution/sonarqube/

Youā€™ll see all details and get all versions and editions at Download | SonarQube
For older versions you need to scroll down to ā€˜Historical downloadsā€™

I found the exception message a bit confusing, at first I thought it was about java LTS, maybe the message should mention Sonarqube like: ā€œCurrent version of Sonarqube is too old. Please upgrade to Long Term Support version firstlyā€