Crowd Crashes Due to 'PSQLException: ERROR: prepared statement "S_1" does not exist'

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

Crowd crashes or can't be started due to the following error:

PSQLException: ERROR: prepared statement "S_1" does not exist

Cause

PgBouncer is used in transaction mode by default for all PostgreSQL connections, which breaks JDBC's default PREPARED STATEMENT handling.

Resolution

The ?prepareThreshold=0 argument must be used on Crowd string connection configured in the crowd.cfg.xml file located under <crowd-home>/crowd.cfg.xml. Example:

<property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/dbname?prepareThreshold=0</property>

This will show on the starting Crowd logs:

jdbcUrl -> jdbc:postgresql://localhost:5432/dbname?prepareThreshold=0, properties -> {user=******, password=******} ], 

 

If the issue persists after setting the parameter, you'll need to update the PostgreSQL JDBC4 driver used to 9.3 or newer due to this PgSQL bug: http://pgbouncer.projects.pgfoundry.org/doc/faq.html#_disabling_prepared_statements_in_jdbc

Move the driver to <crowd-install>/apache-tomcat/lib and make sure to remove older JDBC driver from that directory before restarting your Crowd instance.

 

(info) This procedure should work with other Atlassian tools that present this issue too.

Last modified on Mar 30, 2016

Was this helpful?

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