command line import error - collection is null

130 views
Skip to first unread message

Joanna Lee

unread,
Sep 30, 2024, 12:15:36 PM9/30/24
to DSpace Technical Support
Hi.
We're on DSpace 7.6.1 and I'm trying to batch import items from a directory into different collections via command line. My command is:

./bin/dspace import -a -e [username] -s [filepath]/ETD2024-import-test -m mapfile

I am not specifying the collection there, as each item has the collection specified with a collections file, like this:

ETD-import-test
     -folder1
           -collections
          -contents
          -filename1.pdf
          -dublin_core.xml
          -metadata_thesis.xml
     -folder1
           -collections
          -contents
          -filename2.pdf
          -dublin_core.xml
          -metadata_thesis.xml

The collections file in each folder contain the appropriate handle path.

When I run the command in test mode (-v), it seems to go through smoothly. When I remove the -v and try to import the items, I get this error:

"No collections given. Assuming 'collections' file inside item directory

The script has started

Processing collections file: collections

Loading dublin core from /Users/jlee44/Documents/ETD-imports/2024-09/ETD2024-import-test/etdadmin_upload_783260/dublin_core.xml

Schema: dc Element: contributor Qualifier: author Value: [Last name, First name]

Started: 1727711731383

Ended: 1727711732556

Elapsed time: 1 secs (1173 msecs)

java.lang.Exception: Error committing changes to database: Cannot invoke "org.dspace.content.Collection.getID()" because "collection" is null, aborting most recent changes"

Any ideas about why this is happening? I double-checked the collections files where the handle path is separated and they look fine.

Thanks!

Joanna

Jan Skůpa

unread,
Nov 22, 2024, 4:56:46 AM11/22/24
to DSpace Technical Support
Hi,
I have the same error - in the test mode ok, without -v is a problem. I have all records in one collection, so collection is specified in -c value
Anyone?

Jan

Dne pondělí 30. září 2024 v 18:15:36 UTC+2 uživatel Joanna Lee napsal:

Joanna Lee

unread,
Nov 22, 2024, 4:47:47 PM11/22/24
to Jan Skůpa, DSpace Technical Support
Hi. 
Our developer tracked down our error. This is what she said: "it was an authority issue, one plugin is not enabled in the configuration(even though I can't find the official document about this). I saw the warning in the log and enabled it ." 

Is that helpful? If not, I can ask if she's willing to share more.

Joanna

--
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/8rU7X8Bxmy8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dspace-tech...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dspace-tech/03c6ba57-0cd6-4f35-8bc6-8d1b100596e7n%40googlegroups.com.

Jan Skůpa

unread,
Nov 25, 2024, 1:50:58 AM11/25/24
to DSpace Technical Support
Thank you! It’s true that we have been changing the configuration related to authorities. Could you please clarify exactly what needs to be enabled? Thanks.

Jan

Dne pátek 22. listopadu 2024 v 22:47:47 UTC+1 uživatel Joanna Lee napsal:

Jan Skůpa

unread,
Apr 7, 2025, 3:35:54 AM4/7/25
to DSpace Technical Support
Hi,
I finally figured out where the mistake was. In the authority.cfg file, I uncommented only the second line of the two lines:
plugin.named.org.dspace.content.authority.ChoiceAuthority = \
    org.dspace.content.authority.SolrAuthority = SolrAuthorAuthority
just uncomment both of them and everything works.

Dne pondělí 25. listopadu 2024 v 7:50:58 UTC+1 uživatel Jan Skůpa napsal:
Reply all
Reply to author
Forward
0 new messages