-
Notifications
You must be signed in to change notification settings - Fork 135
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
Parsing Problem when Node Property has Endline Char #103
Comments
Can we get a dump of the string you get back? Do all of your nodes have fb_uid, first_name, and last_name fields? Does this work? |
Here is a bit more: When I go through all of the friends of this user and get each of their individual nodes, all of the ones that have a tilde in a string field, like
This is perhaps related to the fact that There are a few other characters that have the same issue, but the most common is the tilde, as I have a lot of Brazilian friends. Here is another failing node:
Seems like |
Try the latest commit: Gemfile |
Neography and Neoid seem to be happy together now. I have no idea what has fixed it, but, yay! |
Other notes: This happens with Neo4j 1.8.2 (in production) and 1.9 (locally). Locally I am using ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.4.0] Using Ruby 2.0.0 (whatever that means) on Heroku. Ruby 2.0.0 changed the way string encodings are handled in significant ways that I am not expert on. Using Update: I'm really confused - Looks like I did switch to 1.1.0 and now it is working for some reason. So try HEAD now. |
This is the trimmed result of the query (I removed all the parts that did not have any odd characters) which comes back as a string instead of being marshalled into a normal array: |
I have upgraded to latest HEAD, turned off Neoid, and have the same problem. I also tried your alternate queries:
No, exact same result as the one in the pastie above (which is trimmed).
No, exact same result as the one in the pastie above (which is trimmed). |
These are unrelated to this issue per @maxdemarzi comment |
2.0.0-M03 is what Travis runs, so these tests pass since they test functionality for rest api transactions and labels. |
OK, so not related to my original issue at all then. As an aside, is there a REST api for determining version which could be used to automatically switch tests on and off? It would also be useful from a 'tests as documentation' standpoint. |
OK, so I've turned Neoid back on, and when I load a facebook profile in active record, and then grab the node with Neoid I get properly encoded data, but I do still see the error printing in the output:
This is for the same data that came back from the cypher query (see the pastie in previous comment) as:
So when getting a full node back things work. When getting columns of data back the encoding must be handled differently. |
I am writing some spec tests for this issue right now. :) |
I figured out the exact node that is causing this failure. When I request three columns of data, the Facebook UID, first_name and last_name, I get back a giant string If I get all nodes. I narrowed down the exact node causing the problem by getting the nodes in batches. If I get the first 748 nodes I get back an array of arrays, as it should be. When I get back 749 It comes back as a string (full result on pastie.org).
Strangely, when I ask for the set starting at the node that breaks this result, the same node comes back fine.
When I request two columns of data, first_name and last_name I get back a regular array of data as expected and the
The key, I think, is that there is an end-line character in the first_name field of this node. Also still seeing this |
Update: The failing node has an endline character in it: There doesn't seem to be any obvious reason why a larger data set would trigger the problem, but that is what is happening. 759 nodes doesn't seem to be excessively large to me. |
Did you ever figure this one out? |
No, I had to work around it by using small batches and iterating through with There is definitely still a problem on the nodes with properties containing an end line. It seems as though I would need to have a large data set in a test example to reproduce though based on it not always failing. Of note though, when the property is parsed, and I get back the set of nodes I expect (instead of the giant string), the endline, Also, I experience the issue on Neo4j 1.8 and 1.9 both, and am using Neography v1.1.0. I need to try with the latest version still. |
Not sure what to do about this one... so I'm closing it.... please reopen if anyone else runs into this too. |
Ignoring log files
Update: The failing node has an endline character in it:
\r\n
. When I get the nodes, including this bad one, or data with this property back in small batches (size 500) usingSKIP
andLIMIT
, where the node with\r\n
would be in the second batch, and iterating through the set concatenating the results everything works. When I try to get back a large set of nodes (total 759), or data all at once, it fails.There doesn't seem to be any obvious reason why a larger data set would trigger the problem, but that is what is happening. 759 nodes doesn't seem to be excessively large to me.
Original:
That query works fine, both in the Neo4j native web query interface, and in Neography.
That query works fine for every node except one, (node 535, who happens to have the most friends in my test DB) both in the Neo4j native web query interface, and in Neography. For the node on which it fails I get back a giant string that looks like it is JSON. When I try to parse the string with JSON (in ruby) I get a parse error.
Still looking into this more. Is there a place in the code where a parse error is caught instead of raised and a string returned instead of the array of results marshalled as Ruby objects. Having a string instead of an array come back causes some really messy hacks to be required.
The text was updated successfully, but these errors were encountered: