Google 응용 프로그램 엔진에서 py2neo를 사용하여 백엔드를 설정하려고합니다. 앱 엔진에서 dev에 푸시 될 때 제대로 작동하지만, 불행히도 localhost에서 사용할 때 작동하지 않습니다.Google 응용 프로그램 엔진에서 py2neo v3 사용
첫째, 내가 파이썬에서 HOME 환경 변수를 살고 있고 한 (덕분에 그 팁, 내 코드는 내 dev에 작동)하지만 로컬 호스트의 문제 그리고
가 해결되지 않습니다, 나는 그 조언을 따랐습니다 "ImportError: No module named _ssl" with dev_appserver.py from Google App Engine 한 가지 예외는 방지하지만 다른 예외는 발생합니다. 모든 샌드 박스 ENVIRONNEMENT에 lauches와 가짜 사용자와, 예외가 정상이지만 dev에에 발생하지 않기 때문에
은 여기 내 역 추적
ft1.1: Traceback (most recent call last):
File "/Users/Arnaud/Documents/project/app/test/neo4j/test_graph_handler.py", line 13, in test_get_direct_neighbours
selection = self.graph_handler.get_direct_neighbours("8")
File "/Users/Arnaud/Documents/project/app/neo4j/graph_handler.py", line 20, in get_direct_neighbours
labels(l) AS `relationship`" % self.protect(ean))
File "/Users/Arnaud/Documents/project/app/libs/py2neo/database/__init__.py", line 694, in run
return self.begin(autocommit=True).run(statement, parameters, **kwparameters)
File "/Users/Arnaud/Documents/project/app/libs/py2neo/database/__init__.py", line 370, in begin
return self.transaction_class(self, autocommit)
File "/Users/Arnaud/Documents/project/app/libs/py2neo/database/__init__.py", line 1212, in __init__
self.session = driver.session()
File "/Users/Arnaud/Documents/project/app/libs/py2neo/packages/neo4j/v1/session.py", line 126, in session
connection = connect(self.address, self.ssl_context, **self.config)
File "/Users/Arnaud/Documents/project/app/libs/py2neo/packages/neo4j/v1/bolt.py", line 444, in connect
if not store.match_or_trust(host, der_encoded_server_certificate):
File "/Users/Arnaud/Documents/project/app/libs/py2neo/packages/neo4j/v1/bolt.py", line 397, in match_or_trust
f_out = os_open(self.path, O_CREAT | O_APPEND | O_WRONLY, 0o600) # TODO: Windows
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/stubs.py", line 73, in fake_open
raise OSError(errno.EROFS, 'Read-only file system', filename)
OSError: [Errno 30] Read-only file system: '/Users/Arnaud/.neo4j/known_hosts'
입니다.
그리고 여기 그것이 dev에 작업을하는 이유 그래서
13 def get_direct_neighbours(self, ean):
14 selection = self.graph.run("\
15 MATCH\
16 (:Product {ean: '%s'})-->(l)<--(n:Product)\
17 RETURN\
18 n.ean AS `ean`,\
19 n.name AS `name`,\
20 labels(l) AS `relationship`" % self.protect(ean))
21 return selection
이해 /Users/Arnaud/Documents/project/app/neo4j/graph_handler.py:20, 내가 지역화하려고 경우 샌드 박스와 dev 실행 시작이 다릅니다. 그것은 때문에 디바이스에 바로 여기 /Users/Arnaud/Documents/project/app/libs/py2neo/packages/neo4j/v1/bolt.py:427
427 if ssl_context and SSL_AVAILABLE:
428 host, port = host_port
429 if __debug__: log_info("~~ [SECURE] %s", host)
430 try:
431 s = ssl_context.wrap_socket(s, server_hostname=host if HAS_SNI else None)
432 except SSLError as cause:
433 error = ProtocolError("Cannot establish secure connection; %s" % cause.args[1])
434 error.__cause__ = cause
435 raise error
436 else:
437 # Check that the server provides a certificate
438 der_encoded_server_certificate = s.getpeercert(binary_form=True)
439 if der_encoded_server_certificate is None:
440 raise ProtocolError("When using a secure socket, the server should always provide a certificate")
441 trust = config.get("trust", TRUST_DEFAULT)
442 if trust == TRUST_ON_FIRST_USE:
443 store = PersonalCertificateStore()
444 if not store.match_or_trust(host, der_encoded_server_certificate):
445 raise ProtocolError("Server certificate does not match known certificate for %r; check "
446 "details in file %r" % (host, KNOWN_HOSTS))
447 else:
448 der_encoded_server_certificate = None
에, SSL 로딩은 ssl_compat 실패 .py가 localhost에서 성공하면 if 문 내부에 코드가 들어가서 444에서 실패합니다.
SSL_AVAILABLE을 위장한 상태로 만들었지 만, 그 경우에도 앱 엔진 소켓에 관한 문제는 이상합니다. 소켓으로 인식되지 않음
ft1.1: Traceback (most recent call last):
File "/Users/Arnaud/Documents/project/app/test/neo4j/test_graph_handler.py", line 13, in test_get_direct_neighbours
selection = self.graph_handler.get_direct_neighbours("8")
File "/Users/Arnaud/Documents/project/app/neo4j/graph_handler.py", line 20, in get_direct_neighbours
labels(l) AS `relationship`" % self.protect(ean))
File "/Users/Arnaud/Documents/project/app/libs/py2neo/database/__init__.py", line 694, in run
return self.begin(autocommit=True).run(statement, parameters, **kwparameters)
File "/Users/Arnaud/Documents/project/app/libs/py2neo/database/__init__.py", line 370, in begin
return self.transaction_class(self, autocommit)
File "/Users/Arnaud/Documents/project/app/libs/py2neo/database/__init__.py", line 1212, in __init__
self.session = driver.session()
File "/Users/Arnaud/Documents/project/app/libs/py2neo/packages/neo4j/v1/session.py", line 126, in session
connection = connect(self.address, self.ssl_context, **self.config)
File "/Users/Arnaud/Documents/project/app/libs/py2neo/packages/neo4j/v1/bolt.py", line 460, in connect
ready_to_read, _, _ = select((s,),(),(), 0)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/remote_socket/_remote_socket.py", line 483, in select
_SetState(request, _GetSocket(value), POLLIN)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/remote_socket/_remote_socket.py", line 425, in _GetSocket
raise ValueError('select only supported on socket objects.')
ValueError: select only supported on socket objects.
누군가가 똑같은 문제에 직면했다면, 나는 꽤 고통 스럽기 전에 개발팀을 밀어 넣어야하기 때문에 흥미가 있습니다.
편집 : 나는 아직 나이젤에서 아무 대답이없고 좀 빠른 솔루션을 필요에 따라, 나는 보내고 사이퍼 요청을받을 내 자신의 클래스를 만들었습니다 알고 싶은 사람들을 위해 , 그것은 응용 프로그램과 호환 엔진 및 나는 그것을 요점에 putted했습니다 : https://gist.github.com/ArnaudParan/e26f291ba8b3c08e5b762d549667c7d6 전체 노드를 요청하면 실험적이며 작동하지 않을 수 있지만 도움이 될 경우 게시 할 수 있습니다.
답장을 보내 주셔서 감사합니다. 코드와 워드 프로세서에서 검색해 봤지만 찾지 못했습니다. 다시 검색하고 라이브러리 작성자에게 물어보고 다시 나에게 답합니다. –