Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database integrity check #685

Open
Rita-C opened this issue May 10, 2019 · 0 comments
Open

Database integrity check #685

Rita-C opened this issue May 10, 2019 · 0 comments

Comments

@Rita-C
Copy link
Contributor

Rita-C commented May 10, 2019

[2019-05-01] Database export failed due to a referred Authorship Term in a Profile was deleted from Term (Mongodb Collection), error message in profiles-service log:

Error loading association [103] of type [class au.org.ala.profile.Term]. Associated instance no longer exists.. Stacktrace follows:
org.springframework.dao.DataIntegrityViolationException: Error loading association [103] of type [class au.org.ala.profile.Term]. Associated instance no longer exists.
       at org.grails.datastore.gorm.proxy.ProxyInstanceMetaClass.getProxyTarget(ProxyInstanceMetaClass.java:68)
       at org.grails.datastore.gorm.proxy.ProxyInstanceMetaClass.getProperty(ProxyInstanceMetaClass.java:130)
       at au.org.ala.profile.marshaller.ProfileMarshaller$_register_closure1$_closure3.doCall(ProfileMarshaller.groovy:46)
       at au.org.ala.profile.marshaller.ProfileMarshaller$_register_closure1.doCall(ProfileMarshaller.groovy:45)
       at grails.converters.JSON.value(JSON.java:202)
       at grails.converters.JSON.render(JSON.java:134)
       at grails.converters.JSON.render(JSON.java:150)
       at au.org.ala.profile.ProfileController.getByUuid(ProfileController.groovy:462)
       at au.org.ala.cas.client.UriFilter.doFilter(UriFilter.java:199)
       at au.org.ala.web.filter.ParametersFilterProxy.doFilter(ParametersFilterProxy.java:24)
       at au.org.ala.cas.client.UriFilter.doFilter(UriFilter.java:199)
       at au.org.ala.web.filter.ParametersFilterProxy.doFilter(ParametersFilterProxy.java:24)
       at au.org.ala.cas.client.UriFilter.doFilter(UriFilter.java:199)
       at au.org.ala.web.filter.ParametersFilterProxy.doFilter(ParametersFilterProxy.java:24)
       at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:97)
       at com.brandseye.cors.CorsFilter.doFilter(CorsFilter.java:82)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
       at java.lang.Thread.run(Thread.java:748)

The faulty Profile was https://profiles.ala.org.au/opus/foa/profile/Acacia%20armitii
or https://profiles.ala.org.au/opus/foa/profile/87e08cd2-4ce0-4416-8d43-18d509d7e38f

Looked into database:

{ "_id" : ObjectId("596c561be4b0139d586ae5f5"), "authorship" : [ { "category" : NumberLong(38), "text" : "P.G. Kodela" }, { "category" : NumberLong(36), "text" : "B.R. Maslin, J. Rogers, P.G. Kodela, A.E. Orchard" }, { "category" : NumberLong(103), "text" : "Edited by B.R. Maslin & Jemima Rogers (June 2012), P.G. Kodela (January 2018), A.E. Orchard (January 2018)" } ] }

"Edited by B.R. Maslin & Jemima Rogers (June 2012), P.G. Kodela (January 2018), A.E. Orchard (January 2018)" was the entry caused the problem and it's duplicated.

The problem has been resolved by removing above Term link from Profile.
Application was tested and database was checked, there is no other Profile with this issue.

This ticket is created as a reminder to check database integrity in the next Sprint:
db.profile.distinct("draft.authorship.category"); unique authorship Term in draft Profiles
db.profile.distinct("authorship.category"); unique a-Term in published Profiles
db.term.find({}); all Terms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant