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

Made message when there is a networking (proxy?) issue #183

Open
jrgleason opened this issue Nov 13, 2015 · 10 comments
Open

Made message when there is a networking (proxy?) issue #183

jrgleason opened this issue Nov 13, 2015 · 10 comments
Assignees
Labels
Milestone

Comments

@jrgleason
Copy link

I am working with a local Neo4J and I have an instance inside our local network so I didn't have to use our corporate proxy. Now I need to call external services and use a proxy.

When I try to configure using the HTTP_PROXY and HTTPS_PROXY vars Neo4J starts failing with...

C:\Users\a\dev\code\insight-plus\node_modules\neo4j\lib-new\GraphDatabase.js:268
        for (i = _i = 0, _len = results.length; _i < _len; i = ++_i) {
                                       ^
TypeError: Cannot read property 'length' of undefined
        at C:\Users\a\dev\code\insight-plus\node_modules\neo4j\lib-new\GraphDatabase.js:268:44

Two things

1.) How do I fix this?
2.) Is there a way we can do a null check on results and output a more meaningful message?

@aseemk
Copy link
Member

aseemk commented Nov 13, 2015

Interesting. It's unexpected (per the Neo4j REST API) that results would ever be null; it's always returned AFAIK, even if empty. But maybe there's a case now or that I missed where that's not true.

Would you mind doing me a favor, and in node_modules\neo4j\lib-new\GraphDatabase.js, just before that line 268, could you console.log(resp.body) and tell me what gets outputted?

Thanks!

@aseemk aseemk added this to the v2 redesign milestone Nov 13, 2015
@aseemk aseemk self-assigned this Nov 13, 2015
@jrgleason
Copy link
Author

It could also be the message getting caught somewhere in our proxy and the response never getting received. I am still working to diagnose but it seems to fix itself if I remove my proxy (Neo server in on the intranet)

@aseemk
Copy link
Member

aseemk commented Nov 18, 2015

Thanks for the update. Good luck diagnosing. =)

In the meantime, still feel free to add the console.log I mentioned above. It'll be useful.

@jrgleason
Copy link
Author

I also noticed this, so my theory is that it is related to the general proxy I set up with HTTP_PROXY. I tried creating my GraphDatabase like this...

db = new neo4j.GraphDatabase({
  url: conf.connectionString,
  proxy: ""
})

But now when I try to run it I get.....

{ [Error: tunneling socket could not be established, cause=Parse Error] code: 'ECONNRESET' }
Unhandled rejection neo4j.ClientError: [Neo.ClientError.Statement.ParameterMissing] Expected a parameter named username
   at Function.Error.Error._fromObject (C:\Users\me\dev\code\insight-plus\node_modules\neo4j\lib-new\errors.js:70:14)

@jrgleason
Copy link
Author

I will also try to get you that console output tomorrow.

@jrgleason
Copy link
Author

neoerror

So it is just undefined (looks funny because the CoffeeScript stuff), I also noticed this error when I stopped there...

Current stackstace: Error
  at ClientRequest.http.ClientRequest.onSocket   (C:\Users\me\AppData\Roaming\nvm\v0.12.4\node_modules\node-inspector\lib\Injections\NetworkAgent.js:391:36)
  at C:\Users\me\dev\code\insight-plus\node_modules\request\node_modules\tunnel-agent\index.js:99:21
  at C:\Users\me\dev\code\insight-plus\node_modules\request\node_modules\tunnel-agent\index.js:205:5
  at ClientRequest.onConnect (C:\Users\me\dev\code\insight-plus\node_modules\request\node_modules\tunnel-agent\index.js:160:7)

So it does look like the request is failing like I would expect and node-neo just can't handle that.

@alph486
Copy link

alph486 commented Dec 29, 2015

@aseemk I'm experiencing this too further down in the stacktrace of EntityNotFound Relationship with id x ... Is this considered a bug, or a red herring?

@Carter-Wayblazer
Copy link

I left @aseemk a message in the #neo4j-javascript slack channel but for completeness, I added this line console.log(typeof resp.body, resp.body); to right above line 268 and got the attached file's response.

Console.log.txt

@alph486
Copy link

alph486 commented Dec 30, 2015

Also FWIW - we believe that the error I previously mentioned (EntityNotFound...) is likely not related to the issue @Carter-Wayblazer is posting; we've seen it happen without that exception as well.

@Carter-Wayblazer
Copy link

We (@alph486 and I) were running Neo 2.2.7 in production but just moved to the latest 2.3.1 and have not seen this error since then when we typically saw it once or twice a day. My speculation is it has been fixed by Neo since.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants