index-discovery error

94 views
Skip to first unread message

Andrew K

unread,
Mar 20, 2023, 3:30:32 AM3/20/23
to DSpace Technical Support
Hello!

I have a 7.5 server updated from 5.4.
The database update process finished OK.
But the index-discovery fails. 

2023-03-20 09:24:03.611 INFO index-discovery - 4 @ The script has started 2023-03-20 09:24:03.611 INFO index-discovery - 4 @ Updating Index 2023-03-20 09:24:43.049 ERROR index-discovery - 4 @ null 2023-03-20 09:24:43.050 ERROR index-discovery - 4 @ java.lang.IllegalArgumentException: More than one result found at org.dspace.core.AbstractHibernateDAO.uniqueResult(AbstractHibernateDAO.java:242) at org.dspace.content.dao.impl.WorkspaceItemDAOImpl.findByItem(WorkspaceItemDAOImpl.java:81) at org.dspace.content.WorkspaceItemServiceImpl.findByItem(WorkspaceItemServiceImpl.java:243) at org.dspace.content.ItemServiceImpl.getParentObject(ItemServiceImpl.java:1408) at org.dspace.content.ItemServiceImpl.getParentObject(ItemServiceImpl.java:92) at org.dspace.discovery.SolrServiceResourceRestrictionPlugin.additionalIndex(SolrServiceResourceRestrictionPlugin.java:129) at org.dspace.discovery.indexobject.IndexFactoryImpl.buildDocument(IndexFactoryImpl.java:67) at org.dspace.discovery.indexobject.InprogressSubmissionIndexFactoryImpl.buildDocument(InprogressSubmissionIndexFactoryImpl.java:51) at org.dspace.discovery.indexobject.WorkspaceItemIndexFactoryImpl.buildDocument(WorkspaceItemIndexFactoryImpl.java:63) at org.dspace.discovery.indexobject.WorkspaceItemIndexFactoryImpl.buildDocument(WorkspaceItemIndexFactoryImpl.java:30) at org.dspace.discovery.SolrServiceImpl.update(SolrServiceImpl.java:169) at org.dspace.discovery.SolrServiceImpl.indexContent(SolrServiceImpl.java:159) at org.dspace.discovery.SolrServiceImpl.updateIndex(SolrServiceImpl.java:344) at org.dspace.discovery.SolrServiceImpl.updateIndex(SolrServiceImpl.java:331) at org.dspace.discovery.IndexClient.internalRun(IndexClient.java:130) at org.dspace.scripts.DSpaceRunnable.run(DSpaceRunnable.java:104) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)The database info
Database Type: postgres
Database URL: jdbc:postgresql://localhost:5432/dspace
Database Schema: public
Database Username: dspace
Database Software: PostgreSQL version 14.7 (Ubuntu 14.7-0ubuntu0.22.04.1)
Database Driver: PostgreSQL JDBC Driver version 42.4.3
PostgreSQL 'pgcrypto' extension installed/up-to-date? true (version=1.3)
FlywayDB Version: 8.4.4

+-----------+----------------+------------------------------------------------------------------+----------+---------------------+--------------+
| Category  | Version        | Description                                                      | Type     | Installed On        | State        |
+-----------+----------------+------------------------------------------------------------------+----------+---------------------+--------------+
|           | 1              | << Flyway Init >>                                                | BASELINE | 2016-02-15 00:03:53 | Baseline     |
| Versioned | 1.1            | Initial DSpace 1.1 database schema                               | SQL      | 2016-02-15 00:03:53 | Success      |
| Versioned | 1.2            | Upgrade to DSpace 1.2 schema                                     | SQL      | 2016-02-15 00:03:54 | Success      |
| Versioned | 1.3            | Upgrade to DSpace 1.3 schema                                     | SQL      | 2016-02-15 00:03:54 | Success      |
| Versioned | 1.3.9          | Drop constraint for DSpace 1 4 schema                            | JDBC     | 2016-02-15 00:03:54 | Success      |
| Versioned | 1.4            | Upgrade to DSpace 1.4 schema                                     | SQL      | 2016-02-15 00:03:54 | Success      |
| Versioned | 1.5            | Upgrade to DSpace 1.5 schema                                     | SQL      | 2016-02-15 00:03:54 | Success      |
| Versioned | 1.5.9          | Drop constraint for DSpace 1 6 schema                            | JDBC     | 2016-02-15 00:03:54 | Success      |
| Versioned | 1.6            | Upgrade to DSpace 1.6 schema                                     | SQL      | 2016-02-15 00:03:54 | Success      |
| Versioned | 1.7            | Upgrade to DSpace 1.7 schema                                     | SQL      | 2016-02-15 00:03:54 | Success      |
| Versioned | 1.8            | Upgrade to DSpace 1.8 schema                                     | SQL      | 2016-02-15 00:03:54 | Success      |
| Versioned | 3.0            | Upgrade to DSpace 3.x schema                                     | SQL      | 2016-02-15 00:03:54 | Success      |
| Versioned | 4.0            | Upgrade to DSpace 4.x schema                                     | SQL      | 2016-02-15 00:03:54 | Success      |
| Versioned | 5.0.2014.08.08 | DS-1945 Helpdesk Request a Copy                                  | SQL      | 2016-02-15 00:03:54 | Success      |
| Versioned | 5.0.2014.09.25 | DS 1582 Metadata For All Objects drop constraint                 | JDBC     | 2016-02-15 00:03:54 | Success      |
| Versioned | 5.0.2014.09.26 | DS-1582 Metadata For All Objects                                 | SQL      | 2016-02-15 00:03:54 | Success      |
| Versioned | 5.0.2014.11.04 | Enable XMLWorkflow Migration                                     | JDBC     | 2023-03-17 21:06:14 | Success      |
| Versioned | 5.6.2016.08.23 | DS-3097                                                          | SQL      | 2023-03-17 21:06:14 | Success      |
| Versioned | 5.7.2017.04.11 | DS-3563 Index metadatavalue resource type id column              | SQL      | 2023-03-17 21:06:14 | Success      |
| Versioned | 5.7.2017.05.05 | DS 3431 Add Policies for BasicWorkflow                           | JDBC     | 2023-03-17 21:06:15 | Success      |
| Versioned | 6.0.2015.03.06 | DS 2701 Dso Uuid Migration                                       | JDBC     | 2023-03-17 21:06:15 | Success      |
| Versioned | 6.0.2015.03.07 | DS-2701 Hibernate migration                                      | SQL      | 2023-03-17 21:06:15 | Success      |
| Versioned | 6.0.2015.08.31 | DS 2701 Hibernate Workflow Migration                             | JDBC     | 2023-03-17 21:07:19 | Success      |
| Versioned | 6.0.2015.09.01 | DS 2701 Enable XMLWorkflow Migration                             | JDBC     | 2023-03-17 21:07:19 | Success      |
| Versioned | 6.0.2016.01.03 | DS-3024                                                          | SQL      | 2023-03-17 21:07:19 | Success      |
| Versioned | 6.0.2016.01.26 | DS 2188 Remove DBMS Browse Tables                                | JDBC     | 2023-03-17 21:07:19 | Success      |
| Versioned | 6.0.2016.02.25 | DS-3004-slow-searching-as-admin                                  | SQL      | 2023-03-17 21:07:19 | Success      |
| Versioned | 6.0.2016.04.01 | DS-1955 Increase embargo reason                                  | SQL      | 2023-03-17 21:07:19 | Success      |
| Versioned | 6.0.2016.04.04 | DS-3086-OAI-Performance-fix                                      | SQL      | 2023-03-17 21:07:19 | Success      |
| Versioned | 6.0.2016.04.14 | DS-3125-fix-bundle-bitstream-delete-rights                       | SQL      | 2023-03-17 21:07:20 | Success      |
| Versioned | 6.0.2016.05.10 | DS-3168-fix-requestitem item id column                           | SQL      | 2023-03-17 21:07:20 | Success      |
| Versioned | 6.0.2016.07.21 | DS-2775                                                          | SQL      | 2023-03-17 21:07:20 | Success      |
| Versioned | 6.0.2016.07.26 | DS-3277 fix handle assignment                                    | SQL      | 2023-03-17 21:07:20 | Success      |
| Versioned | 6.0.2016.08.23 | DS-3097                                                          | SQL      | 2023-03-17 21:07:20 | Success      |
| Versioned | 6.1.2017.01.03 | DS 3431 Add Policies for BasicWorkflow                           | JDBC     | 2023-03-17 21:07:21 | Success      |
| Versioned | 7.0.2017.10.12 | DS-3542-stateless-sessions                                       | SQL      | 2023-03-17 21:07:21 | Success      |
| Versioned | 7.0.2018.04.03 | Upgrade Workflow Policy                                          | JDBC     | 2023-03-17 21:07:21 | Success      |
| Versioned | 7.0.2018.04.16 | dspace-entities                                                  | SQL      | 2023-03-17 21:07:21 | Success      |
| Versioned | 7.0.2018.06.07 | DS-3851-permission                                               | SQL      | 2023-03-17 21:07:21 | Success      |
| Versioned | 7.0.2019.05.02 | DS-4239-workflow-xml-migration                                   | SQL      | 2023-03-17 21:07:21 | Success      |
| Versioned | 7.0.2019.06.14 | scripts-and-process                                              | SQL      | 2023-03-17 21:07:21 | Success      |
| Versioned | 7.0.2019.07.31 | Retrieval of name variant                                        | SQL      | 2023-03-17 21:07:21 | Success      |
| Versioned | 7.0.2019.11.13 | relationship type copy left right                                | SQL      | 2023-03-17 21:07:22 | Success      |
| Versioned | 7.0.2020.01.08 | DS-626-statistics-tracker                                        | SQL      | 2023-03-17 21:07:22 | Success      |
| Versioned | 7.0.2020.10.31 | CollectionCommunity Metadata Handle                              | JDBC     | 2023-03-17 21:07:22 | Success      |
| Versioned | 7.0.2021.01.22 | Remove basic workflow                                            | SQL      | 2023-03-17 21:07:23 | Success      |
| Versioned | 7.0.2021.02.08 | tilted rels                                                      | SQL      | 2023-03-17 21:07:23 | Success      |
| Versioned | 7.0.2021.03.18 | Move entity type to dspace schema                                | SQL      | 2023-03-17 21:07:23 | Success      |
| Versioned | 7.0.2021.09.24 | Move entity type from item template to collection                | SQL      | 2023-03-17 21:07:23 | Success      |
| Versioned | 7.0.2021.10.04 | alter collection table drop workflow stem columns                | SQL      | 2023-03-17 21:07:23 | Success      |
| Versioned | 7.1.2021.10.18 | Fix MDV place after migrating from DSpace 5                      | SQL      | 2023-03-17 21:07:23 | Success      |
| Versioned | 7.3.2022.04.29 | orcid queue and history                                          | SQL      | 2023-03-17 21:07:44 | Success      |
| Versioned | 7.3.2022.05.16 | Orcid token table                                                | SQL      | 2023-03-17 21:07:44 | Success      |
| Versioned | 7.3.2022.06.16 | process to group                                                 | SQL      | 2023-03-17 21:07:44 | Success      |
| Versioned | 7.3.2022.06.20 | add last version status column to relationship table             | SQL      | 2023-03-17 21:07:44 | Success      |
| Versioned | 7.5.2022.12.01 | add table subscriptionparamter change columns subscription table | SQL      | 2023-03-17 21:07:44 | Success      |
| Versioned | 7.5.2022.12.06 | index action resource policy                                     | SQL      | 2023-03-17 21:07:44 | Success      |
| Versioned | 7.5.2022.12.09 | Supervision Orders table                                         | SQL      | 2023-03-17 21:07:44 | Success      |
| Versioned | 7.5.2022.12.15 | system wide alerts                                               | SQL      | 2023-03-17 21:07:44 | Success      |
| Versioned | 4.9.2015.10.26 | DS-2818 registry update                                          | SQL      | 2023-03-17 21:09:09 | Out of Order |
+-----------+----------------+------------------------------------------------------------------+----------+---------------------+--------------+

Tim Donohue

unread,
Mar 21, 2023, 12:34:05 PM3/21/23
to DSpace Technical Support

Hi,

Based on that error message, it sounds like you somehow have invalid data in your "workspaceitem" database table (this table is used to store information about in-progress submissions).  The error seems to be saying that you have two different entries in the "workspaceitem" table which reference the *same* "item_id".  That shouldn't be possible, as each WorkspaceItem should have a *unique* "item_id".

I'm not sure how that could have occurred. But if you can find the duplicate entry in "workspaceitem", then it should be possible to just remove one of the entries.  I'd recommend making a copy of the database before doing this, as it's possible there could be side effects that I'm not foreseeing.  Once that duplicate entry is removed though, I suspect the indexing will work properly.

Tim

Andrew K

unread,
Mar 21, 2023, 3:54:03 PM3/21/23
to DSpace Technical Support
Hi Tim, 

Thanks a lot for your reply!

I exported the table workspaceitem and found no identical "item_id" numbers. Since I do not care about those old (partially) submitted items, I wanted to delete everything in the admin/workflow zone on the website, but somehow it's not possible for those old submissions.
So I just truncated the workspaceitem table in the database. And it worked! Now index-discovery goes smoothly. Yay!

Can I also ask you if it's possible to keep the old handle-type URLs in DSpace 7 ?

Best regards,
Andrew

вт, 21 бер. 2023 р. о 18:34 'Tim Donohue' via DSpace Technical Support <dspac...@googlegroups.com> пише:
--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to a topic in the Google Groups "DSpace Technical Support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dspace-tech/S8hpmO40ayw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/e0e5ebc4-3aa8-468a-bae1-4bc7ee4b6f5cn%40googlegroups.com.


--
Best regards,
Andrew

Tim Donohue

unread,
Mar 21, 2023, 3:55:50 PM3/21/23
to Andrew K, DSpace Technical Support
Hi Andrew,

Glad to hear you figured it out.  

Regarding your other URL question, I just answered it in your other email thread: https://groups.google.com/g/dspace-tech/c/cLFoNivftB4/m/mjajzzydAAAJ

Tim

From: dspac...@googlegroups.com <dspac...@googlegroups.com> on behalf of Andrew K <pkm...@gmail.com>
Sent: Tuesday, March 21, 2023 2:53 PM
To: DSpace Technical Support <dspac...@googlegroups.com>
Subject: Re: [dspace-tech] Re: index-discovery error
 
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/CANez4yAJ7KLG%2BX9jyGS5oz9n9KLbN3api86TUtTfAK1ENZzAbA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages