org.postgresql.util.PSQLException: ResultSet not positioned properly, perhaps you need to call next.

Atlassian JIRA | David Currie [Atlassian] | 1 year ago
  1. 0

    h3. Summary On startup, JIRA attempts to perform a collation check. In certain scenarios this check will fail as the database name is incorrectly parsed from the JDBC URL. It can present with different errors depending upon the DBMS used. h3. Environment Reproduced with PostgreSQL 9.1 using the below JDBC URL: {code} jdbc:postgresql://localhost:5432/jira700?ssl=true {code} The below JDBC URL was reported as problematic however not reproduced: {code} jdbc:jtds:sqlserver://example.com:1433;databaseName=Jira {code} h3. Steps to Reproduce # Setup PostgreSQL to serve with SSL. #* Generate certificates. #* Edit {{postgresql.conf}} to use SSL, and optionally set the certificate location or put them in the {{<pg_install>/data}} directory. #* Restart PostgreSQL. #* Add {{?ssl=true}} to the JDBC url. # Start JIRA. h3. Expected Results It is able to correctly read the collation. h3. Actual Results The error below will appear: {noformat} **************************************************************************************************** The database collation could not be read. An unsupported collation could cause some functionality to not work **************************************************************************************************** {noformat} And will have a corresponding exception depending upon the DBMS used. JIRA will still start up. {noformat:title=PostgreSQL} 2015-10-21 22:06:10,507 localhost-startStop-1 INFO [c.a.j.appconsistency.db.CollationCheck] Exception when reading database collation org.postgresql.util.PSQLException: ResultSet not positioned properly, perhaps you need to call next. at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkResultSet(AbstractJdbc2ResultSet.java:2695) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1872) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213) at com.atlassian.jira.database.DatabaseCollationReader.findCollation(DatabaseCollationReader.java:46) at com.atlassian.jira.appconsistency.db.CollationCheck.isOk(CollationCheck.java:60) at com.atlassian.jira.startup.JiraDatabaseConfigChecklist.doStartupChecks(JiraDatabaseConfigChecklist.java:72) at com.atlassian.jira.startup.JiraDatabaseConfigChecklist.startupOK(JiraDatabaseConfigChecklist.java:60) at com.atlassian.jira.startup.DatabaseChecklistLauncher.start(DatabaseChecklistLauncher.java:46) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDbLaunch$174(DefaultJiraLauncher.java:123) at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$9/1032956955.run(Unknown Source) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:356) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseConfigured(DatabaseConfigurationManagerImpl.java:232) at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:122) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$173(DefaultJiraLauncher.java:92) at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$1/853477245.run(Unknown Source) at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:34) at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:90) at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:84) ... 5 filtered at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {noformat} Or: {noformat:title=MS SQL Server} 2015-10-23 13:36:17,610 localhost-startStop-1 INFO [jira.appconsistency.db.CollationCheck] Exception when reading database collation java.sql.SQLException: No current row in the ResultSet. at net.sourceforge.jtds.jdbc.JtdsResultSet.getColumn(JtdsResultSet.java:285) at net.sourceforge.jtds.jdbc.JtdsResultSet.getString(JtdsResultSet.java:952) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213) at com.atlassian.jira.database.DatabaseCollationReader.findCollation(DatabaseCollationReader.java:46) at com.atlassian.jira.appconsistency.db.CollationCheck.isOk(CollationCheck.java:60) at com.atlassian.jira.startup.JiraDatabaseConfigChecklist.doStartupChecks(JiraDatabaseConfigChecklist.java:72) at com.atlassian.jira.startup.JiraDatabaseConfigChecklist.startupOK(JiraDatabaseConfigChecklist.java:60) at com.atlassian.jira.startup.DatabaseChecklistLauncher.start(DatabaseChecklistLauncher.java:44) at com.atlassian.jira.startup.DefaultJiraLauncher$2.run(DefaultJiraLauncher.java:120) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:345) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseConfigured(DatabaseConfigurationManagerImpl.java:221) at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:115) at com.atlassian.jira.startup.DefaultJiraLauncher.access$100(DefaultJiraLauncher.java:33) at com.atlassian.jira.startup.DefaultJiraLauncher$1.run(DefaultJiraLauncher.java:86) at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:34) at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:81) at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:72) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5003) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1912) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {noformat} h3. Notes This exception will not prevent JIRA from starting up, and only occurs if the JDBC URL has additional data appended after it.

    Atlassian JIRA | 1 year ago | David Currie [Atlassian]
    org.postgresql.util.PSQLException: ResultSet not positioned properly, perhaps you need to call next.
  2. 0

    h3. Summary On startup, JIRA attempts to perform a collation check. In certain scenarios this check will fail as the database name is incorrectly parsed from the JDBC URL. It can present with different errors depending upon the DBMS used. h3. Environment Reproduced with PostgreSQL 9.1 using the below JDBC URL: {code} jdbc:postgresql://localhost:5432/jira700?ssl=true {code} The below JDBC URL was reported as problematic however not reproduced: {code} jdbc:jtds:sqlserver://example.com:1433;databaseName=Jira {code} h3. Steps to Reproduce # Setup PostgreSQL to serve with SSL. #* Generate certificates. #* Edit {{postgresql.conf}} to use SSL, and optionally set the certificate location or put them in the {{<pg_install>/data}} directory. #* Restart PostgreSQL. #* Add {{?ssl=true}} to the JDBC url. # Start JIRA. h3. Expected Results It is able to correctly read the collation. h3. Actual Results The error below will appear: {noformat} **************************************************************************************************** The database collation could not be read. An unsupported collation could cause some functionality to not work **************************************************************************************************** {noformat} And will have a corresponding exception depending upon the DBMS used. JIRA will still start up. {noformat:title=PostgreSQL} 2015-10-21 22:06:10,507 localhost-startStop-1 INFO [c.a.j.appconsistency.db.CollationCheck] Exception when reading database collation org.postgresql.util.PSQLException: ResultSet not positioned properly, perhaps you need to call next. at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkResultSet(AbstractJdbc2ResultSet.java:2695) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1872) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213) at com.atlassian.jira.database.DatabaseCollationReader.findCollation(DatabaseCollationReader.java:46) at com.atlassian.jira.appconsistency.db.CollationCheck.isOk(CollationCheck.java:60) at com.atlassian.jira.startup.JiraDatabaseConfigChecklist.doStartupChecks(JiraDatabaseConfigChecklist.java:72) at com.atlassian.jira.startup.JiraDatabaseConfigChecklist.startupOK(JiraDatabaseConfigChecklist.java:60) at com.atlassian.jira.startup.DatabaseChecklistLauncher.start(DatabaseChecklistLauncher.java:46) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDbLaunch$174(DefaultJiraLauncher.java:123) at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$9/1032956955.run(Unknown Source) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:356) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseConfigured(DatabaseConfigurationManagerImpl.java:232) at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:122) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$173(DefaultJiraLauncher.java:92) at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$1/853477245.run(Unknown Source) at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:34) at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:90) at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:84) ... 5 filtered at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {noformat} Or: {noformat:title=MS SQL Server} 2015-10-23 13:36:17,610 localhost-startStop-1 INFO [jira.appconsistency.db.CollationCheck] Exception when reading database collation java.sql.SQLException: No current row in the ResultSet. at net.sourceforge.jtds.jdbc.JtdsResultSet.getColumn(JtdsResultSet.java:285) at net.sourceforge.jtds.jdbc.JtdsResultSet.getString(JtdsResultSet.java:952) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213) at com.atlassian.jira.database.DatabaseCollationReader.findCollation(DatabaseCollationReader.java:46) at com.atlassian.jira.appconsistency.db.CollationCheck.isOk(CollationCheck.java:60) at com.atlassian.jira.startup.JiraDatabaseConfigChecklist.doStartupChecks(JiraDatabaseConfigChecklist.java:72) at com.atlassian.jira.startup.JiraDatabaseConfigChecklist.startupOK(JiraDatabaseConfigChecklist.java:60) at com.atlassian.jira.startup.DatabaseChecklistLauncher.start(DatabaseChecklistLauncher.java:44) at com.atlassian.jira.startup.DefaultJiraLauncher$2.run(DefaultJiraLauncher.java:120) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:345) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseConfigured(DatabaseConfigurationManagerImpl.java:221) at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:115) at com.atlassian.jira.startup.DefaultJiraLauncher.access$100(DefaultJiraLauncher.java:33) at com.atlassian.jira.startup.DefaultJiraLauncher$1.run(DefaultJiraLauncher.java:86) at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:34) at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:81) at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:72) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5003) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1912) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {noformat} h3. Notes This exception will not prevent JIRA from starting up, and only occurs if the JDBC URL has additional data appended after it.

    Atlassian JIRA | 1 year ago | David Currie [Atlassian]
    org.postgresql.util.PSQLException: ResultSet not positioned properly, perhaps you need to call next.
  3. 0

    PgSQL Exception: column name not found

    Stack Overflow | 7 years ago
    org.postgresql.util.PSQLException: The column name sender_id was not found in this ResultSet.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Announcing the release of XNAT 1.6.2.1!

    Google Groups | 3 years ago | Rick Herrick
    org.postgresql.util.PSQLException: The column index is out of range: 19, number of columns: 18.
  6. 0

    Exception always thrown in method called from JSP page

    Stack Overflow | 4 years ago | Josh
    org.postgresql.util.PSQLException: ResultSet not positioned properly, perhaps you need to call next.

  1. RoiOtero 3 times, last 7 months ago
3 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.postgresql.util.PSQLException

    ResultSet not positioned properly, perhaps you need to call next.

    at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkResultSet()
  2. PostgreSQL JDBC Driver
    AbstractJdbc2ResultSet.getString
    1. org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkResultSet(AbstractJdbc2ResultSet.java:2695)
    2. org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1872)
    2 frames
  3. Commons DBCP
    DelegatingResultSet.getString
    1. org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213)
    2. org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:213)
    2 frames
  4. com.atlassian.jira
    DefaultJiraLauncher.lambda$postDbLaunch$174
    1. com.atlassian.jira.database.DatabaseCollationReader.findCollation(DatabaseCollationReader.java:46)
    2. com.atlassian.jira.appconsistency.db.CollationCheck.isOk(CollationCheck.java:60)
    3. com.atlassian.jira.startup.JiraDatabaseConfigChecklist.doStartupChecks(JiraDatabaseConfigChecklist.java:72)
    4. com.atlassian.jira.startup.JiraDatabaseConfigChecklist.startupOK(JiraDatabaseConfigChecklist.java:60)
    5. com.atlassian.jira.startup.DatabaseChecklistLauncher.start(DatabaseChecklistLauncher.java:46)
    6. com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDbLaunch$174(DefaultJiraLauncher.java:123)
    6 frames