Upgrade from 9.9.2 LTS to 9.9.3 LTS fails with ORA-01461

I am upgrading our SonarQube instance from 9.9.2LTS to 9.9.3LTS.

We are running Community Version on RHEL8, OpenJDK 17 and on a separate server, Oracle 19C.
The upgrade went smoothly on our test instance, but failed on the production instance. The log says:

2024.02.13 19:52:12 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube 
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
https://docs.oracle.com/error-help/db/ora-01461/
### The error may exist in org.sonar.db.ce.CeTaskCharacteristicMapper
### The error may involve org.sonar.db.ce.CeTaskCharacteristicMapper.insert-Inline
### The error occurred while setting parameters
### Cause: java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column

Our DBAs tell me there are no differences in the settings for the test and production databases.
Any suggestions, please?

Hi,

Welcome to the community!

Can you please check your server logs, in particular web.log for the full error message? Ideally, you’ll share at least a few lines leading up to the error as well.

 
Thx,
Ann

Of course. These are the last messages from the web.log before the one I posted initially. Sorry about the format, I juste pasted them in from the log.

2/13/24
7:52:11.000 PM	
2024.02.13 19:52:11 INFO  web[][o.s.s.i.i.AsyncIssueIndexingImpl] 5065 projects found in need of issue sync.
host = pil0au-sonar-app02.skead.nosource = /u01/sonar/sonar/logs/web.logsourcetype = log4j
2/13/24
7:52:11.000 PM	
2024.02.13 19:52:11 INFO  web[][o.s.s.i.i.AsyncIssueIndexingImpl] 15781 branch found in need of issue sync.
host = pil0au-sonar-app02.skead.nosource = /u01/sonar/sonar/logs/web.logsourcetype = log4j
2/13/24
7:52:11.000 PM	
2024.02.13 19:52:11 INFO  web[][o.s.s.i.i.AsyncIssueIndexingImpl] Tasks characteristics deletion complete.
host = pil0au-sonar-app02.skead.nosource = /u01/sonar/sonar/logs/web.logsourcetype = log4j
2/13/24
7:52:11.000 PM	
2024.02.13 19:52:11 INFO  web[][o.s.s.i.i.AsyncIssueIndexingImpl] Deleting tasks characteristics...
host = pil0au-sonar-app02.skead.nosource = /u01/sonar/sonar/logs/web.logsourcetype = log4j
2/13/24
7:52:11.000 PM	
2024.02.13 19:52:11 INFO  web[][o.s.s.i.i.AsyncIssueIndexingImpl] Indexation task deletion complete.
host = pil0au-sonar-app02.skead.nosource = /u01/sonar/sonar/logs/web.logsourcetype = log4j
2/13/24
7:52:11.000 PM	
2024.02.13 19:52:11 INFO  web[][o.s.s.i.i.AsyncIssueIndexingImpl] 0 completed indexation task found to be deleted...
host = pil0au-sonar-app02.skead.nosource = /u01/sonar/sonar/logs/web.logsourcetype = log4j
2/13/24
7:52:10.000 PM	
2024.02.13 19:52:10 INFO  web[][o.s.s.i.i.AsyncIssueIndexingImpl] 0 pending indexation task found to be deleted...
host = pil0au-sonar-app02.skead.nosource = /u01/sonar/sonar/logs/web.logsourcetype = log4j
2/13/24
7:52:10.000 PM	
2024.02.13 19:52:10 INFO  web[][o.s.s.e.IndexerStartupTask] Trigger asynchronous indexing of type [issues/auth/issue]...
host = pil0au-sonar-app02.skead.nosource = /u01/sonar/sonar/logs/web.logsourcetype = log4j
2/13/24
7:52:10.000 PM	
2024.02.13 19:52:10 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.plugins.PluginsRiskConsentFilter@7eae6fcb [pattern=UrlPattern{inclusions=[/*], exclusions=[*.css, ...]}]
host = pil0au-sonar-app02.skead.nosource = /u01/sonar/sonar/logs/web.logsourcetype = log4j

And after:

2/13/24
7:52:12.000 PM	
2024.02.13 19:52:12 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [OJDBC-WORKER-THREAD-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\n java.base@17.0.9/jdk.internal.misc.Unsafe.park(Native Method)\n java.base@17.0.9/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)\n java.base@17.0.9/java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:401)\n java.base@17.0.9/java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:903)\n java.base@17.0.9/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1061)\n java.base@17.0.9/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1122)\n java.base@17.0.9/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n java.base@17.0.9/java.lang.Thread.run(Thread.java:840)
host = pil0au-sonar-app02.skead.nosource = /u01/sonar/sonar/logs/web.logsourcetype = log4j
2/13/24
7:52:12.000 PM	
2024.02.13 19:52:12 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [InterruptTimer] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\n java.base@17.0.9/java.lang.Object.wait(Native Method)\n java.base@17.0.9/java.util.TimerThread.mainLoop(Timer.java:563)\n java.base@17.0.9/java.util.TimerThread.run(Timer.java:516)
host = pil0au-sonar-app02.skead.nosource = /u01/sonar/sonar/logs/web.logsourcetype = log4j
2/13/24
7:52:12.000 PM	
2024.02.13 19:52:12 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [oracle.jdbc.driver.BlockSource.ThreadedCachingBlockSource.BlockReleaser] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\n java.base@17.0.9/jdk.internal.misc.Unsafe.park(Native Method)\n java.base@17.0.9/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)\n java.base@17.0.9/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1672)\n app//oracle.jdbc.internal.Monitor$WaitableMonitor.monitorWait(Monitor.java:305)\n app//oracle.jdbc.internal.Monitor$WaitableMonitor.monitorWait(Monitor.java:287)\n app//oracle.jdbc.driver.BlockSource$ThreadedCachingBlockSource$BlockReleaser.run(BlockSource.java:346)
host = pil0au-sonar-app02.skead.nosource = /u01/sonar/sonar/logs/web.logsourcetype = log4j
2/13/24
7:52:12.000 PM	
2024.02.13 19:52:12 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [oracle.jdbc.diagnostics.Diagnostic.CLOCK] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\n java.base@17.0.9/java.lang.Object.wait(Native Method)\n java.base@17.0.9/java.util.TimerThread.mainLoop(Timer.java:563)\n java.base@17.0.9/java.util.TimerThread.run(Timer.java:516)
host = pil0au-sonar-app02.skead.nosource = /u01/sonar/sonar/logs/web.logsourcetype = log4j

Hi,

Thanks for the logs. I’ve flagged this for more expert eyes.

 
Ann

No hints or tips for us yet? Is it an option to do a fresh install from scratch of 9.9.3 LTS and start it with the existing database?

Hey @May

Are you installing any third-party plugins?

Yes, sonar-detekt-2.5.0 and sonarqube-community-branch-plugin-1.14.0.

Hi,

We’ve seen other instances where the Community Branch plugin borked peoples’ DBs. Sorry, but we can’t help you on this.

 
Ann

@May I am having the same problem, were you able to fix it?

To RobSHK: Not yet, I can’t touch the production environment at the moment due to operational restrictions. As soon as we are allowed to do changes again, I plan to try another upgrade, but this time I will remove the Community Branch plugin first. If the upgrade then goes smoothly, I will try to enable the plugin again. Strangely, I had no problems with the upgrade of the smaller test environment.

In parallell, my team lead is working on funding to buy a license, since the functionality that we get with the third party plugin will then be included in the commercial version of SonarQube.

@May I’m not sure if this will help, as I just tried uninstalling the branch plugin or any other plugin, but still the app can’t run.
I added a trace to the log and found out that the tables are already indexed by the Branch plugin and therefore the error appears.
We are now trying to change the DB parameter MAX_STRING_SIZE from STANDARD to EXTENDED as described in [ORA-01461 - Database Error Messages (oracle.com)](Oracle Help Center /db/ ora-01461/).
Hope that clears it up.

I solved this by downgrading the JDBC driver. I had upgraded the driver a couple of months earlier to the latest version offered on Oracle’s website. Probably the new version was missing something that the Community plugin required. Replacing the new driver with the old solved all problems. Except being back to the JDBC driver being horribly out of date, of course…