Skip to content

Causal Cluster Unable To Parse TTL Entry From Router #424

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
creatzor opened this issue Oct 31, 2018 · 4 comments · Fixed by #425
Closed

Causal Cluster Unable To Parse TTL Entry From Router #424

creatzor opened this issue Oct 31, 2018 · 4 comments · Fixed by #425

Comments

@creatzor
Copy link

creatzor commented Oct 31, 2018

Hi,

I'm using the js driver version 1.7 and haven't been able to connect to my causal cluster (same issue with previous versions). I dont understand why it can't parse it because it appears the TTL (300) is right there . Any insight on what i'm doing wrong?

I use bolt+routing:// neo-core-1.al-dev.ecs.local.

const driver = neo4j.driver(NEO4J_URI, neo4j.auth.basic(NEO4J_USER, NEO4J_PASSWORD), {
	disableLosslessIntegers: true,
	encrypted: 'ENCRYPTION_OFF'
});

runCypherQuery(driver.session(), 'MATCH (n) RETURN COUNT(n)')
	.then(r => {
		console.log('--> NODE COUNT: ', r);
	})
	.catch(console.log);

{ Neo4jError: Unable to parse TTL entry from router neo-core-1.al-dev.ecs.local:7687 from record:
{"keys":["ttl","servers"],"length":2,"_fields":[300,[{"addresses":["neo-core-1.al-dev.ecs.local:7687"],"role":"WRITE"},{"addresses":["neo-core-3.al-dev.ecs.local:7687","neo-core-2.al-dev.ecs.local:7687"],"role":"READ"},{"addresses":["neo-core-2.al-dev.ecs.local:7687","neo-core-1.al-dev.ecs.local:7687","neo-core-3.al-dev.ecs.local:7687"],"role":"ROUTE"}]],"_fieldLookup":{"ttl":0,"servers":1}}

bolt without routing works, but i need to be able to take advantage of the cluster

Doing some debugging -- I see the rror returned from routing-util.js is

 TypeError: record.get(...).multiply is not a function
    at RoutingUtil.parseTtl (/Users/albertfrimpong/Documents/Development/sourcify-api/node_modules/neo4j-driver/lib/v1/internal/routing-util.js:112:38)
    at /Users/albertfrimpong/Documents/Development/sourcify-api/node_modules/neo4j-driver/lib/v1/internal/rediscovery.js:83:49
    at process._tickCallback (internal/process/next_tick.js:68:7)

The ttl returned from record.get is of type number but its seems thats not what we expect?

@creatzor
Copy link
Author

creatzor commented Nov 1, 2018

I noticed that disableLosslessIntegers: true in the driver config is why the type of ttl is number. When disabled, it's Integer and it correctly parses the TTL

I made a temporary fix creatzor@785aec4 while I wait for a resolution on this

@lutovich
Copy link
Contributor

lutovich commented Nov 1, 2018

Hi @albert-the-creator,

Thanks for reporting this issue and providing a detailed description!
It should now be fixed by the mentioned PR. We plan to release 1.6.4 and 1.7.1 that include the fix.

@lutovich
Copy link
Contributor

lutovich commented Nov 2, 2018

Hi @albert-the-creator,

Fix should now be released. Please feel free to update this issue or create a new one if there are any more problems.

@creatzor
Copy link
Author

creatzor commented Nov 2, 2018

Awesome thanks!! 🎉🎉🎉

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

Successfully merging a pull request may close this issue.

2 participants