-
Notifications
You must be signed in to change notification settings - Fork 617
random mapping record error #2602
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
Comments
That's interesting, because the part that will determine the right implementation of the Lines 282 to 284 in dabbecf
To give me some context, does this happen only in concurrency scenarios or also in "single threaded" tests? |
Sorry, I have to correct me: Was just looking at the head of 6.2.x and not 6.2.4 in special. You are right. The determination there is quite different and our goal was to improve it and not make it worse (of course). |
I tried my best to figure out how to re-produce the problem, but still no chance. Could you maybe help me in providing some context? |
Yes, actually it almost happens everywhere that the library gets involved, even for standalone java applications. You won't see this error when the application starts. I've found another one yesterday, we deployed exactly the same war file on different servers, dev is not working and production is working, the error message is basically the same just different class name, the dirty fix is redeploying the war file again, however, it won't fix the issue and might happen again. |
But when it happens, it happens right from the start? SDN does not map correctly first and then suddenly fails for the same class?
|
I am sorry I couldn't provide you with useful information, I think it happens when querying the graph database, you won't see this error message when our application starts. I have created a demo project with only one main class to allow you to produce the same error message, however, you have to run our graph database locally, here is the database dump file, and the demo project is below. |
Thanks for the input. I am still without any modifications not running into this problem. |
Thank you so much for your reply, may I know which JVMs are you using? We use Java 11. |
I tested 11 - 18 from different vendors. |
Hi, sorry to get involved in the middle of the thread, but may I ask you wich version of Neo4j are you using to perform the tests? Maybe the issue is linked to this? |
Hi everyone! Among those 45, none are belonging to the tree of the target class, so the only common label is the primary root (Database Object), and therefore it picks a random subclass of DatabaseObject for the mapping. Sometimes it picks one of our abstract classes and so it completely fails, and sometimes it just picks another class, but not the actual one we received from neo4j, then things are working because we only look at the displayName which is at root property, but any omore specific property accession would definetly fails. I've modified the demo file to showcase that even when it looks like the. mapping is working, the type is actually never the one expected : FragmentDeletionModification |
I tried upgrading SDN to 6.3.6 as some changes where released then are regarding the NodeDescriptionStore and how they map nodes #2619. However this didn't solved the issue. Therefore the issue might also come from a Spring Boot optimization when using a dependency which leads to not "index" classes which are not directly in use. |
I have managed to fix the issue: Then adding the TLDR: Be sure to have a Configuration class in your graph library package which contains the following annotations: @Configuration // Important when repackaging using spring-boot-maven-plugin
@EntityScan(basePackages = "org.reactome.server.graph.domain.model") // Important to be sure to index all Entities
@ComponentScan(basePackages = "org.reactome.server.graph")
@EnableNeo4jRepositories(basePackages = "org.reactome.server.graph.repository")
@EnableSpringConfigured
@EnableAutoConfiguration
public class GraphCoreNeo4jConfig {} |
After further inspection, the issue is not is not entirely fixed: When running it from our spring-boot application context, the haystack for children of DatabaseObjects only gets populated with between 95 and 101 objects instead of the expected 102... The big problem being that this number is random, so depending on luck, some queries might work and some not because the return type does not get picked up by the NodeDescriptionStore, even after explicit declaration of |
Thanks for the deep analysis of the problem. And I am sorry that the (correct) scanning configuration did not solve all problems. |
@meistermeier I managed to fix this last issue by ensuring we are using the same version of spring-data-neo4j on both our graph library and the packages that are using it: their version were overridden by spring-boot-parent 2.7.1 and failing, but now that they are all using spring-boot-parent 2.7.6, it looks like the number always stays at 102 which is the correct number (they were 2 classes from the snaphots which were defined in another path). |
Issue was solved by the user. Closing this now. |
Hi, I am also facing an error in which a record could not be mapped. The tricky part is that this error is intermittent after upgrading SDN to 6.3.1(spring boot 2.7.1), sometime happens sometimes not, it is working well with SDN 6.2.4(spring boot 2.6.7)
controller (full page is here)
service(full page is here)
repository(full page is here)
data model:
ReactioneLikeEvent class.
Event class
DatabaseObject class
error message is, it is not easy to produce the error as it happens randomly.
References:
our service Github repo: https://github.com/reactome/content-service
graph core Github repo: https://github.com/reactome/graph-core/
it would be great if you have any ideas about it and thank you so much for your help.
The text was updated successfully, but these errors were encountered: