EBISPOT / OLS

Ontology Lookup Service from SPOT at EBI
http://www.ebi.ac.uk/ols
Apache License 2.0
96 stars 40 forks source link

ConstraintViolationException: It is not allowed to create schema constraints and indexes on the same {label;property}. #413

Closed johannes-darms closed 4 years ago

johannes-darms commented 4 years ago

With ebispot/ols-indexer:stable I get the following error:

2020-09-03 16:43:49,565 ERROR main OLSBatchIndexerCreator.createSchemaIndexIfNotExists - Couldn't create index for label 'Individual' with property 'obo_id' as it already exists, continuing...
2020-09-03 16:43:49,565 DEBUG main OLSBatchIndexerCreator.createSchemaIndexIfNotExists - Couldn't create index for label 'Individual' with property 'obo_id' as it already exists, continuing...
org.neo4j.graphdb.ConstraintViolationException: It is not allowed to create schema constraints and indexes on the same {label;property}.
    at org.neo4j.unsafe.batchinsert.BatchInserterImpl.checkSchemaCreationConstraints(BatchInserterImpl.java:370)
    at org.neo4j.unsafe.batchinsert.BatchInserterImpl.access$1400(BatchInserterImpl.java:146)
    at org.neo4j.unsafe.batchinsert.BatchInserterImpl$BatchSchemaActions.createIndexDefinition(BatchInserterImpl.java:1068)
    at org.neo4j.kernel.impl.coreapi.schema.IndexCreatorImpl.create(IndexCreatorImpl.java:76)
    at uk.ac.ebi.spot.ols.loader.OLSBatchIndexerCreator.createSchemaIndexIfNotExists(OLSBatchIndexerCreator.java:84)
    at uk.ac.ebi.spot.ols.loader.OLSBatchIndexerCreator.createSchemaIndexes(OLSBatchIndexerCreator.java:75)
    at uk.ac.ebi.spot.ols.loader.BatchNeo4JIndexer.createIndex(BatchNeo4JIndexer.java:447)
    at uk.ac.ebi.spot.ols.loader.BatchNeo4JIndexer.createIndex(BatchNeo4JIndexer.java:592)
    at uk.ac.ebi.spot.ols.service.MongoOntologyIndexingService.indexOntologyDocument(MongoOntologyIndexingService.java:106)
    at uk.ac.ebi.spot.ols.LoadingApplication.run(LoadingApplication.java:180)
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:800)
    at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:784)
    at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:771)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174)
    at uk.ac.ebi.spot.ols.LoadingApplication.main(LoadingApplication.java:303)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:54)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:104)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:61)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
matentzn commented 4 years ago

Yeah I notice the same. Bloats the output a lot! This is simply an overly zealous debug output I believe.

https://github.com/EBISPOT/OLS/blob/8ec6a910a65cf2115d57e46dd440279154d218d5/ols-neo4j/src/main/java/uk/ac/ebi/spot/ols/loader/OLSBatchIndexerCreator.java#L89

My opinion is that the error message should be reduced to a warning (or hidden completely) and the stack trace print removed.

johannes-darms commented 4 years ago

I agree. The import continues just fine and the message/especially the stacktrace irritates a bit.

henrietteharmse commented 4 years ago

We can remove the error log since this is really for debugging purposes. You can switch off the debug stacktrace by removing

`

    <appender-ref ref="FILE" />
</logger>`

from ols-apps/ols-indexer/src/resources/logback.

matentzn commented 4 years ago

Yeah I think @johannes-darms and I were more thinking about a debugging scenario; so we want debug outputs, just not that particular one; do you think it is an actual error @henrietteharmse ? If so shouldn’t there be a way to fix it?