You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hugegraph.apache.org by "VGalaxies (via GitHub)" <gi...@apache.org> on 2023/06/06 12:13:24 UTC

[GitHub] [incubator-hugegraph] VGalaxies opened a new issue, #2228: [Bug] Error occurred when starting Gremlin-Console (stand-alone offline mode) with sample script

VGalaxies opened a new issue, #2228:
URL: https://github.com/apache/incubator-hugegraph/issues/2228

   ### Bug Type (问题类型)
   
   server status (启动/运行异常)
   
   ### Before submit
   
   - [X] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 [FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)
   
   ### Environment (环境信息)
   
   - Server Version: 1.0.0 (Apache Release Version)
   - OS: macOS 12.3.1 x86_64
   
   ### Expected & Actual behavior (期望与实际表现)
   
   This issue is similar to previous issues:
   
   - https://github.com/apache/incubator-hugegraph/issues/953
   - https://github.com/apache/incubator-hugegraph/issues/978
   
   I following the [guide](https://hugegraph.apache.org/docs/clients/gremlin-console/#1-stand-alone-offline-mode) to starting Gremlin-Console with the [sample groovy script](https://github.com/apache/hugegraph/blob/bcf2a395cf8949c39a127facb404f75cf3842475/hugegraph-dist/src/assembly/static/scripts/example.groovy), but it seems like the script was not executed at all, since the print statements in the groovy script did not take effect, and the defined variables could not be accessed either.
   
   <img width="1026" alt="image" src="https://github.com/apache/incubator-hugegraph/assets/79143929/35f20081-a0fe-45a0-a1c7-a7edaab32dfe">
   
   So I examined the shell script [gremlin-console.sh](https://github.com/apache/hugegraph/blob/bcf2a395cf8949c39a127facb404f75cf3842475/hugegraph-dist/src/assembly/static/bin/gremlin-console.sh) and found that the command to start the Gremlin-Console is:
   
   ```bash
   exec /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin/java -server -Dtinkerpop.ext=xxx/hugegraph/apache-hugegraph-incubating-1.0.0/ext -Dlog4j.configuration=conf/log4j-console.properties -Dgremlin.log4j.level=WARN -javaagent:xxx/hugegraph/apache-hugegraph-incubating-1.0.0/lib/jamm-0.3.0.jar org.apache.tinkerpop.gremlin.console.Console scripts/example.groovy
   ```
   
   Since the version of tinkerpop declared in the project is 3.5.1, I examined the corresponding [source code](https://github.com/apache/tinkerpop/blob/3.5.1/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy#L483):
   
   ```groovy
   public static void main(final String[] args) {
   	......
   
   	final CliBuilder cli = new CliBuilder()
   	cli.stopAtNonOption = false
   	cli.name = "gremlin.sh"
   
   	......
   
   	cli.i(type: List, longOpt: 'interactive', arity: "1..*", argName: "SCRIPT ARG1 ARG2 ...", "Execute the specified script and leave the console open on completion")
   	cli.e(type: List, longOpt: 'execute', argName: "SCRIPT ARG1 ARG2 ...", "Execute the specified script (SCRIPT ARG1 ARG2 ...) and close the console on completion")
   	cli.C(type: Boolean, longOpt: 'color', "Disable use of ANSI colors")
   
   	......
   ```
   
   I found that `Execute the specified script and leave the console open on completion` is match with the running mode here, **but the `-i` option is missing in the shell script**.
   
   So I added it, at the same time, I also fixed some obvious issues in the groovy script:
   
   <img width="1269" alt="image" src="https://github.com/apache/incubator-hugegraph/assets/79143929/3aa5f03a-bb70-4191-9ec1-39f80e725950">
   
   After that, I run `./bin/gremlin-console.sh scripts/example.groovy` again, and it showed:
   
   ```
            \,,,/
            (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 '368239c8' at 'null' in 'null'
   main dict load finished, time elapsed 757 ms
   model load finished, time elapsed 49 ms.
   Error in scripts/example.groovy at [39: 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
   ==>org.apache.hugegraph.schema.SchemaManager@1ad1be5d
   ```
   
   It can be found that the groovy script has been successfully executed, but there was a problem when creating the `indexLabel`, why?
   
   By the way, At the beginning, I configured `org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin` as `example.groovy` in **`gremlin-server.yaml`**. After modifying the above issues in the groovy script, I was able to successfully execute the Groovy script when **running HugeGraphServer using IDEA**.
   
   <img width="1864" alt="Screen Shot 2023-06-06 at 20 10 18" src="https://github.com/apache/incubator-hugegraph/assets/79143929/02cf0436-58b9-48ce-9117-7a9a2dfd34a0">
   
   
   
    
   
   
   ### Vertex/Edge example (问题点 / 边数据举例)
   
   _No response_
   
   ### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
   
   _No response_


-- 
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: dev-unsubscribe@hugegraph.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-hugegraph] VGalaxies commented on issue #2228: [Bug] Error occurred when starting Gremlin-Console (stand-alone offline mode) with sample script

Posted by "VGalaxies (via GitHub)" <gi...@apache.org>.
VGalaxies commented on issue #2228:
URL: https://github.com/apache/incubator-hugegraph/issues/2228#issuecomment-1581818151

   I guess some components of the service were not initialized, so I referred to the [initialization method](https://github.com/apache/hugegraph/blob/bcf2a395cf8949c39a127facb404f75cf3842475/hugegraph-test/src/main/java/org/apache/hugegraph/tinkerpop/TestGraph.java#L79) used in `TestGraph` class and added it in the groovy script:
   
   ```groovy
   conf = "conf/graphs/hugegraph.properties"
   graph = HugeFactory.open(conf)
   graph.initBackend()
   System.out.println(graph.existsVertexLabel("~task"))
   graph.serverStarted(IdGenerator.of("server-tinkerpop"), NodeRole.MASTER) // start server
   ```
   
   Now it seems to be running normally:
   
   ```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 581 ms
   model load finished, time elapsed 45 ms.
   true
   >>>> query all vertices: size=6
   >>>> query all edges: size=6
   gremlin> g
   ==>graphtraversalsource[standardhugegraph[hugegraph], standard]
   gremlin> 
   ```
   
   I am analyzing how it works...


-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


[GitHub] [incubator-hugegraph] javeme commented on issue #2228: [Bug] Error occurred when starting Gremlin-Console (stand-alone offline mode) with sample script

Posted by "javeme (via GitHub)" <gi...@apache.org>.
javeme commented on issue #2228:
URL: https://github.com/apache/incubator-hugegraph/issues/2228#issuecomment-1584475938

   @VGalaxies For the `serverStarted(...)` call, its goal is to set the scheduler information, which is also the prerequisite for the scheduler to run `scheduleTasks()`.


-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


[GitHub] [incubator-hugegraph] VGalaxies commented on issue #2228: [Bug] Error occurred when starting Gremlin-Console (stand-alone offline mode) with sample script

Posted by "VGalaxies (via GitHub)" <gi...@apache.org>.
VGalaxies commented on issue #2228:
URL: https://github.com/apache/incubator-hugegraph/issues/2228#issuecomment-1584447481

   > I guess some components of the service were not initialized, so I referred to the [initialization method](https://github.com/apache/hugegraph/blob/bcf2a395cf8949c39a127facb404f75cf3842475/hugegraph-test/src/main/java/org/apache/hugegraph/tinkerpop/TestGraph.java#L79) used in `TestGraph` class and added it in the groovy script:
   > 
   > ```groovy
   > conf = "conf/graphs/hugegraph.properties"
   > graph = HugeFactory.open(conf)
   > graph.initBackend()
   > System.out.println(graph.existsVertexLabel("~task"))
   > graph.serverStarted(IdGenerator.of("server-tinkerpop"), NodeRole.MASTER) // start server
   > ```
   > 
   > Now it seems to be running normally:
   > 
   > ```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 581 ms
   > model load finished, time elapsed 45 ms.
   > true
   > >>>> query all vertices: size=6
   > >>>> query all edges: size=6
   > gremlin> g
   > ==>graphtraversalsource[standardhugegraph[hugegraph], standard]
   > gremlin> 
   > ```
   > 
   > I am analyzing how it works...
   
   By analyzing the corresponding source code and logs, I (maybe) have figured out the cause of the problem.
   
   The **first** question is **why the groovy script can be executed successfully after adding `serverStarted`**. The key to this problem is that the **rebuild index** operation is actually encapsulated as a `HugeTask`, and `HugeTask` is executed **asynchronously**. Below are the relevant logs of a `HugeTask` execution with `serverStarted` added in the groovy script:
   
   ```
   2023-06-09 16:39:49 [main] [DEBUG] o.a.h.t.StandardTaskScheduler [org.apache.hugegraph.task.StandardTaskScheduler.save(StandardTaskScheduler.java:448)] - Saving task: HugeTask(1){task_name=INDEX_LABEL:1:personByCity, task_progress=0, task_create=Fri Jun 09 16:39:49 CST 2023, task_status=scheduling, task_retries=0, id=1, task_type=rebuild_index, task_callable=org.apache.hugegraph.job.schema.IndexLabelRebuildJob}
   2023-06-09 16:39:49 [task-scheduler-1] [DEBUG] o.a.h.t.StandardTaskScheduler [org.apache.hugegraph.task.StandardTaskScheduler.save(StandardTaskScheduler.java:448)] - Saving task: HugeTask(1){task_name=INDEX_LABEL:1:personByCity, task_progress=0, task_create=Fri Jun 09 16:39:49 CST 2023, task_status=scheduled, task_retries=0, id=1, task_type=rebuild_index, task_callable=org.apache.hugegraph.job.schema.IndexLabelRebuildJob, task_server=server-tinkerpop}
   2023-06-09 16:39:49 [task-scheduler-1] [DEBUG] o.a.h.t.StandardTaskScheduler [org.apache.hugegraph.task.StandardTaskScheduler.save(StandardTaskScheduler.java:448)] - Saving task: HugeTask(1){task_name=INDEX_LABEL:1:personByCity, task_progress=0, task_create=Fri Jun 09 16:39:49 CST 2023, task_status=queued, task_retries=0, id=1, task_type=rebuild_index, task_callable=org.apache.hugegraph.job.schema.IndexLabelRebuildJob, task_server=server-tinkerpop}
   2023-06-09 16:39:49 [task-worker-1] [DEBUG] o.a.h.t.StandardTaskScheduler [org.apache.hugegraph.task.StandardTaskScheduler.save(StandardTaskScheduler.java:448)] - Saving task: HugeTask(1){task_name=INDEX_LABEL:1:personByCity, task_progress=0, task_create=Fri Jun 09 16:39:49 CST 2023, task_status=running, task_update=Fri Jun 09 16:39:49 CST 2023, task_retries=0, id=1, task_type=rebuild_index, task_callable=org.apache.hugegraph.job.schema.IndexLabelRebuildJob, task_server=server-tinkerpop}
   2023-06-09 16:39:49 [task-worker-1] [DEBUG] o.a.h.t.StandardTaskScheduler [org.apache.hugegraph.task.StandardTaskScheduler.save(StandardTaskScheduler.java:448)] - Saving task: HugeTask(1){task_name=INDEX_LABEL:1:personByCity, task_progress=0, task_create=Fri Jun 09 16:39:49 CST 2023, task_status=success, task_update=Fri Jun 09 16:39:49 CST 2023, task_result=null, task_retries=0, id=1, task_type=rebuild_index, task_callable=org.apache.hugegraph.job.schema.IndexLabelRebuildJob, task_server=server-tinkerpop}
   2023-06-09 16:39:49 [task-worker-1] [DEBUG] o.a.h.t.HugeTask [org.apache.hugegraph.task.HugeTask.run(HugeTask.java:293)] - Task is finished HugeTask(1){task_name=INDEX_LABEL:1:personByCity, task_progress=0, task_create=Fri Jun 09 16:39:49 CST 2023, task_status=success, task_update=Fri Jun 09 16:39:49 CST 2023, task_result=null, task_retries=0, id=1, task_type=rebuild_index, task_callable=org.apache.hugegraph.job.schema.IndexLabelRebuildJob, task_server=server-tinkerpop}
   ```
   
   It can be found that the state transition of the `HugeTask` is:
   
   ```
   scheduling -> scheduled -> queued -> running -> success
   ```
   
   **Without** adding `serverStarted`, I only observed the **first** log mentioned above, which indicates that the `HugeTask` corresponding to rebuild index was not successfully scheduled.
   
   By tracing the relevant code
   
   ```
   hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/SchemaTransaction.java#L675
   hugegraph-core/src/main/java/org/apache/hugegraph/job/JobBuilder.java#L91
   hugegraph-core/src/main/java/org/apache/hugegraph/task/StandardTaskScheduler.java#L220
   hugegraph-core/src/main/java/org/apache/hugegraph/task/TaskManager.java#L256
   hugegraph-core/src/main/java/org/apache/hugegraph/task/TaskManager.java#L297
   hugegraph-core/src/main/java/org/apache/hugegraph/task/TaskManager.java#L326
   ```
   
   I noticed this function:
   
   ```java
   private void scheduleOrExecuteJobForGraph(StandardTaskScheduler scheduler) {
       E.checkNotNull(scheduler, "scheduler");
   
       ServerInfoManager serverManager = scheduler.serverManager();
       String graph = scheduler.graphName();
   
       LockUtil.lock(graph, LockUtil.GRAPH_LOCK);
       try {
           /*
            * Skip if:
            * graph is closed (iterate schedulers before graph is closing)
            *  or
            * graph is not initialized(maybe truncated or cleared).
            *
            * If graph is closing by other thread, current thread get
            * serverManager and try lock graph, at the same time other
            * thread deleted the lock-group, current thread would get
            * exception 'LockGroup xx does not exists'.
            * If graph is closed, don't call serverManager.initialized()
            * due to it will reopen graph tx.
            */
           if (!serverManager.graphReady()) { // NOTE HERE
               return;
           }
   
           // Update server heartbeat
           serverManager.heartbeat();
   
           /*
            * Master schedule tasks to suitable servers.
            * Worker maybe become Master, so Master also need perform tasks assigned by
            * previous Master when enableRoleElected is true.
            * However, the master only needs to take the assignment,
            * because the master stays the same when enableRoleElected is false.
            * There is no suitable server when these tasks are created
            */
           if (serverManager.master()) {
               scheduler.scheduleTasks();
               if (!this.enableRoleElected && !serverManager.onlySingleNode()) {
                   return;
               }
           }
   
           // Schedule queued tasks scheduled to current server
           scheduler.executeTasksOnWorker(serverManager.selfServerId());
   
           // Cancel tasks scheduled to current server
           scheduler.cancelTasksOnWorker(serverManager.selfServerId());
       } finally {
           LockUtil.unlock(graph, LockUtil.GRAPH_LOCK);
       }
   }
   ```
   
   I think `serverManager.graphReady()` here is `false`, because the `started` field is only [set](https://github.com/apache/hugegraph/blob/bcf2a395cf8949c39a127facb404f75cf3842475/hugegraph-core/src/main/java/org/apache/hugegraph/StandardHugeGraph.java#L291) to true in `serverStarted`.
   
   ```
   protected boolean graphReady() {
       return !this.closed && this.graph.started() && this.graph.initialized();
   }
   ```
   
   That's why it will report an error `Failed to wait index-creating task completed` when waiting for the asynchronous task to complete.
   
   The **second** question is why creating an `indexLabel` directly in the command line seems to be successful (because there is no error reported) when the execution of the groovy script **part fails**. This is because **before** the asynchronous rebuild index, the schema corresponding to the `indexLabel` will be [saved](https://github.com/apache/hugegraph/blob/bcf2a395cf8949c39a127facb404f75cf3842475/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/IndexLabelBuilder.java#L232) first. This indicates that when creating an `indexLabel` in the command line, [this](https://github.com/apache/hugegraph/blob/bcf2a395cf8949c39a127facb404f75cf3842475/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/IndexLabelBuilder.java#L189) branch is actually taken.
   
   ```java
   public SchemaElement.TaskWithSchema createWithTask() {
       HugeType type = HugeType.INDEX_LABEL;
       this.checkSchemaName(this.name);
   
       return this.lockCheckAndCreateSchema(type, this.name, name -> {
           IndexLabel indexLabel = this.indexLabelOrNull(name);
           if (indexLabel != null) {
               if (this.checkExist || !hasSameProperties(indexLabel)) {
                   throw new ExistedException(type, name);
               }
               return new SchemaElement.TaskWithSchema(indexLabel,
                                                       IdGenerator.ZERO); // RETURN HERE
           }
   ```
   
   Although there is no error reported, the rebuild index task is still in the pending scheduling state 😟
   
   


-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


[GitHub] [incubator-hugegraph] liuxiaocs7 commented on issue #2228: [Bug] Error occurred when starting Gremlin-Console (stand-alone offline mode) with sample script

Posted by "liuxiaocs7 (via GitHub)" <gi...@apache.org>.
liuxiaocs7 commented on issue #2228:
URL: https://github.com/apache/incubator-hugegraph/issues/2228#issuecomment-1583844260

   > I guess some components of the service were not initialized, so I referred to the [initialization method](https://github.com/apache/hugegraph/blob/bcf2a395cf8949c39a127facb404f75cf3842475/hugegraph-test/src/main/java/org/apache/hugegraph/tinkerpop/TestGraph.java#L79) used in `TestGraph` class and added it in the groovy script:
   > 
   > ```groovy
   > conf = "conf/graphs/hugegraph.properties"
   > graph = HugeFactory.open(conf)
   > graph.initBackend()
   > System.out.println(graph.existsVertexLabel("~task"))
   > graph.serverStarted(IdGenerator.of("server-tinkerpop"), NodeRole.MASTER) // start server
   > ```
   > 
   > Now it seems to be running normally:
   > 
   > ```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 581 ms
   > model load finished, time elapsed 45 ms.
   > true
   > >>>> query all vertices: size=6
   > >>>> query all edges: size=6
   > gremlin> g
   > ==>graphtraversalsource[standardhugegraph[hugegraph], standard]
   > gremlin> 
   > ```
   > 
   > I am analyzing how it works...
   
   It seems to work fine after this modification.
   
   ```bash
   >>>> query all vertices: size=6
   >>>> query all edges: size=6
   gremlin> g.V()
   ==>v[2:lop]
   ==>v[1:josh]
   ==>v[1:marko]
   ==>v[1:peter]
   ==>v[1:vadas]
   ==>v[2:ripple]
   gremlin> g.E()
   ==>e[S1:josh>2>>S2:lop][1:josh-created->2:lop]
   ==>e[S1:josh>2>>S2:ripple][1:josh-created->2:ripple]
   ==>e[S1:marko>1>>S1:josh][1:marko-knows->1:josh]
   ==>e[S1:marko>1>>S1:vadas][1:marko-knows->1:vadas]
   ==>e[S1:marko>2>>S2:lop][1:marko-created->2:lop]
   ==>e[S1:peter>2>>S2:lop][1:peter-created->2:lop]
   ```


-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


[GitHub] [incubator-hugegraph] VGalaxies commented on issue #2228: [Bug] Error occurred when starting Gremlin-Console (stand-alone offline mode) with sample script

Posted by "VGalaxies (via GitHub)" <gi...@apache.org>.
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


[GitHub] [incubator-hugegraph] liuxiaocs7 commented on issue #2228: [Bug] Error occurred when starting Gremlin-Console (stand-alone offline mode) with sample script

Posted by "liuxiaocs7 (via GitHub)" <gi...@apache.org>.
liuxiaocs7 commented on issue #2228:
URL: https://github.com/apache/incubator-hugegraph/issues/2228#issuecomment-1579898614

   Same problem, but strangely direct interactive input seems to work
   
   ```shell
   ╭─ ~/Development/GitProject/apache-hugegraph-incubating-1.0.0 ······································ ✔  5s  user@dev  12:53:22 ─╮
   ╰─ ./bin/gremlin-console.sh scripts/example.groovy                                                                             ─╯
   
            \,,,/
            (o o)
   -----oOOo-(3)-oOOo-----
   plugin activated: HugeGraph
   plugin activated: tinkerpop.server
   plugin activated: tinkerpop.utilities
   plugin activated: tinkerpop.tinkergraph
   main dict load finished, time elapsed 599 ms
   model load finished, time elapsed 37 ms.
   Error in scripts/example.groovy at [40: schema.indexLabel("personByAge").onV("person").by("age").range().ifNotExist().create();] - Failed to update/query TaskStore: java.util.concurrent.ExecutionException: org.apache.hugegraph.HugeException: Schema is missing for task(1) 'INDEX_LABEL:1:personByAge'
   gremlin> graph.existsVertexLabel("person")
   ==>true
   gremlin> graph.existsVertexLabel("software")
   ==>true
   gremlin> schema.indexLabel("personByAge").onV("person").by("age").range().ifNotExist().create()
   ==>personByAge(id=1)
   gremlin>
   ```
   
   `Schema is missing for task` seems like VertexLabel doesn't exist, but actually exists
   
   similar issues: #377 #1167


-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


[GitHub] [incubator-hugegraph] javeme commented on issue #2228: [Bug] Error occurred when starting Gremlin-Console (stand-alone offline mode) with sample script

Posted by "javeme (via GitHub)" <gi...@apache.org>.
javeme commented on issue #2228:
URL: https://github.com/apache/incubator-hugegraph/issues/2228#issuecomment-1581914170

   For the error `No such property g`, please try to define the 'g' variable https://github.com/apache/incubator-hugegraph/issues/953#issuecomment-809331674:
   
   ```java
   gremlin> graph = HugeFactory.open("conf/hugegraph.properties")
   ==>standardhugegraph[hugegraph]
   
   gremlin> g=graph.traversal()
   ==>graphtraversalsource[standardhugegraph[hugegraph], standard]
   
   gremlin> g.V()
   ```
   


-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


[GitHub] [incubator-hugegraph] VGalaxies commented on issue #2228: [Bug] Error occurred when starting Gremlin-Console (stand-alone offline mode) with sample script

Posted by "VGalaxies (via GitHub)" <gi...@apache.org>.
VGalaxies commented on issue #2228:
URL: https://github.com/apache/incubator-hugegraph/issues/2228#issuecomment-1578652192

   @javeme PTAL, thanks.


-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


[GitHub] [incubator-hugegraph] imbajin closed issue #2228: [Bug] Error occurred when starting Gremlin-Console (stand-alone offline mode) with sample script

Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin closed issue #2228: [Bug] Error occurred when starting Gremlin-Console (stand-alone offline mode) with sample script
URL: https://github.com/apache/incubator-hugegraph/issues/2228


-- 
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: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org