###前提・実現したいこと
お世話になります。ご質問させてください。
自分で書いたスクリプトで、Heroku上のneo4jにアクセスしたいです。
将来的にはheroku上のサーバに組み込むことを想定しております。
macOS Sierra
Python 2.7.10
Heroku
neo4j(GrapheneDB)
neo4v.v1(ライブラリ)
###発生している問題・エラーメッセージ
$ python test2heroku.py Traceback (most recent call last): File "test2heroku.py", line 9, in <module> session = driver.session() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neo4j/v1/session.py", line 148, in session session = Session(self) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neo4j/v1/session.py", line 461, in __init__ self.connection = connect(driver.host, driver.port, driver.ssl_context, **driver.config) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neo4j/v1/connection.py", line 414, in connect s = ssl_context.wrap_socket(s, server_hostname=host if HAS_SNI else None) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 352, in wrap_socket _context=self) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 579, in __init__ self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 808, in do_handshake self._sslobj.do_handshake() socket.error: [Errno 54] Connection reset by peer
###該当のソースコード
URL,USER,PASSWORDはそれぞれ以下で取得しています。
heroku config:get GRAPHENEDB_BOLT_URL
heroku config:get GRAPHENEDB_BOLT_USER
heroku config:get GRAPHENEDB_BOLT_PASSWORD
Python
1from neo4j.v1 import GraphDatabase, basic_auth 2 3driver = GraphDatabase.driver("bolt://(省略).dbs.graphenedb.com:24786", auth=basic_auth("(省略)", "(省略)")) 4session = driver.session() 5 6session.run("CREATE (neo4j:Software {name:'neo4j'})") 7result = session.run("MATCH (n) RETURN n.name AS name") 8for record in result: 9 print("%s" % (record["name"])) 10 session.close()
###試したこと
- localhost上のneo4jにはアクセスできます。
- ちょうど金曜日の大規模アクセス障害のあたりだったので時間を置いてみたのですが、週明けの今日もダメでした。(restart all dynosしました。)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。