org.postgresql.util.PSQLException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • We are working on an experiment where the first user / evaluator creates two spaces and a bunch of content using the Confluence rest api. In a few pages we have tasks with the user @mentioned. These seem to quite often cause our create page to fail with a transaction rollback, and thus causing our experiment to fail. Here's a few log snippets and analysis: {quote}@4000000054feead01f05278c 2015-03-10 12:59:50,492 ERROR [TP-Processor3] [atlassian.event.internal.AsynchronousAbleEventDispatcher] run There was an exception thrown trying to dispatch event [ConfluenceTaskCreateEvent{user=com.atlassian.confluence.user.ConfluenceUserImpl@203f4f[vcosta46,ff8080814c03b7ff014c03b80f960001], task=Task [globalId=0, id=1, contentId=491540, taskStatus=UNCHECKED, title=Vitor Costa [Administrator] https://carglasspt.atlassian.net/wiki/display/~vcosta46 to look into Confluence Questions, description=, body=<ac:link><ri:user ri:userkey="ff8080814c03b7ff014c03b80f960001" /></ac:link> to look into Confluence Questions, creator=vcosta46, assignee=vcosta46, createDate=Tue Mar 10 12:59:49 GMT 2015, dueDate=null, updateDate=null, completeUser=null, completeDate=null]}] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.mywork.providers.confluence.ConfluenceTasksEventListener.onTaskCreatedEvent(com.atlassian.confluence.plugins.tasklist.event.ConfluenceTaskCreateEvent) throws java.lang.Exception, listener=com.atlassian.mywork.providers.confluence.ConfluenceTasksEventListener@82bae0}] @4000000054feead01f056ddc -- referer: https://carglasspt.atlassian.net/wiki/dashboard.action | url: /wiki/rest/api/content | userName: vcosta46 @4000000054feead01f0571c4 java.lang.RuntimeException: java.lang.reflect.UndeclaredThrowableException @4000000054feead01f0571c4 at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:50) @4000000054feead01f0575ac at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48) @4000000054feead01f057994 at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253) @4000000054feead01f057d7c at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:107) ... @4000000054feead01f0a53c4 at com.sun.proxy.$Proxy2590.createOrUpdate(Unknown Source) *@4000000054feead01f0a53c4 at com.atlassian.mywork.providers.confluence.ConfluenceTasksEventListener.onTaskCreatedEvent(ConfluenceTasksEventListener.java:65)* @4000000054feead01f0a5b94 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ... @4000000054feead01f0c14fc Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "u_ao_9412a1_aouser_username" @4000000054feead01f0c18e4 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2077) @4000000054feead01f0c18e4 at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1810) @4000000054feead01f0c20b4 at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) @4000000054feead01f0c20b4 at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:498) @4 {quote} that causes transaction to rollback {quote}@4000000054feead022dac484 2015-03-10 12:59:50,575 ERROR [TP-Processor3] [rest.api.model.ExceptionConverter] convertServiceException No status code found for exception, converting to internal server error : @4000000054feead022dacc54 -- referer: https://carglasspt.atlassian.net/wiki/dashboard.action | url: /wiki/rest/api/content | userName: vcosta46 @4000000054feead022dad03c org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only @4000000054feead022dad03c at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:695) @4000000054feead022dae7ac at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source) @4000000054feead022daeb94 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) @4{quote} From {code:java} com.atlassian.mywork.host.dao.ao.AOUserDao.getAO(AOUserDao.java:40) {code} it looks like the issue is that find AOUser below returns null: {code:java} private AOUser getAO(UserKey userKey) { AOUser user = findOnly(select().where("USERNAME = ?", userKey.getStringValue())); if (user == null) { user = ao.create(AOUser.class, new DBParam("USERNAME", userKey.getStringValue())); user.setCreated(new Date()); user.setUpdated(user.getCreated()); } else { user.setUpdated(new Date()); } return user; } {code} So concurrency / transaction stuff.
    via by Sami Jaatinen [Atlassian],
  • We are working on an experiment where the first user / evaluator creates two spaces and a bunch of content using the Confluence rest api. In a few pages we have tasks with the user @mentioned. These seem to quite often cause our create page to fail with a transaction rollback, and thus causing our experiment to fail. Here's a few log snippets and analysis: {quote}@4000000054feead01f05278c 2015-03-10 12:59:50,492 ERROR [TP-Processor3] [atlassian.event.internal.AsynchronousAbleEventDispatcher] run There was an exception thrown trying to dispatch event [ConfluenceTaskCreateEvent{user=com.atlassian.confluence.user.ConfluenceUserImpl@203f4f[vcosta46,ff8080814c03b7ff014c03b80f960001], task=Task [globalId=0, id=1, contentId=491540, taskStatus=UNCHECKED, title=Vitor Costa [Administrator] https://carglasspt.atlassian.net/wiki/display/~vcosta46 to look into Confluence Questions, description=, body=<ac:link><ri:user ri:userkey="ff8080814c03b7ff014c03b80f960001" /></ac:link> to look into Confluence Questions, creator=vcosta46, assignee=vcosta46, createDate=Tue Mar 10 12:59:49 GMT 2015, dueDate=null, updateDate=null, completeUser=null, completeDate=null]}] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.mywork.providers.confluence.ConfluenceTasksEventListener.onTaskCreatedEvent(com.atlassian.confluence.plugins.tasklist.event.ConfluenceTaskCreateEvent) throws java.lang.Exception, listener=com.atlassian.mywork.providers.confluence.ConfluenceTasksEventListener@82bae0}] @4000000054feead01f056ddc -- referer: https://carglasspt.atlassian.net/wiki/dashboard.action | url: /wiki/rest/api/content | userName: vcosta46 @4000000054feead01f0571c4 java.lang.RuntimeException: java.lang.reflect.UndeclaredThrowableException @4000000054feead01f0571c4 at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:50) @4000000054feead01f0575ac at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48) @4000000054feead01f057994 at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253) @4000000054feead01f057d7c at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:107) ... @4000000054feead01f0a53c4 at com.sun.proxy.$Proxy2590.createOrUpdate(Unknown Source) *@4000000054feead01f0a53c4 at com.atlassian.mywork.providers.confluence.ConfluenceTasksEventListener.onTaskCreatedEvent(ConfluenceTasksEventListener.java:65)* @4000000054feead01f0a5b94 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ... @4000000054feead01f0c14fc Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "u_ao_9412a1_aouser_username" @4000000054feead01f0c18e4 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2077) @4000000054feead01f0c18e4 at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1810) @4000000054feead01f0c20b4 at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) @4000000054feead01f0c20b4 at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:498) @4 {quote} that causes transaction to rollback {quote}@4000000054feead022dac484 2015-03-10 12:59:50,575 ERROR [TP-Processor3] [rest.api.model.ExceptionConverter] convertServiceException No status code found for exception, converting to internal server error : @4000000054feead022dacc54 -- referer: https://carglasspt.atlassian.net/wiki/dashboard.action | url: /wiki/rest/api/content | userName: vcosta46 @4000000054feead022dad03c org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only @4000000054feead022dad03c at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:695) @4000000054feead022dae7ac at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source) @4000000054feead022daeb94 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) @4{quote} From {code:java} com.atlassian.mywork.host.dao.ao.AOUserDao.getAO(AOUserDao.java:40) {code} it looks like the issue is that find AOUser below returns null: {code:java} private AOUser getAO(UserKey userKey) { AOUser user = findOnly(select().where("USERNAME = ?", userKey.getStringValue())); if (user == null) { user = ao.create(AOUser.class, new DBParam("USERNAME", userKey.getStringValue())); user.setCreated(new Date()); user.setUpdated(user.getCreated()); } else { user.setUpdated(new Date()); } return user; } {code} So concurrency / transaction stuff.
    via by Sami Jaatinen [Atlassian],
  • Problem with PostgreSQL driver
    via by Jacobus,
  • site search job audit broken
    via GitHub by wezell
    ,
    • org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "u_ao_9412a1_aouser_username" @4000000054feead01f0c18e4 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2077) @4000000054feead01f0c18e4 at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1810) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:498)

    Users with the same issue

    Unknown User
    9 times, last one,
    Unknown visitor1 times, last one,
    silex
    6 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    12 more bugmates