Windows の Docker で Neo4j を動かすも WebSocket `readyState` is: 3 で動かない。

最近、私用では Windows をメインに利用している。

そんな中 Neo4j を使ってアプリを書こうと思い、設定を始める。

OS: Windows 10 pro, version=1903
Docker: 2.2.0.5 (43884)
Neo4j: Community, version=4.0.3

まず、こんな感じで docker-compose.yml を書く。

version: '3'
services:

 neo4j:
   image: neo4j:latest
   container_name: my-neo4j
   restart: always
   ports:
       - 7474:7474
       - 7687:7687
       - 7473:7473
   volumes:
       - c:/my/home/path/etc/genius-party/neo4j/conf:/var/lib/neo4j/conf
       - c:/my/home/path/var/genius-party/neo4j/data:/data
       - c:/my/home/path/var/genius-party/neo4j/logs:/logs

docker-compose up して起動。
そして http://localhost:7474/browser/ にアクセスしサインインするも以下エラーが発生する。

<<画面表示エラー>>
SessionExpired:
WebSocket connection failure.
Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver.
Please use your browsers development console to determine the root cause of the failure.
Common reasons include the database being unavailable, using the wrong connection URL or temporary network problems.
If you have enabled encryption, ensure your browser is configured to trust the certificate Neo4j is configured to use.
WebSocket `readyState` is: 3

<<Chrome デベロッパーツールのコンソールのエラー>>
neo4j-driver.chunkhash.bundle.js:1
WebSocket connection to 'ws://0.0.0.0:7687/' failed: Error in connection establishment: net::ERR_ADDRESS_INVALID

Neo4jにログインできない場合の対処(Qiita) を 見ると dbms.connector.bolt.listen_address のコメントをハズせ。との記載あり。

しかし、Neo4j が起動して生成した neo4j.conf には、そもそもコメント行すらない。

<<Neo4j が起動して生成した neo4j.conf>>


dbms.connector.https.advertised_address=0.0.0.0:7473

dbms.default_listen_address=0.0.0.0

dbms.connector.http.advertised_address=0.0.0.0:7474

dbms.memory.pagecache.size=512M


dbms.connector.bolt.advertised_address=0.0.0.0:7687
dbms.tx_log.rotation.retention_policy=100M size
dbms.directories.logs=/logs

仕方がないので行を追加して再起動するもエラーは解消されず。

ネットを探り WebSocket connection to 'ws://localhost:7687/' failed #522  に辿りつく。

以下の対応で解消できた。

キャプチャ

そして再起動し http://localhost:7474/browser/ にアクセスしサインインする。
初期ユーザー/パスワードは neo4j/neo4j と書いてある。

結果エラー。。。。これ明日にしよう。。。。

Neo.ClientError.Security.Unauthorized: The client is unauthorized due to authentication failure.

この記事が気に入ったらサポートをしてみませんか?