Dspace index-discovery error

182 views
Skip to first unread message

Jack OE

unread,
Jan 25, 2024, 10:06:51 PM1/25/24
to DSpace Technical Support
Hi all

We are getting an error every time we try to execute "/dspace/bin/dspace index-discovery", but not problem when executing "/dspace/bin/dspace index-discovery -b"
Anyone know what the problem might be and how to resolve it? Any help is greatly appreciated, thanks!
Error msg at follows:

javax.persistence.PersistenceException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.dspace.content.DSpaceObject.metadata, could not initialize proxy - no Session
 at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
 at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1626)
 at org.hibernate.query.Query.getResultList(Query.java:165)
 at org.dspace.authorize.dao.impl.ResourcePolicyDAOImpl.findValidPolicyOwners(ResourcePolicyDAOImpl.java:450)
 at org.dspace.authorize.ResourcePolicyServiceImpl.findValidPolicyOwners(ResourcePolicyServiceImpl.java:430)
 at org.dspace.authorize.AuthorizeServiceImpl.getValidPolicyOwnersActionFilter(AuthorizeServiceImpl.java:529)
 at org.dspace.discovery.SolrServiceResourceRestrictionPlugin.additionalIndex(SolrServiceResourceRestrictionPlugin.java:79)
 at org.dspace.discovery.indexobject.IndexFactoryImpl.buildDocument(IndexFactoryImpl.java:70)
 at org.dspace.discovery.indexobject.DSpaceObjectIndexFactoryImpl.buildDocument(DSpaceObjectIndexFactoryImpl.java:30)
 at org.dspace.discovery.indexobject.ItemIndexFactoryImpl.buildDocument(ItemIndexFactoryImpl.java:144)
 at org.dspace.discovery.indexobject.ItemIndexFactoryImpl.buildDocument(ItemIndexFactoryImpl.java:81)
 at org.dspace.discovery.SolrServiceImpl.update(SolrServiceImpl.java:185)
 at org.dspace.discovery.SolrServiceImpl.indexContent(SolrServiceImpl.java:175)
 at org.dspace.discovery.SolrServiceImpl.updateIndex(SolrServiceImpl.java:365)
 at org.dspace.discovery.SolrServiceImpl.updateIndex(SolrServiceImpl.java:352)
 at org.dspace.discovery.IndexClient.internalRun(IndexClient.java:139)
 at org.dspace.scripts.DSpaceRunnable.run(DSpaceRunnable.java:150)
 at org.dspace.app.launcher.ScriptLauncher.executeScript(ScriptLauncher.java:174)
 at org.dspace.app.launcher.ScriptLauncher.handleScript(ScriptLauncher.java:151)
 at org.dspace.app.launcher.ScriptLauncher.handleScript(ScriptLauncher.java:125)
 at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:100)
Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.dspace.content.DSpaceObject.metadata, could not initialize proxy - no Session
 at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:614)
 at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:218)
 at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:591)
 at org.hibernate.collection.internal.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:787)
 at org.hibernate.engine.internal.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:1005)
 at org.hibernate.engine.internal.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:991)
 at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:362)
 at org.hibernate.loader.Loader.doList(Loader.java:2868)
 at org.hibernate.loader.Loader.doList(Loader.java:2850)
 at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2682)
 at org.hibernate.loader.Loader.list(Loader.java:2677)
 at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:540)
 at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400)
 at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:218)
 at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1459)
 at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649)
 at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617)

DSpace Technical Support

unread,
Jan 26, 2024, 11:12:51 AM1/26/24
to DSpace Technical Support
Hi,

The error " could not initialize proxy - no Session" usually implies a database connection or communication error.  (It also can occur if you are using custom code and the custom code has a bug where it's not contacting the database properly...but that's less likely for most sites.)

I'd recommend looking for additional errors just before this regarding your database connection... or possibly a major error earlier in the logs which resulted in an invalid database connection.  Based on the details of this error message, it's difficult to say what the cause is.  But, I'd recommend looking closer at your dspace.log and/or Tomcat logs to see if **additional errors** exist...as they may be causing this error.

If that doesn't help, then you should share the exact version of DSpace you are using.  It's also possible this is a bug in a specific version of DSpace, but we'd need more information about your setup to see if someone else can reproduce the problem.

Tim

Jack OE

unread,
Jan 28, 2024, 9:26:43 PM1/28/24
to DSpace Technical Support
Hi,

Thanks for the reply.
We are not using any custom codes, and we weren't able to find any additional errors in the log. 
The DSpace version we are using is:
dspaceVersion": "DSpace 7.6.1",
  "crisVersion": "cris-2023.02.01
Hope that clarifies it a bit.

Jarmo Schrader

unread,
Jan 30, 2024, 10:52:05 AM1/30/24
to dspac...@googlegroups.com
Hi,

we have exactly the same problem on our DSpace CRIS 2023.01.00. I suspect that it is a CRIS-specific problem. We currently just always run the job with the "-b" Option, which is OK as our repo is still quite small.

I spent some time digging and looking at other logs, increasing the log-level but could noct find anything obvious. We have not reported it as a bug for DSpace-CRIS yet as we were not sure whether it is due to some error in our config.
There ist also a post on the google-group about this issue with no solution: https://groups.google.com/g/dspace-tech/c/R_8QqHod-BE/m/X54sDegGBwAJ I tried to contact the author of this post without success.

Jarmo
--
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 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/ac606973-c60d-4063-8af1-b0941217b09dn%40googlegroups.com.

--
Dr. Jarmo Schrader
stellv. Bibliotheksleiter
Fachreferat und EDV
Universität Hildesheim
Universitätsbibliothek
Universitätsplatz 1
31141 Hildesheim

Tel: +49 (0) 5121 - 883 - 93004
jarmo.s...@uni-hildesheim.de
Reply all
Reply to author
Forward
0 new messages