Cypher error with py2neo only when starting nginx

I have a flash application that uses neo4j for some data. Everything works fine when I use the python server, but when I deploy to nginx + uwsgi, I can no longer run cypher requests in py2neo. I cannot say if the misunderstanding at the py2neo level is either nginx permissions or something like that. (I run neo4j in the same field as the bottle to start.)

Curiously, the request works differently, and the index that it says does not exist (β€œorganization”) actually exists when I use the neo4j console. Here's the error:

File "/var/www/newproj/newproj/view_helpers.py", line 333, in tile_portfolios X = cypher.execute(cdb,query)[0] File "/usr/local/lib/python2.7/dist-packages/py2neo/cypher.py", line 261, in execute params, row_handler=row_handler, metadata_handler=metadata_handler, error_handler=error_handler File "/usr/local/lib/python2.7/dist-packages/py2neo/cypher.py", line 118, in execute stacktrace=err.stacktrace, CypherError: (u'Index `organization` does not exist', u'MissingIndexException', [u'org.neo4j.cypher.internal.executionplan.builders.IndexQueryBuilder$.checkNodeIndex(IndexQueryBuilder.scala:120)', u'org.neo4j.cypher.internal.executionplan.builders.IndexQueryBuilder$.getNodeGetter(IndexQueryBuilder.scala:87)', u'org.neo4j.cypher.internal.executionplan.builders.IndexQueryBuilder.createStartPipe(IndexQueryBuilder.scala:62)', u'org.neo4j.cypher.internal.executionplan.builders.IndexQueryBuilder.apply(IndexQueryBuilder.scala:38)', u'org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl.prepareExecutionPlan(ExecutionPlanImpl.scala:45)', u'org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl.<init>(ExecutionPlanImpl.scala:31)', u'org.neo4j.cypher.ExecutionEngine$$anonfun$prepare$1.apply(ExecutionEngine.scala:67)', u'org.neo4j.cypher.ExecutionEngine$$anonfun$prepare$1.apply(ExecutionEngine.scala:67)', u'org.neo4j.cypher.internal.LRUCache$LazyValue.value(LRUCache.scala:27)', u'org.neo4j.cypher.internal.LRUCache.getOrElseUpdate(LRUCache.scala:39)', u'org.neo4j.cypher.ExecutionEngine.prepare(ExecutionEngine.scala:67)', u'org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:59)', u'org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:63)', u'org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:79)', u'org.neo4j.server.rest.web.CypherService.cypher(CypherService.java:64)', u'java.lang.reflect.Method.invoke(Method.java:616)']) 

And here is the reason why I am sure that the index that it says does not exist, really exists:

 neo4j-sh (?)$ index --indexes Node indexes: vertex organization Relationship indexes: edge neo4j-sh (?)$ index --get-config organization { "provider": "lucene", "type": "exact" } 

So, is this something I should check in the cypher.py file? Or is this like a permission issue that nginx might not be able to read answers from locahost: 7474 when it is not started by the python server? Oddly enough, other aspects of py2neo work correctly on the server, for example neo4j.GraphDatabaseService("http://localhost:7474/db/data/").get_or_create_indexed_node() Any help in debugging (or reporting an error, depending on Which of these excellent designs is suitable?) is greatly appreciated.

+6
source share

Source: https://habr.com/ru/post/943907/


All Articles