【问题标题】:Upgrading gremlin breaks connection升级 gremlin 断开连接
【发布时间】:2023-03-09 12:32:01
【问题描述】:

使用gremlin javascript 版本3.2.10,以下函数正确连接到我的海王星集群:

export const initGremlinClient = () => {
  try {
    const dc = new DriverRemoteConnection(
      `ws://${process.env.NEPTUNE_ENDPOINT_URI}:${
        process.env.NEPTUNE_ENDPOINT_PORT
      }/gremlin`
    );
    const graph = new Graph();
    return {
      g: graph.traversal().withRemote(dc),
      closeGremlinConnection: () => dc.close()
    };
  } catch (error) {
    console.log("[GREMLIN INIT ERROR]", error);
    throw new Error(error);
  }
};

如果我升级到版本^3.4.0,它会抛出以下错误:

“错误:TypeError:无法读取未定义的属性'reader'”

这是在 NodeJS 8.10 上的 Lambda 函数中运行的。文档似乎没有指出此版本中的任何新内容,AWS 也没有指定与 Neptune 的兼容性问题。是不是我配置错了?

编辑:添加堆栈跟踪

{
  "errorMessage": "Cannot read property 'reader' of undefined",
  "errorType": "TypeError",
  "stackTrace": [
    "new Connection (/var/task/gremlinTest/node_modules/gremlin/lib/driver/connection.js:77:28)",
    "new Client (/var/task/gremlinTest/node_modules/gremlin/lib/driver/client.js:46:24)",
    "new DriverRemoteConnection (/var/task/gremlinTest/node_modules/gremlin/lib/driver/driver-remote-connection.js:53:20)",
    "exports.handler (/var/task/gremlinTest/index.js:6:14)"
  ]
}

【问题讨论】:

  • 你能分享一下原始错误的堆栈跟踪吗?
  • @jorgebg 我已经添加了。
  • 如果我将一个空对象作为第二个参数传递给new DriverRemoteConnection,它会起作用。
  • 是的!谢谢,您应该将其发布为答案。

标签: gremlin amazon-neptune


【解决方案1】:

最近为此接受了一个补丁,根据issue report,应该很快就会登陆 3.3.6 和 3.4.1。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-03-18
    • 1970-01-01
    • 2020-10-18
    • 1970-01-01
    • 2022-06-22
    • 2020-01-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多