org.postgresql.util.PSQLException

tip

Try downgrading PostgresSQL server to 9.5 or update your PostgresSQL driver to 9.4-1211 with the following command: 9.4.1211

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • If you attempt to add a supervisor order when no workflow exists then this throws an internal error. Exception: org.postgresql.util.PSQLException: ERROR: insert or update on table "epersongroup2workspaceitem" violates foreign key constraint "epersongroup2workspaceitem_workspace_item_id_fkey" Detail: Key (workspace_item_id)=(-1) is not present in table "workspaceitem". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1531) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1313) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:308) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.dspace.storage.rdbms.DatabaseManager.execute(DatabaseManager.java:1429) at org.dspace.storage.rdbms.DatabaseManager.update(DatabaseManager.java:781) at org.dspace.eperson.Supervisor.add(Supervisor.java:191) at org.dspace.app.webui.servlet.admin.SuperviseServlet.addSupervisionOrder(SuperviseServlet.java:242) at org.dspace.app.webui.servlet.admin.SuperviseServlet.doDSPost(SuperviseServlet.java:111) at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:147) at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:105) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.dspace.app.webui.filter.AdminOnlyFilter.doFilter(AdminOnlyFilter.java:103) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.dspace.utils.servlet.DSpaceWebappServletFilter.doFilter(DSpaceWebappServletFilter.java:112) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:429) at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:384) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555) at java.lang.Thread.run(Thread.java:679) Steps to reproduce: 1. Login with admin account. 2. Navigate to the Dspace admin page (<dspaceurl>/dspace-admin/) 3. Click supervisors link. 4. Click "Add a Supervision Order" button 5. Click "Submit Supervision Order" button I managed to reproduce this issue on Dspace 1.6.2 and Dspace3.0 RC 3. I have't tested if this issue occurs on any other versions of Dspace. I have created a fix for this issue. I've attached a patch with the fix.
    via by Jonathan Blood,
  • If you attempt to add a supervisor order when no workflow exists then this throws an internal error. Exception: org.postgresql.util.PSQLException: ERROR: insert or update on table "epersongroup2workspaceitem" violates foreign key constraint "epersongroup2workspaceitem_workspace_item_id_fkey" Detail: Key (workspace_item_id)=(-1) is not present in table "workspaceitem". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1531) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1313) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:308) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.dspace.storage.rdbms.DatabaseManager.execute(DatabaseManager.java:1429) at org.dspace.storage.rdbms.DatabaseManager.update(DatabaseManager.java:781) at org.dspace.eperson.Supervisor.add(Supervisor.java:191) at org.dspace.app.webui.servlet.admin.SuperviseServlet.addSupervisionOrder(SuperviseServlet.java:242) at org.dspace.app.webui.servlet.admin.SuperviseServlet.doDSPost(SuperviseServlet.java:111) at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:147) at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:105) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.dspace.app.webui.filter.AdminOnlyFilter.doFilter(AdminOnlyFilter.java:103) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.dspace.utils.servlet.DSpaceWebappServletFilter.doFilter(DSpaceWebappServletFilter.java:112) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:429) at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:384) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555) at java.lang.Thread.run(Thread.java:679) Steps to reproduce: 1. Login with admin account. 2. Navigate to the Dspace admin page (<dspaceurl>/dspace-admin/) 3. Click supervisors link. 4. Click "Add a Supervision Order" button 5. Click "Submit Supervision Order" button I managed to reproduce this issue on Dspace 1.6.2 and Dspace3.0 RC 3. I have't tested if this issue occurs on any other versions of Dspace. I have created a fix for this issue. I've attached a patch with the fix.
    via by Jonathan Blood,
  • [Dspace-tech] handle-server setup
    via by Lewatle Phaladi,
  • Hello , this is my first post for DSPACE . I am trying to Moving items ( 5000) from diffent collections under diffent communites to under one community and diffent collections ?? what is the best method to do this ? i treid these two SQL scripts but now getting error for reindex update item set owning_collection=NewCollectionID where item_id=ItemID; update collection2item set collection_id=new collection it where collection_id= old collection; once it run these two scripts i can see total number of items by title under new collections but can't see them under new community . i tried to update this table communities2item , then its showing total number of items under community as well as differnt collections but when i am trying to reindexing getting this error message ./dspace index-update Exception: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "communities2item_pkey" org.dspace.browse.BrowseException: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "communities2item_pkey" at org.dspace.browse.BrowseCreateDAOPostgres.updateCommunityMappings(BrowseCreateDAOPostgres.java:661) at org.dspace.browse.IndexBrowse.indexItem(IndexBrowse.java:402) at org.dspace.browse.IndexBrowse.createIndex(IndexBrowse.java:1148) at org.dspace.browse.IndexBrowse.main(IndexBrowse.java:703) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:212) Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "communities2item_pkey" at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1531) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1313) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:308) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.dspace.storage.rdbms.DatabaseManager.execute(DatabaseManager.java:1429) at org.dspace.storage.rdbms.DatabaseManager.insert(DatabaseManager.java:736) at org.dspace.storage.rdbms.DatabaseManager.create(DatabaseManager.java:490) at org.dspace.browse.BrowseCreateDAOPostgres.updateCommunityMappings(BrowseCreateDAOPostgres.java:651) ... 8 more Please help me to solve this issue ? Kind Regards and manythanks Hafeez Qazi
    via by Hafeez Qazi,
  • Hello , this is my first post for DSPACE . I am trying to Moving items ( 5000) from diffent collections under diffent communites to under one community and diffent collections ?? what is the best method to do this ? i treid these two SQL scripts but now getting error for reindex update item set owning_collection=NewCollectionID where item_id=ItemID; update collection2item set collection_id=new collection it where collection_id= old collection; once it run these two scripts i can see total number of items by title under new collections but can't see them under new community . i tried to update this table communities2item , then its showing total number of items under community as well as differnt collections but when i am trying to reindexing getting this error message ./dspace index-update Exception: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "communities2item_pkey" org.dspace.browse.BrowseException: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "communities2item_pkey" at org.dspace.browse.BrowseCreateDAOPostgres.updateCommunityMappings(BrowseCreateDAOPostgres.java:661) at org.dspace.browse.IndexBrowse.indexItem(IndexBrowse.java:402) at org.dspace.browse.IndexBrowse.createIndex(IndexBrowse.java:1148) at org.dspace.browse.IndexBrowse.main(IndexBrowse.java:703) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:212) Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "communities2item_pkey" at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1531) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1313) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:308) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.dspace.storage.rdbms.DatabaseManager.execute(DatabaseManager.java:1429) at org.dspace.storage.rdbms.DatabaseManager.insert(DatabaseManager.java:736) at org.dspace.storage.rdbms.DatabaseManager.create(DatabaseManager.java:490) at org.dspace.browse.BrowseCreateDAOPostgres.updateCommunityMappings(BrowseCreateDAOPostgres.java:651) ... 8 more Please help me to solve this issue ? Kind Regards and manythanks Hafeez Qazi
    via by Hafeez Qazi,
    • org.postgresql.util.PSQLException: ERROR: insert or update on table "epersongroup2workspaceitem" violates foreign key constraint "epersongroup2workspaceitem_workspace_item_id_fkey" Detail: Key (workspace_item_id)=(-1) is not present in table "workspaceitem". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1531) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1313) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:308) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.dspace.storage.rdbms.DatabaseManager.execute(DatabaseManager.java:1429) at org.dspace.storage.rdbms.DatabaseManager.update(DatabaseManager.java:781) at org.dspace.eperson.Supervisor.add(Supervisor.java:191) at org.dspace.app.webui.servlet.admin.SuperviseServlet.addSupervisionOrder(SuperviseServlet.java:242) at org.dspace.app.webui.servlet.admin.SuperviseServlet.doDSPost(SuperviseServlet.java:111) at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:147) at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:105) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.dspace.app.webui.filter.AdminOnlyFilter.doFilter(AdminOnlyFilter.java:103) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.dspace.utils.servlet.DSpaceWebappServletFilter.doFilter(DSpaceWebappServletFilter.java:112) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:429) at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:384) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555) at java.lang.Thread.run(Thread.java:679)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    jokester
    2 times, last one,
    silex
    5 times, last one,
    Unknown visitor1 times, last one,
    92 more bugmates