Duplicate key after restoring server from AIP backup

191 views
Skip to first unread message

Sean Carte

unread,
Jul 14, 2022, 2:02:22 AM7/14/22
to DSpace Technical Support
I restored an entire site from an AIP backup, and now, when I attempt to submit an item, I get this error:

Caused by: java.sql.BatchUpdateException: Batch entry 0 update public.handle set resource_id='26a7cedb-76e7-4acc-a515-37708a3e1c7b'::uuid, handle='123456789/9', resource_type_id=2 where handle_id=264 was aborted: ERROR: duplicate key value violates unique constraint "handle_handle_key"
  Detail: Key (handle)=(123456789/9) already exists.  Call getNextException to see other errors in the batch.

I think this is because I haven't run the update-sequences.sql that the documentation suggests I should, but I can't find that script; there isn't even a /dspace/etc/ directory:

ls /dspace/
assetstore  exports        log       solr         upload
bin         handle-server  reports   temp         var
config      lib            sitemaps  triplestore  webapps

This is the documentation I've been using:


DSpace version:  7.3-SNAPSHOT
  SCM revision:  e5f316c9adf78e59d8277a271a0fc2a2d21da0f8
    SCM branch:  main
            OS:  Linux(amd64) version 5.4.0-120-generic
  Applications:
     Discovery:  enabled.
           JRE:  Private Build version 11.0.15
   Ant version:  Apache Ant(TM) version 1.10.7 compiled on October 24 2019
 Maven version:  3.6.3
   DSpace home:  /dspace

Sean

Michael Plate

unread,
Jul 14, 2022, 6:48:05 AM7/14/22
to dspac...@googlegroups.com
Hi Sean,

at least this you might correct this by setting the handle_seq to a
value greater than the last handle.
I don't recommend that for important systems :)

Michael


Am 14.07.22 um 08:02 schrieb Sean Carte:
> --
> All messages to this mailing list should adhere to the Code of Conduct:
> https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
> <https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx>
> ---
> You received this message because you are subscribed to the Google
> Groups "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to dspace-tech...@googlegroups.com
> <mailto:dspace-tech...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dspace-tech/CA%2BxAuhMkoCiM%2BRJafRddPpH15wU%2BfB%3DJBwnAYA6m_OmogX9OhA%40mail.gmail.com
> <https://groups.google.com/d/msgid/dspace-tech/CA%2BxAuhMkoCiM%2BRJafRddPpH15wU%2BfB%3DJBwnAYA6m_OmogX9OhA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Sean Carte

unread,
Jul 14, 2022, 10:53:21 AM7/14/22
to Michael Plate, DSpace Technical Support
Thanks for the advice, Michael.

I do wonder, though, why the /dspace/etc/ directory is missing in 7.x? It doesn't seem to be there in: https://github.com/DSpace/DSpace/tree/main/dspace

I took a copy from a 6.x installation, and ran it with psql. Apart from a couple of errors, it seemed to work and I can now deposit items.

ERROR:  relation "workflowitem" does not exist
LINE 1: ...setval('workflowitem_seq', max(workflow_id)) FROM workflowit...
                                                             ^
ERROR:  relation "tasklistitem" does not exist
LINE 1: ...setval('tasklistitem_seq', max(tasklist_id)) FROM tasklistit...

Sean

To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/cd567e6a-5b3d-23fd-a83c-a5bd32073dd7%40bibliothek.uni-kassel.de.

Tim Donohue

unread,
Jul 14, 2022, 1:41:31 PM7/14/22
to Sean Carte, Michael Plate, DSpace Technical Support
Hi Sean,

The "[dspace]/etc/" folder was removed in DSpace 7 because all the old SQL scripts (which used to sit in "etc" in older versions of DSpace) have been moved elsewhere.  This folder was already "mostly" empty in DSpace 5 & 6, and we completely emptied it out & removed it in DSpace 7.
So, if you see a "[dspace]/etc" folder, it can be safely removed after you upgrade to DSpace 7.  Any SQL scripts in that folder are outdated and unnecessary in DSpace 7.

Tim

From: dspac...@googlegroups.com <dspac...@googlegroups.com> on behalf of Sean Carte <sean....@gmail.com>
Sent: Thursday, July 14, 2022 9:53 AM
To: Michael Plate <pl...@bibliothek.uni-kassel.de>
Cc: DSpace Technical Support <dspac...@googlegroups.com>
Subject: Re: [dspace-tech] Duplicate key after restoring server from AIP backup
 

Sean Carte

unread,
Jul 15, 2022, 2:06:16 AM7/15/22
to Tim Donohue, Michael Plate, DSpace Technical Support
Reply all
Reply to author
Forward
0 new messages