0

I'm running jQAssistant with an external Neo4J database. I want to collect the data of our projects and keep them externally for queries.

To do that, I reset the store just before scanning the projects.

However, since a couple of days, I'm getting this error:

[INFO] --- jqassistant-maven-plugin:1.10.0:reset (reset-store) @ foobar ---
[INFO] Scanning for jQAssistant plugins...
[INFO] [Asciidoc Report, CDI, Common, Core Analysis, Core Report, EJB3, GraphML, GraphQL, JAX-RS, JSON,
JUnit, Java, Java EE 6, Maven 2 Repository, Maven 3, OSGi, RDBMS, Spring, TestNG, Tycho, XML, YAML,
jQAssistant JPA 2 Plugin].
[INFO] Connecting to store at 'bolt://myserver:7687' (username=neo4j)
Aug 29, 2021 5:45:11 PM org.neo4j.driver.internal.logging.JULogger info
INFORMATION: Direct driver instance 1436136891 created for server address myserver:7687
[INFO] Resetting store.
[INFO] Resetting store.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  54:07 min
[INFO] Finished at: 2021-08-29T18:39:13+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.buschmais.jqassistant:jqassistant-maven-plugin:1.10.0:reset (reset-store)
on project foobar: Execution reset-store of goal
com.buschmais.jqassistant:jqassistant-maven-plugin:1.10.0:reset failed:
Cannot delete node<11994142>, because it still has relationships.
To delete this node, you must first delete its relationships. -> [Help 1]

Is there anything I can do about that? Or should I just reinstall Neo4J?

eerriicc
  • 1,124
  • 4
  • 17
  • 29
  • I think the issue may be due to limits if I read the code correctly: https://github.com/jQAssistant/jqa-core-framework/blob/40dc117db569d4d45fd3d7015ed780b4ed571999/store/src/main/java/com/buschmais/jqassistant/core/store/impl/AbstractGraphStore.java#L195 Maybe you can get out of this by manually deleting the data from cypher shell/neo4j browser: MATCH (n) DETACH DELETE n – Håkan Löfqvist Aug 30 '21 at 07:39
  • Thanks for your answer! I tried this, but the query took so much time that's I can't do this during our nightly build. I guess I'll just reinstall Neo4J before scanning. – eerriicc Aug 31 '21 at 07:43
  • The jQA reset first deletes all relationships, afterwards all nodes. Both happens in batches to prevent to large transactions in Neo4j. The symptom you describe therefore should not happen (and we did not see it before). Question: as you are using a dedicated Neo4j server setup: Is it possible that another job in parallel creates nodes/relations again? – Dirk Mahler Aug 31 '21 at 20:22
  • Well, in our Jenkins we have the clean job at 17:45 and the scan jobs start at 18:00. So I don't think there should be any overlapping. I reinstalled Neo4J (as mentioned before), and the clean job last night lasted only 15 seconds. – eerriicc Sep 01 '21 at 06:46
  • Your idea was very helpful: When our nightly build starts, Jenkins is very busy. So there should be any overlapping, but in practice, it happens. I will have to create a Jenkins pipeline for the whole scanning. – eerriicc Sep 01 '21 at 16:10
  • Ok, since the Jenkins pipeline has been running, this problem has apparently been solved. – eerriicc Sep 13 '21 at 13:12
  • The next release will come with an optimization that should notably speed up resetting the store (the logs above show 57 minutes which is quite much time). – Dirk Mahler Sep 15 '21 at 19:51
  • Great! I think our software is big, but not huge. – eerriicc Sep 16 '21 at 06:31

1 Answers1

1

See the comments which led to a Jenkins pipeline. Otherwise cleaning (in my case) can overlap with scanning.

eerriicc
  • 1,124
  • 4
  • 17
  • 29