You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A small bug was introduced by #8620 that we noticed while running the health check. As a result of the PR, the Subscriptions table no longer references collections directly, instead using dspace_object_id. But the findCollectionsWithSubscribers method in CollectionDAOImpl.java still references the collection field of subscriptions.
returnlist(createQuery(context, "SELECT DISTINCT col FROM Subscription s join s.collection col"));
}
Stacktrace:
Exception occurred when processing report - java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: collection of: org.dspace.eperson.Subscription [SELECT DISTINCT col FROM org.dspace.eperson.Subscription s join s.collection col]
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:138)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:757)
at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:114)
at jdk.internal.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.hibernate.context.internal.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:351)
at jdk.proxy2/jdk.proxy2.$Proxy137.createQuery(Unknown Source)
at org.dspace.core.AbstractHibernateDAO.createQuery(AbstractHibernateDAO.java:137)
at org.dspace.content.dao.impl.CollectionDAOImpl.findCollectionsWithSubscribers(CollectionDAOImpl.java:162)
at org.dspace.content.CollectionServiceImpl.findCollectionsWithSubscribers(CollectionServiceImpl.java:846)
at org.dspace.health.UserCheck.run(UserCheck.java:109)
at org.dspace.health.Check.report(Check.java:31)
at org.dspace.health.Report.run(Report.java:69)
at org.dspace.health.Report.main(Report.java:196)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:283)
at org.dspace.app.launcher.ScriptLauncher.handleScript(ScriptLauncher.java:134)
at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:99)
Caused by: org.hibernate.QueryException: could not resolve property: collection of: org.dspace.eperson.Subscription [SELECT DISTINCT col FROM org.dspace.eperson.Subscription s join s.collection col]
at org.hibernate.QueryException.generateQueryException(QueryException.java:120)
at org.hibernate.QueryException.wrapWithQueryString(QueryException.java:103)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:220)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:144)
at org.hibernate.engine.query.spi.HQLQueryPlan.(HQLQueryPlan.java:112)
at org.hibernate.engine.query.spi.HQLQueryPlan.(HQLQueryPlan.java:73)
at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:162)
at org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:636)
at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:748)
... 20 more
Caused by: org.hibernate.QueryException: could not resolve property: collection of: org.dspace.eperson.Subscription
at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:78)
at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:72)
at org.hibernate.persister.entity.AbstractEntityPersister.toType(AbstractEntityPersister.java:2053)
at org.hibernate.hql.internal.ast.tree.FromElementType.getPropertyType(FromElementType.java:412)
at org.hibernate.hql.internal.ast.tree.FromElement.getPropertyType(FromElement.java:524)
at org.hibernate.hql.internal.ast.tree.DotNode.getDataType(DotNode.java:723)
at org.hibernate.hql.internal.ast.tree.DotNode.prepareLhs(DotNode.java:268)
at org.hibernate.hql.internal.ast.tree.DotNode.resolve(DotNode.java:208)
at org.hibernate.hql.internal.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:114)
at org.hibernate.hql.internal.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:109)
at org.hibernate.hql.internal.ast.HqlSqlWalker.createFromJoinElement(HqlSqlWalker.java:411)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.joinElement(HqlSqlBaseWalker.java:4007)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3793)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3671)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:746)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:602)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:339)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:287)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:276)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:192)
... 26 more
To Reproduce
Steps to reproduce the behavior:
Have at least one subscription to a collection in the subscriptions table
Run [dspace]/bin/dspace healthcheck -e person@example.org
Observe that the error occurs when it gets to the User summary section of the health check.
Expected behavior
The health check should finish without errors.
Yes, on our larger repositories the running time can be several hours. Based on the sizes of your assetstore and logs I'd guess this is your case, too. You could try running it on a smaller or test DSpace instance, or you could remove some of the longer running checks in [dspace]/config/modules/healthcheck.cfg like the Log Analyser Check.
Ah hah! I got the exception after thirty hours or so:
#### User summary [took: 0s] [# lines: 58]Exception occurred when processing report - java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: collection of: org.dspace.eperson.Subscription [SELECT DISTINCT col FROM org.dspace.eperson.Subscription s join s.collection col]
Describe the bug
A small bug was introduced by #8620 that we noticed while running the health check. As a result of the PR, the Subscriptions table no longer references collections directly, instead using
dspace_object_id
. But thefindCollectionsWithSubscribers
method in CollectionDAOImpl.java still references the collection field of subscriptions.DSpace/dspace-api/src/main/java/org/dspace/content/dao/impl/CollectionDAOImpl.java
Lines 160 to 163 in 07e0b02
Stacktrace:
To Reproduce
Steps to reproduce the behavior:
[dspace]/bin/dspace healthcheck -e person@example.org
Expected behavior
The health check should finish without errors.
Related work
#8620
The text was updated successfully, but these errors were encountered: