org.postgresql.util.PSQLException: ERROR: update or delete on table "label" violates foreign key constraint "fk594acc827072aef" on table "notifications" Detail: Key (labelid)=(2031993) is still referenced from table "notifications".

Atlassian JIRA | Matthew Erickson [Atlassian] | 2 years ago
  1. 0

    {quote} org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not delete: [com.atlassian.confluence.labels.Label#2031993]; SQL []; ERROR: update or delete on table "label" violates foreign key constraint "fk594acc827072aef" on table "notifications" Detail: Key (labelid)=(2031993) is still referenced from table "notifications".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "label" violates foreign key constraint "fk594acc827072aef" on table "notifications" Detail: Key (labelid)=(2031993) is still referenced from table "notifications". at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:100) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.orm.hibernate.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:364) at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:351) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337) at com.atlassian.confluence.labels.persistence.dao.hibernate.HibernateLabelDao.findByLabel(HibernateLabelDao.java:117) at com.atlassian.confluence.labels.DefaultLabelManager.getLabel(DefaultLabelManager.java:623) at com.atlassian.confluence.labels.DefaultLabelManager.deleteLabel(DefaultLabelManager.java:561) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) ... {quote}

    Atlassian JIRA | 2 years ago | Matthew Erickson [Atlassian]
    org.postgresql.util.PSQLException: ERROR: update or delete on table "label" violates foreign key constraint "fk594acc827072aef" on table "notifications" Detail: Key (labelid)=(2031993) is still referenced from table "notifications".
  2. 0

    {quote} org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not delete: [com.atlassian.confluence.labels.Label#2031993]; SQL []; ERROR: update or delete on table "label" violates foreign key constraint "fk594acc827072aef" on table "notifications" Detail: Key (labelid)=(2031993) is still referenced from table "notifications".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "label" violates foreign key constraint "fk594acc827072aef" on table "notifications" Detail: Key (labelid)=(2031993) is still referenced from table "notifications". at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:100) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.orm.hibernate.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:364) at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:351) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337) at com.atlassian.confluence.labels.persistence.dao.hibernate.HibernateLabelDao.findByLabel(HibernateLabelDao.java:117) at com.atlassian.confluence.labels.DefaultLabelManager.getLabel(DefaultLabelManager.java:623) at com.atlassian.confluence.labels.DefaultLabelManager.deleteLabel(DefaultLabelManager.java:561) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) ... {quote}

    Atlassian JIRA | 2 years ago | Matthew Erickson [Atlassian]
    org.postgresql.util.PSQLException: ERROR: update or delete on table "label" violates foreign key constraint "fk594acc827072aef" on table "notifications" Detail: Key (labelid)=(2031993) is still referenced from table "notifications".
  3. 0

    When *attachmentVersion* is set to *replace*, it errors out if used in conjunction with the TOC macro. Error Produced: {code} org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not delete: [com.atlassian.confluence.pages.Attachment#46497891]; SQL []; ERROR: update or delete on table "attachments" violates foreign key constraint "fka768048734a4917e" on table "imagedetails" Detail: Key (attachmentid)=(46497891) is still referenced from table "imagedetails".; nested exception is org.postgresql.util.PSQLException: ERROR: update or delete on table "attachments" violates foreign key constraint "fka768048734a4917e" on table "imagedetails" Detail: Key (attachmentid)=(46497891) is still referenced from table "imagedetails". at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:100) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.orm.hibernate.HibernateTransactionManager.convertJdbcAccessException(HibernateTransactionManager.java:619) at org.springframework.orm.hibernate.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:605) at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:518) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732) ... Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "attachments" violates foreign key constraint "fka768048734a4917e" on table "imagedetails" Detail: Key (attachmentid)=(46497891) is still referenced from table "imagedetails". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:334) at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22) at net.sf.hibernate.persister.EntityPersister.delete(EntityPersister.java:581) at net.sf.hibernate.impl.ScheduledDeletion.execute(ScheduledDeletion.java:29) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2464) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2450) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2412) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2276) at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61) at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:510) ... 298 more {code} h2. Reproduction # Create a new page # Add a table of contents macro # Add a chart macro # Edit the properties of the Chart macro and: ## Add an attachment name ## Set Attachment Version to Replace # Save the page #- Note that the page will not display (Error 330 (net::ERR_CONTENT_DECODING_FAILED): Unknown error) and the above error will appear in the logs. Alternatively use this XML to create a page to create the error: {code} <p> <ac:macro ac:name="toc"/> </p> <p> </p> <ac:macro ac:name="chart"> <ac:parameter ac:name="attachmentVersion">replace</ac:parameter> <ac:parameter ac:name="title">Test</ac:parameter> <ac:parameter ac:name="height">600</ac:parameter> <ac:parameter ac:name="width">1200</ac:parameter> <ac:parameter ac:name="datadisplay">after</ac:parameter> <ac:parameter ac:name="attachment">new.png</ac:parameter> <ac:parameter ac:name="categoryLabelPosition">up45</ac:parameter> <ac:rich-text-body> <table> <tbody> <tr> <th> </th> <th>A</th> <th>B</th> </tr> <tr> <td>TEST</td> <td>1</td> <td>2</td> </tr> </tbody> </table> </ac:rich-text-body> </ac:macro> {code}

    Atlassian JIRA | 4 years ago | David Yu
    org.postgresql.util.PSQLException: ERROR: update or delete on table "attachments" violates foreign key constraint "fka768048734a4917e" on table "imagedetails" Detail: Key (attachmentid)=(46497891) is still referenced from table "imagedetails".
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    GitHub comment 1#176573154

    GitHub | 10 months ago | carast
    org.postgresql.util.PSQLException: ERROR: Error en spd_falla ::: No se puede borrar el registro, aun exite una referencia al registro favor de verificar

    1 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: update or delete on table "label" violates foreign key constraint "fk594acc827072aef" on table "notifications" Detail: Key (labelid)=(2031993) is still referenced from table "notifications".

      at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate()
    2. Spring Framework
      AbstractFallbackSQLExceptionTranslator.translate
      1. org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:100)
      2. org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
      2 frames
    3. Hibernate
      HibernateTemplate.execute
      1. org.springframework.orm.hibernate.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:364)
      2. org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:351)
      3. org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375)
      4. org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337)
      4 frames
    4. com.atlassian.confluence
      DefaultLabelManager.deleteLabel
      1. com.atlassian.confluence.labels.persistence.dao.hibernate.HibernateLabelDao.findByLabel(HibernateLabelDao.java:117)
      2. com.atlassian.confluence.labels.DefaultLabelManager.getLabel(DefaultLabelManager.java:623)
      3. com.atlassian.confluence.labels.DefaultLabelManager.deleteLabel(DefaultLabelManager.java:561)
      3 frames
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:606)
      4 frames