Skip to content

Unable to create Graph instance with specified port #43

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

Closed
abawany opened this issue Feb 26, 2020 · 1 comment · Fixed by #44
Closed

Unable to create Graph instance with specified port #43

abawany opened this issue Feb 26, 2020 · 1 comment · Fixed by #44
Assignees
Labels
bug Something isn't working

Comments

@abawany
Copy link

abawany commented Feb 26, 2020

I am running my RedisGraph on a port other than 6379. I confirmed via redis-cli that the instance is operating as expected. When I try to use redisgraph.js as follows to create a client with a specified port, it failed as follows:

> const RedisGraph = require('redisgraph.js').Graph;
> new RedisGraph("g1", "localhost", "7070");
Thrown:
TypeError: Cannot create property 'path' on string '7070'
    at createClient (/private/tmp/node_modules/redisgraph.js/node_modules/redis/lib/createClient.js:63:26)
    at Object.exports.createClient (/private/tmp/node_modules/redisgraph.js/node_modules/redis/index.js:1089:41)
    at new Graph (/private/tmp/node_modules/redisgraph.js/src/graph.js:32:26)

Passing an instantiated RedisClient instance with the correct port also fails as follows:

> const rds = require('redis');
> const RedisGraph = require('redisgraph.js').Graph;
> let rc = rds.createClient({host:'localhost', port:7070});
> rc instanceof rds.RedisClient
true
> new RedisGraph("g1", rc);
Thrown:
TypeError: this.stream.setTimeout is not a function
    at RedisClient.create_stream (/private/tmp/node_modules/redisgraph.js/node_modules/redis/index.js:256:21)
    at new RedisClient (/private/tmp/node_modules/redisgraph.js/node_modules/redis/index.js:159:10)
    at Object.exports.createClient (/private/tmp/node_modules/redisgraph.js/node_modules/redis/index.js:1089:12)
    at new Graph (/private/tmp/node_modules/redisgraph.js/src/graph.js:32:26)

Edit: the following appeared to work fine:

> const RedisGraph = require('redisgraph.js').Graph;
> new RedisGraph("g2", {host:"localhost", port:7070});
Graph {
  _graphId: 'g2',
  _labels: [],
  _relationshipTypes: [],
  _properties: [],
  _labelsPromise: undefined,
  _propertyPromise: undefined,
  _relationshipPromise: undefined,
  _sendCommand: [Function: bound ]
}

Did I misread the documentation at https://redisgraph.github.io/redisgraph.js/Graph.html, which appears to specify each parameter as a function argument?

@DvirDukhan
Copy link
Contributor

@abawany
Thanks for reporting, I will issue a fix soon

@DvirDukhan DvirDukhan self-assigned this Feb 26, 2020
@DvirDukhan DvirDukhan added the bug Something isn't working label Feb 26, 2020
@gkorland gkorland linked a pull request Mar 4, 2020 that will close this issue
DvirDukhan added a commit that referenced this issue Mar 9, 2020
* close #43. Changed graph creation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants