Upgrading gremlin breaks connection

会有一股神秘感。 提交于 2019-12-11 04:10:07

问题


With gremlin javascript version 3.2.10 the following function connects to my Neptune cluster correctly:

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);
  }
};

If I upgrade to version ^3.4.0 it throws the following error:

"Error: TypeError: Cannot read property 'reader' of undefined"

This is running in a Lambda function on NodeJS 8.10. The docs don't seem to indicate anything new in this version, nor does AWS specify a compatibility issue with Neptune. Do I have this misconfigured?

EDIT: Adding stack trace

{
  "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)"
  ]
}

回答1:


A patch was accepted for this recently and should land in 3.3.6 and 3.4.1 soon according to this issue report.



来源:https://stackoverflow.com/questions/54220750/upgrading-gremlin-breaks-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!