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)

Atlassian JIRA | Sami Jaatinen [Atlassian] | 2 years ago
  1. 0

    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.

    Atlassian JIRA | 2 years ago | Sami Jaatinen [Atlassian]
    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)
  2. 0

    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.

    Atlassian JIRA | 2 years ago | Sami Jaatinen [Atlassian]
    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)
  3. 0

    Heroku App (play) working fine locally, then not saving to database on server

    Stack Overflow | 5 years ago | William
    org.postgresql.util.PSQLException: ERROR: relation "user_seq" does not exist
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Problem with PostgreSQL driver

    Google Groups | 4 years ago | Jacobus
    org.postgresql.util.PSQLException: ERROR: type "double" does not exist Position: 104
  6. 0

    Scala's Slick with multiple PK insertOrUpdate() throws exception ERROR: syntax error at end of input

    Stack Overflow | 2 years ago | Konstantin Trunin
    org.postgresql.util.PSQLException: ERROR: syntax error at end of input Position: 76

  1. silex 16 times, last 4 weeks ago
  2. silex 1 times, last 5 months ago
10 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

    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()
  2. PostgreSQL JDBC Driver
    AbstractJdbc2Statement.execute
    1. org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
    2. org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:498)
    2 frames