Skip to content
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

[Bug] ./bin/gremlin-console.sh -- -i scripts/example.groovy 时一直报错 #2472

Closed
1 task done
solower opened this issue Mar 5, 2024 · 5 comments · Fixed by #2473
Closed
1 task done

[Bug] ./bin/gremlin-console.sh -- -i scripts/example.groovy 时一直报错 #2472

solower opened this issue Mar 5, 2024 · 5 comments · Fixed by #2473
Assignees
Labels
bug Something isn't working gremlin TinkerPop gremlin

Comments

@solower
Copy link

solower commented Mar 5, 2024

Bug Type (问题类型)

other exception / error (其他异常报错)

Before submit

  • 我已经确认现有的 IssuesFAQ 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)

Environment (环境信息)

  • Server Version: 1.2.0 (Apache Release Version)
  • Backend: Mysql x nodes, HDD or SSD
  • OS: Linux n37-054-211 4.19.117.bsk.12-amd64 hugeclient连接报错 Failed to do request #4.19.117.bsk.12 SMP Debian 4.19.117.bsk.12 Thu Mar 17 16:41:16 x86_64 GNU/Linux
  • Data Size: xx vertices, xx edges

Expected & Actual behavior (期望与实际表现)

预期正常导入测试数据

实际报错
Error in scripts/example.groovy at [29: graph.serverStarted(IdGenerator.of("server-tinkerpop"), NodeRole.MASTER)] - No signature of method: org.apache.hugegraph.StandardHugeGraph.serverStarted() is applicable for argument types: (org.apache.hugegraph.backend.id.IdGenerator$StringId, org.apache.hugegraph.type.define.NodeRole) values: [server-tinkerpop, MASTER]
Possible solutions: serverStarted(org.apache.hugegraph.masterelection.GlobalMasterInfo)

Vertex/Edge example (问题点 / 边数据举例)

No response

Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

No response

@solower solower added the bug Something isn't working label Mar 5, 2024
Copy link

dosubot bot commented Mar 5, 2024

嗨,@solower!很高兴再次看到你的问题。希望你一切都好!

您遇到的错误 "No signature of method: org.apache.hugegraph.StandardHugeGraph.serverStarted() is applicable for argument types: (org.apache.hugegraph.backend.id.IdGenerator$StringId, org.apache.hugegraph.type.define.NodeRole) values: [server-tinkerpop, MASTER]" 表明 graph 对象上调用的 serverStarted 方法不接受您传递的参数。具体来说,方法签名与提供的参数 (IdGenerator.of("server-tinkerpop"), NodeRole.MASTER) 不匹配。

这可能是由以下几个原因导致的:

  1. 方法签名更改StandardHugeGraph 类中的 serverStarted 方法可能不存在您正在使用的参数。可能的情况是您正在使用的库版本中,方法签名已经更改,或者该方法期望的参数类型或数量不同。

  2. 库版本:如果代码片段在库的早期版本中可以正常工作,那么可能是您已经更新到了一个新版本,其中 serverStarted 方法已被修改、弃用或删除。库作者有时会更改 API,这可能导致此类问题。

  3. 使用不正确:也有可能 serverStarted 方法并不是按照脚本中的方式来使用的。这可能是对方法用途或参数的误解。

要解决此问题,您应该:

  • 查看文档:查找您正在使用的库版本的 StandardHugeGraph 类的文档。验证 serverStarted 方法是否存在以及其正确的签名是什么。
  • 查看库更改:如果您最近更新了库,查看更改日志或发布说明中是否有对 serverStarted 方法的重大更改或更新。
  • 寻找示例或支持:在官方文档、论坛中寻找使用 serverStarted 方法的示例,或者寻求帮助。有时,库作者或社区可以提供更新的示例或澄清。

没有访问您正在使用的库版本的源代码或文档的权限,这些都是您应该遵循的一般步骤,以解决和排查问题。

在 Apache HugeGraph(incubating) Release 1.2.0 中,StandardHugeGraph 类的 serverStarted 方法的正确签名是:

public void serverStarted(GlobalMasterInfo nodeInfo)

这意味着您需要传递一个 GlobalMasterInfo 类型的参数,而不是 (IdGenerator.of("server-tinkerpop"), NodeRole.MASTER)。您可能需要检查您的代码,确保您正在正确地使用 serverStarted 方法。

参考源码:

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot dosubot bot added the gremlin TinkerPop gremlin label Mar 5, 2024
@VGalaxies VGalaxies self-assigned this Mar 5, 2024
@VGalaxies
Copy link
Contributor

嗨,@solower!很高兴再次看到你的问题。希望你一切都好!

您遇到的错误 "No signature of method: org.apache.hugegraph.StandardHugeGraph.serverStarted() is applicable for argument types: (org.apache.hugegraph.backend.id.IdGenerator$StringId, org.apache.hugegraph.type.define.NodeRole) values: [server-tinkerpop, MASTER]" 表明 graph 对象上调用的 serverStarted 方法不接受您传递的参数。具体来说,方法签名与提供的参数 (IdGenerator.of("server-tinkerpop"), NodeRole.MASTER) 不匹配。

这可能是由以下几个原因导致的:

  1. 方法签名更改StandardHugeGraph 类中的 serverStarted 方法可能不存在您正在使用的参数。可能的情况是您正在使用的库版本中,方法签名已经更改,或者该方法期望的参数类型或数量不同。
  2. 库版本:如果代码片段在库的早期版本中可以正常工作,那么可能是您已经更新到了一个新版本,其中 serverStarted 方法已被修改、弃用或删除。库作者有时会更改 API,这可能导致此类问题。
  3. 使用不正确:也有可能 serverStarted 方法并不是按照脚本中的方式来使用的。这可能是对方法用途或参数的误解。

要解决此问题,您应该:

  • 查看文档:查找您正在使用的库版本的 StandardHugeGraph 类的文档。验证 serverStarted 方法是否存在以及其正确的签名是什么。
  • 查看库更改:如果您最近更新了库,查看更改日志或发布说明中是否有对 serverStarted 方法的重大更改或更新。
  • 寻找示例或支持:在官方文档、论坛中寻找使用 serverStarted 方法的示例,或者寻求帮助。有时,库作者或社区可以提供更新的示例或澄清。

没有访问您正在使用的库版本的源代码或文档的权限,这些都是您应该遵循的一般步骤,以解决和排查问题。

在 Apache HugeGraph(incubating) Release 1.2.0 中,StandardHugeGraph 类的 serverStarted 方法的正确签名是:

public void serverStarted(GlobalMasterInfo nodeInfo)

这意味着您需要传递一个 GlobalMasterInfo 类型的参数,而不是 (IdGenerator.of("server-tinkerpop"), NodeRole.MASTER)。您可能需要检查您的代码,确保您正在正确地使用 serverStarted 方法。

参考源码:

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

Good catch, this is because there was no corresponding modification to the call to serverStarted in the example.groovy script in #2370.

Copy link

dosubot bot commented Mar 5, 2024

Yes, your analysis is correct. The error you're encountering is due to the change in the method signature of serverStarted in the StandardHugeGraph class. As per the pull request #2370, the method signature has been changed from public void serverStarted(GlobalMasterInfo nodeInfo) to public void serverStarted().

This means that the serverStarted method no longer accepts any parameters. Therefore, the call to serverStarted in your example.groovy script should be updated to match this new method signature.

You should change the line:

graph.serverStarted(IdGenerator.of("server-tinkerpop"), NodeRole.MASTER)

to:

graph.serverStarted()

This should resolve the issue you're encountering. Please try this solution and let me know if you encounter any further issues.

For future reference, when a method's signature is changed, all calls to that method need to be updated to match the new signature. This includes calls in scripts, tests, and any other places where the method is used.

You can find more information about the serverStarted method and its usage in the StandardHugeGraph.java file and the example.groovy script.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@VGalaxies
Copy link
Contributor

@solower fixed in #2473

@VGalaxies
Copy link
Contributor

Yes, your analysis is correct. The error you're encountering is due to the change in the method signature of serverStarted in the StandardHugeGraph class. As per the pull request #2370, the method signature has been changed from public void serverStarted(GlobalMasterInfo nodeInfo) to public void serverStarted().

This means that the serverStarted method no longer accepts any parameters. Therefore, the call to serverStarted in your example.groovy script should be updated to match this new method signature.

You should change the line:

graph.serverStarted(IdGenerator.of("server-tinkerpop"), NodeRole.MASTER)

to:

graph.serverStarted()

This should resolve the issue you're encountering. Please try this solution and let me know if you encounter any further issues.

For future reference, when a method's signature is changed, all calls to that method need to be updated to match the new signature. This includes calls in scripts, tests, and any other places where the method is used.

You can find more information about the serverStarted method and its usage in the StandardHugeGraph.java file and the example.groovy script.

Sources

About Dosu

In #2370, what are the parameter changes for serverStarted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gremlin TinkerPop gremlin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants