graphaware / neo4j-bolt-php

PHP Driver for Neo4j's Binary Protocol : Bolt
MIT License
42 stars 38 forks source link

SerializationException when running client stacks #9

Closed mattfiocca closed 8 years ago

mattfiocca commented 8 years ago

I'm having a really hard time narrowing down why I am getting serialization errors when running cypher queries on specific node labels through a neo4j-php-client stack over bolt.

When I run:

$st = array( "publish", "draft" );
$stack = $client->stack();
$stack->push("MATCH (n:LOCATION) WHERE (n.status IN {statuses}) RETURN count(*) AS total", [ 'statuses' => $st ], 'total_count');
$stack->push("MATCH (n:LOCATION) WHERE (n.status IN {statuses}) RETURN n ORDER BY n.title ASC SKIP 0 LIMIT 25", [ 'statuses' => $st ], 'paginated_records');
$results = $client->runStack($stack);

I get this exception:

PHP Fatal error:  Uncaught exception 'GraphAware\Bolt\Exception\SerializationException' with message 'Unable to find serialization type for marker d8' in graphaware/neo4j-bolt/src/PackStream/Unpacker.php:204
Stack trace:
#0 graphaware/neo4j-bolt/src/PackStream/Unpacker.php(85): GraphAware\Bolt\PackStream\Unpacker->unpackElement(Object(GraphAware\Bolt\PackStream\BytesWalker))
#1 graphaware/neo4j-bolt/src/PackStream/Unpacker.php(261): GraphAware\Bolt\PackStream\Unpacker->unpackElement(Object(GraphAware\Bolt\PackStream\BytesWalker))
#2 graphaware/neo4j-bolt/src/PackS in graphaware/neo4j-bolt/src/PackStream/Unpacker.php on line 204

But when i run this on a different node label:

$st = array( "publish", "draft" );
$stack = $client->stack();
$stack->push("MATCH (n:REPORT) WHERE (n.status IN {statuses}) RETURN count(*) AS total", [ 'statuses' => $st ], 'total_count');
$stack->push("MATCH (n:REPORT) WHERE (n.status IN {statuses}) RETURN n ORDER BY n.title ASC SKIP 0 LIMIT 25", [ 'statuses' => $st ], 'paginated_records');
$results = $client->runStack($stack);

The query works as expected.

Does this mean something is up with the data in one of my LOCATION nodes somehow? If so, what would cause serialization errors within my nodes? Everything works fine when i connect using the default http protocol, this only applies to bolt connections.

Here are the properties of the LOCATION node that the query chokes on:

leader = (empty)
user_email = matt@snapdragon.is
located_ivo = (empty)
address = (empty)
source_text = (empty)
image_url = (empty)
country_team = (empty)
mgrs = (empty)
description = (empty)
created_timestamp = 1464901048
title = Test Location
location_type = (empty)
capitol = (empty)
government = (empty)
user_login = matt
information_gaps = (empty)
id = loc_57509db8e09f2
text = (empty)
image_id = (empty)
created_utc = 2016-06-02 08:57:28
slug = test-location
status = publish

And here are the properties of the REPORT node that works just fine:

published_utc = 2016-06-02 08:07:42
user_email = matt@snapdragon.is
user_login = matt
created_timestamp = 1464898068
id = rep_57509214536b9
text = (empty)
created_utc = 2016-06-02 08:07:48
title = A Report
published_timestamp = 1464854862
slug = a-report
status = publish

Any and all advice is welcome.

ikwattro commented 8 years ago

Thanks for the report, I'll investigate.

ikwattro commented 8 years ago

@mattfiocca What version of the client/driver are you using ? It reminds me a same bug reported a while back

ikwattro commented 8 years ago

@mattfiocca Yeah actually I think it is fixed already :

https://github.com/graphaware/neo4j-bolt-php/commit/0a941a82f5fc0a6ddaf0f7a90ae0335063b0e933

I suggest you update your dependencies :

rm -rf composer.lock
composer update graphaware/neo4j-php-client
mattfiocca commented 8 years ago

I'm running 4.4 of the client. Looking at composer.json of the client that i've got though, its listing version ^1.0 of bolt, and not ^1.5.... After clearing my lock file and re-updating, nothing seems to happen with composer though. I'm not a huge composer expert, do you know of any other way to force update the graphaware packages? I appreciate the help

mattfiocca commented 8 years ago

I was able to get composer to download the correct versions by rm -rf ~/.composer entirely first. I had read to try rm -rf ~/.composer/cache, but I had to remove the entire thing in order to get the packages to download again. thanks for helping me,