thingdom / node-neo4j

[RETIRED] Neo4j graph database driver (REST API client) for Node.js
Apache License 2.0
925 stars 135 forks source link

TypeError: Uncaught error: Cannot read property 'length' of undefined #201

Closed sagdelen closed 8 years ago

sagdelen commented 8 years ago

I am using version node-neo4j 2.0.0-RC2 and very pleased with it, thanks for your efforts but last night i got interesting error on random requests like the following.

Debug: internal, implementation, error
TypeError: Uncaught error: Cannot read property 'length' of undefined
at /app/node_modules/neo4j/lib-new/GraphDatabase.js:268:44
at /app/node_modules/neo4j/lib-new/GraphDatabase.js:286:13
at Request._callback (/app/node_modules/neo4j/lib-new/GraphDatabase.js:92:20)
at Request.self.callback (/app/node_modules/request/request.js:200:22)
at emitTwo (events.js:100:13)
at Request.emit (events.js:185:7)
at Request.<anonymous> (/app/node_modules/request/request.js:1067:10)
at emitOne (events.js:95:20)
at Request.emit (events.js:182:7)
at IncomingMessage.<anonymous> (/app/node_modules/request/request.js:988:12)
at emitNone (events.js:85:20)
at IncomingMessage.emit (events.js:179:7)
at endReadableNT (_stream_readable.js:913:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)

There is no further stack trace.

I could not regenerate the same problem on my local machine but easily regenerating on heroku hosted web application (node version: 5.11.1 and neo4j instance is hosted on graph story by the way)

The same query runs and returns result for example 3 times perfectly and then it starts giving this error 2 times then runs 4 times without any problems, etc. To sum up, it is giving this error randomly.

The query is pretty large, about 50 lines with 3 unions.

I know this information is not enough to identify and fix a bug but this is all i got :)

Can you help me on this one?

aseemk commented 8 years ago

@agdelen: Great that you closed this, which I assume means it resolved for you.

Do you mind sharing what the resolution was? Thanks!

sagdelen commented 8 years ago

Actually it was very difficult for me to find the source but i manage to find it after a while.

There was an uncaught exception happening just before the query execution and it was affecting query parameters. Since it was hidden in the promise block without a catch block the actual stack trace was invisible which makes it very hard to locate.

To make it short it was not related to your framework, thats why i did not make any comment on the issue and closed it.

aseemk commented 8 years ago

Thanks for the info! Glad you got it figured out.