Jira Batch notifications are not working when using an Oracle database

Still need help?

The Atlassian Community is here for you.

Ask the community

This article only applies to Atlassian's server products. Learn more about the differences between cloud and server.

Problem

After upgrading or installing Jira 8.+, and turning on Batch Notifications, notifications are never sent at all. Test notifications still work.

The following exception appears in atlassian-jira.log thrown by the JIRA-INFORM-Thread which is used by the Batch Notifications plugin.

2020-01-09 09:54:45,901+0100 JIRA-INFORM-Thread-1 WARN anonymous 455x660x1 1iwbmex x.x.x.x /secure/QuickCreateIssue.jspa [o.a.commons.dbcp2.BasicDataSource] An internal object pool swallowed an Exception.
java.sql.SQLException: Protocol violation: [ 0, ]
	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:669)
	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:249)
	at oracle.jdbc.driver.T4C7Ocommoncall.doOROLLBACK(T4C7Ocommoncall.java:66)
	at oracle.jdbc.driver.T4CConnection.doRollback(T4CConnection.java:906)
	at oracle.jdbc.driver.PhysicalConnection.rollback(

You may also have the following in atlassian-jira-outgoing-mail.log:

2021-11-02 16:18:40,307-0400 ERROR [] JIRA-INFORM-Thread-0 anonymous 455x660x1 1iwbmex x.x.x.x /secure/QuickCreateIssue.jspa [c.a.m.o.c.a.j.p.inform.performance.MeasurementWorkerFactory] Exception occured
com.querydsl.core.QueryException: Caught SQLException for insert into "AO_733371_EVENT_PARAMETER" ("NAME", "VALUE", "EVENT_ID") values (?, ?, ?)
[...]
Caused by: java.sql.SQLException: operation not allowed: DML Returning cannot be batched

You may also have the following error in atlassian-jira.log:

2022-12-12 10:54:01,007+0100 ERROR [] JIRA-INFORM-Thread-0 anonymous 653x33593x1 z6gr4a XXX.XX.XX.XXX /secure/WorkflowUIDispatcher.jspa [c.a.m.o.c.a.j.p.inform.performance.MeasurementWorkerFactory] Exception occured
java.lang.NullPointerException
	at oracle.jdbc.driver.OraclePreparedStatement.registerReturnParamsForAutoKey(OraclePreparedStatement.java:11906) [ojdbc11.jar:21.6.0.0.0]
	at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:2023) [ojdbc11.jar:21.6.0.0.0]
	at oracle.jdbc.driver.OraclePreparedStatement.addBatch(OraclePreparedStatement.java:10057) [ojdbc11.jar:21.6.0.0.0]
	at oracle.jdbc.driver.OraclePreparedStatementWrapper.addBatch(OraclePreparedStatementWrapper.java:1001) [ojdbc11.jar:21.6.0.0.0]
	at org.apache.commons.dbcp2.DelegatingPreparedStatement.addBatch(DelegatingPreparedStatement.java:207) [commons-dbcp2-2.1.jar:2.1]
	at org.apache.commons.dbcp2.DelegatingPreparedStatement.addBatch(DelegatingPreparedStatement.java:207) [commons-dbcp2-2.1.jar:2.1]
	at com.atlassian.jira.ofbiz.sql.PreparedStatementWrapper.addBatch(PreparedStatementWrapper.java:158) [classes/:?]

...

	at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source) [?:?]
	at com.atlassian.jira.plugins.inform.events.listener.JiraEventListenerImpl.lambda$handleIssueEventBundle$5(JiraEventListenerImpl.java:63) [?:?]
	at com.atlassian.jira.plugins.inform.performance.MeasurementWorkerFactory$1.measure(MeasurementWorkerFactory.java:41) [?:?]
	at com.atlassian.jira.plugins.inform.events.listener.JiraEventListenerImpl.handleIssueEventBundle(JiraEventListenerImpl.java:52) [?:?]
	at com.atlassian.jira.plugins.inform.events.listener.AsyncJiraEventListener.lambda$handleIssueEventBundle$0(AsyncJiraEventListener.java:27) [?:?]
	at com.atlassian.jira.plugins.inform.events.listener.EventThreadPool.lambda$wrapThreadLocalSafe$0(EventThreadPool.java:48) [?:?]
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
	at java.base/java.lang.Thread.run(Unknown Source) [?:?]


Diagnosis

Using Jira 8.+ and Oracle database.

Checking from the database, the batch notification event table AO_733371_EVENT does not return any row. Which means the batch notification events are never generated.

SQL> select * from AO_733371_EVENT;

no rows selected

Cause

SQLException: Protocol violation itself is normally caused by the Oracle driver. Therefore, first please ensure that you've used the correct Database JDBC Driver in your Jira instance.
As stated on our Supported platforms we require Oracle JDBC 19.3 driver to be used with Oracle database.

Resolution

  1. Download the correct Oracle driver JDBC 19.3 (ojdbc8.jar)
  2. Update your JDBC driver by copying the driver JAR file to the $JIRA_INSTALL/lib folder in your Jira installation. Make sure the old driver is moved out of this folder and also that there's no other ojdbc8.jar file under $JIRA_INSTALL/atlassian-jira/WEB-INF/lib.
  3. Restart Jira.
Last modified on Dec 12, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.