1

There is one and only one connection and user here.

d = l.descriptions.first
 Language#descriptions 1200270ms MATCH language137, language137-[rel1:`DESCRIBED_IN`]->(result_descriptions:`Description`) WHERE (ID(language137) = {ID_language137}) RETURN result_descriptions | {:ID_language137=>137}
Faraday::TimeoutError: too many connection resets (due to Net::ReadTimeout - Net::ReadTimeout) after 0 requests on 70156828873380, last used 1438628883.105085 seconds ago

After that no other connection is allowed until server is restarted. What is wrong here?

Here is in more detail what I am trying to do: selecting a language i.e. English. Getting the count of descriptions in English. Searching the first description in English. This never returns or delivers the connection error. During the long run of the last one no other connections can be open to the database.

irb(main):001:0> l = Language.find_by(iso_639_2_code: 'eng')
 CYPHER 316ms MATCH (n:`Language`) WHERE (n.iso_639_2_code = {n_iso_639_2_code}) RETURN n LIMIT {limit_1} | {:n_iso_639_2_code=>"eng", :limit_1=>1}
=> #<Language uuid: nil, english_name_of_language: "English", french_name_of_language: "anglais", german_name_of_language: "Englisch", iso_639_1_code: "en", iso_639_2_code: "eng", spoken_in: "English, a West Germanic language is the first language for about 309–400 million people. See: Countries by Languages - English Speaking Countries.">
irb(main):002:0> 
irb(main):005:0* n = l.descriptions.count
 Language#descriptions 17749ms MATCH language137, language137-[rel1:`DESCRIBED_IN`]->(result_descriptions:`Description`) WHERE (ID(language137) = {ID_language137}) RETURN count(result_descriptions) AS result_descriptions | {:ID_language137=>137}
=> 2107041
irb(main):006:0> d = l.descriptions.first
LDB
  • 692
  • 6
  • 18
  • From rails console when I am running these: l = Language.find_by(iso_639_2_code: 'eng') and l.descriptions.cont (never returning or returning with too many connections error) this one (executed from the neo4j-shell) MATCH language137, language137-[rel1:DESCRIBED_IN]->(result_descriptions:Description) WHERE (ID(language137) = 137) RETURN count(result_descriptions) AS result_descriptions; hangs, does no longer returns. The server gets frozen. – LDB Aug 04 '15 at 14:47

3 Answers3

1

I think that we fixed this is version 5.0 of the gems. Could you try upgrading?

Brian Underwood
  • 10,746
  • 1
  • 22
  • 34
  • I am using version 5. – LDB Aug 03 '15 at 19:51
  • In order to run this in the web console I need to know how I can limit this only to first description: match (l:Language{iso_639_2_code:'eng'})-[r:DESCRIBED_IN]-(d:Description) return l, r, d; – LDB Aug 03 '15 at 19:59
  • *** LOCAL GEMS *** neo4j (5.0.9) neo4j-core (5.0.6) – LDB Aug 03 '15 at 21:48
  • Sorry, I think I was wrong about the gem version thing because this seems to be Neo4j taking a long time. Also you should try running the second query which is the one that's taking a long time. Just replace the parameter definitons with the values: `MATCH language137, language137-[rel1:DESCRIBED_IN]->(result_descriptions:Description) WHERE (ID(language137) = 137) RETURN count(result_descriptions) AS result_descriptions` – Brian Underwood Aug 03 '15 at 23:58
  • The one you suggested works. neo4j-sh (?)$ MATCH language137, language137-[rel1:DESCRIBED_IN]->(result_descriptions:Description) WHERE (ID(language137) = 137) RETURN count(result_descriptions) AS result_descriptions; +---------------------+ | result_descriptions | +---------------------+ | 2107041 | +---------------------+ 1 row 10856 ms – LDB Aug 04 '15 at 14:31
  • My problem here is not the Neo4j shell and running a cypher query through it. My problem is when using the rails console and queries are generated through the gems for very basic things. – LDB Aug 04 '15 at 14:37
  • When the session is working the uuid for language returned is nil l = Language.find_by(iso_639_2_code:'eng') CYPHER 260ms MATCH (n:`Language`) WHERE (n.iso_639_2_code = {n_iso_639_2_code}) RETURN n LIMIT {limit_1} | {:n_iso_639_2_code=>"eng", :limit_1=>1} => # – LDB Aug 04 '15 at 15:04
  • This is happening for all languages and and the database has an index on these uuids: ON :Language(uuid) ONLINE (for uniqueness constraint). Why indexing nil values? – LDB Aug 04 '15 at 15:05
  • I wanted to know how the query was running in Neo4j as a debugging step. It actually seems like it's pretty slow (10s), so that's useful. Could you create an issue in the `neo4j` repo with the current state of your issue? It's really hard going back and forth on StackOverflow comments – Brian Underwood Aug 04 '15 at 15:42
  • I will create an issues in the neo4j repo. Returning in 10 seconds in the shell is not a concern for the moment. Never return from RoR rails console is the problem. – LDB Aug 04 '15 at 16:25
  • This issue was created in the Neo4j repo: Basic usage of RoR gems not returning or returned with TimeoutError: too many connection resets #5085 – LDB Aug 04 '15 at 18:06
1

The issue was moved to the neo4jrb git repo and solved by the neo4j maintainers by recommending to upgrade to the gem core version 5.0.11 from 5.0.9

LDB
  • 692
  • 6
  • 18
0

You might see this error if your Neo4j database server becomes unresponsive. To fix this, restart your Neo4j database server.

bundle exec rake neo4j:stop

bundle exec rake neo4j:start
Andrew
  • 227,796
  • 193
  • 515
  • 708