VGalaxies commented on issue #2228:
URL: 
https://github.com/apache/incubator-hugegraph/issues/2228#issuecomment-1580213669

   @liuxiaocs7
   Direct interactive input works for me too:
   
   ```java
            \,,,/
            (o o)
   -----oOOo-(3)-oOOo-----
   plugin activated: HugeGraph
   plugin activated: tinkerpop.server
   plugin activated: tinkerpop.utilities
   plugin activated: tinkerpop.tinkergraph
   ERROR StatusLogger Reconfiguration failed: No configuration found for 
'18b4aac2' at 'null' in 'null'
   main dict load finished, time elapsed 593 ms
   model load finished, time elapsed 50 ms.
   Error in scripts/example.groovy at [42: 
schema.indexLabel("personByCity").onV("person").by("city").secondary().ifNotExist().create()]
 - Failed to update/query TaskStore: java.util.concurrent.ExecutionException: 
org.apache.hugegraph.HugeException: Schema is missing for task(1) 
'INDEX_LABEL:1:personByCity'
   gremlin> 
schema.indexLabel("personByCity").onV("person").by("city").secondary().ifNotExist().create()
   ==>personByCity(id=1)
   ```
   
   I analyzed the reason for `Schema is missing for task` and found that it was 
actually because a VertexLabel named **`~task`** does not exist. When I running 
HugeGraphServer using IDEA, VertexLabel `~task` was created by [this 
function](https://github.com/apache/hugegraph/blob/bcf2a395cf8949c39a127facb404f75cf3842475/hugegraph-core/src/main/java/org/apache/hugegraph/task/StandardTaskScheduler.java#L776).
   
   So I traced the call chain and added the following function call in the 
groovy script:
   
   ```groovy
   conf = "conf/graphs/hugegraph.properties"
   graph = HugeFactory.open(conf)
   graph.initBackend() // to create VertexLabel `~task`
   System.out.println(graph.existsVertexLabel("~task"))
   ```
   
   After that, I run `./bin/gremlin-console.sh scripts/example.groovy` again, 
and it showed:
   
   ```java
            \,,,/
            (o o)
   -----oOOo-(3)-oOOo-----
   plugin activated: HugeGraph
   plugin activated: tinkerpop.server
   plugin activated: tinkerpop.utilities
   plugin activated: tinkerpop.tinkergraph
   ERROR StatusLogger Reconfiguration failed: No configuration found for 
'18b4aac2' at 'null' in 'null'
   main dict load finished, time elapsed 625 ms
   model load finished, time elapsed 40 ms.
   true
   Error in scripts/example.groovy at [42: 
schema.indexLabel("personByCity").onV("person").by("city").secondary().ifNotExist().create()]
 - Failed to wait for task '1' completed
   gremlin> 
   ```
   
   Something went wrong when [async rebuild 
index](https://github.com/apache/hugegraph/blob/bcf2a395cf8949c39a127facb404f75cf3842475/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/IndexLabelBuilder.java#L235).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to