Neo4j Web Socket Error

When I am trying to login neo4j browser with default id password i.e. neo4j/neo4j am getting below error:

**> ServiceUnavailable: WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver.**

I changed few things to neo4j.conf file also as mentioned in https://community.neo4j.com/t/troubleshooting-connection-issues-to-neo4j/129:-

  1. Use Chrome
  2. Set dbms.connector.bolt.tls_level=OPTIONAL in your neo4j config.
  3. Set bolt connection property as FALSE.

But still ending with the same error.
I am using neo4j:latest docker image in an Azure platform as container instance.

Please help me to resolve this issue.
Thanks

Can you provide some extra details?

  • When you connect via chrome, what is the URL you're using? (HTTPS or HTTP, and which port?)
  • Take a screenshot of browser and post here, including address bar.

I have encountered the same situation.
2018-12-11 02:04:46.168+0000 INFO [REQUEST] [AsyncLog @ 2018-12-11 02:04:46.167+0000] 192.168.10.253 - [Tue Dec 11 10:04:46 CST 2018] "/browser/?null" 200 2895 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" 2
2018-12-11 02:04:46.493+0000 INFO [REQUEST] [AsyncLog @ 2018-12-11 02:04:46.493+0000] 192.168.10.253 - [Tue Dec 11 10:04:46 CST 2018] "/?null" 200 146 "http://192.168.10.236:7474/browser/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" 2
2018-12-11 02:04:46.713+0000 INFO [REQUEST] [AsyncLog @ 2018-12-11 02:04:46.713+0000] 192.168.10.253 - [Tue Dec 11 10:04:46 CST 2018] "/browser/assets/images/device-icons/favicon-32x32.png?null" 200 2216 "http://192.168.10.236:7474/browser/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" 1

#*****************************************************************

Network connector configuration

#*****************************************************************

With default configuration Neo4j only accepts local connections.

To accept non-local connections, uncomment this line:

dbms.connectors.default_listen_address=0.0.0.0

You can also choose a specific network interface, and configure a non-default

port for each connector, by setting their individual listen_address.

The address at which this server can be reached by its clients. This may be the server's IP address or DNS name, or

it may be the address of a reverse proxy which sits in front of the server. This setting may be overridden for

individual connectors below.

#dbms.connectors.default_advertised_address=localhost

You can also choose a specific advertised hostname or IP address, and

configure an advertised port for each connector, by setting their

individual advertised_address.

Bolt connector

dbms.connector.bolt.enabled=true
dbms.connector.bolt.tls_level=OPTIONAL
dbms.connector.bolt.listen_address=:7687

HTTP Connector. There can be zero or one HTTP connectors.

dbms.connector.http.enabled=true
dbms.connector.http.listen_address=:7474

HTTPS Connector. There can be zero or one HTTPS connectors.

dbms.connector.https.enabled=true
dbms.connector.https.listen_address

neo4j.conf File settings as above.Never been able to access the database remotely

the screenshot of browser

We provide support to run Neo4j in Azure in an easy way, you can read about that here:

https://neo4j.com/developer/neo4j-cloud-azure-image/

However -- if you want to stick with the Docker approach, have you verified that through your network settings port 7687 is open? It's not clear why the connection is failing, so I'm wondering if you've eliminated connection timeouts or firewall / dropped packets as a cause.

I tried usiong both https and http with 7473 and 7474 respectively, still facing same error.

Earlier it was working perfectly fine sincelast 2 months. Suddenly this error occurred last week. All ports are open.

I'm going to try to raise this to more attention internally and see if I can find you an answer; please stand by. When you say "all ports are open", it would help if you could post the evidence that port 7687 is open for TCP because that's the most likely culprit in my mind. Port 7474 and 7473 affect how you fetch the web page that is Neo4j Browser, but when you try to connect to the database you're going over port 7687 (bolt TCP) to the database directly.

Hi All,

We had identified a regression in Neo4j 3.5.0 that prevents the discovery document (which Neo4j Browser uses to discover the bolt address) being served includes localhost as the host name rather than the expected host name derived from the request URI.

The bug has already been fixed in the code base and will be included in the next patch release.

In the meantime, you can explicitly set dbms.connector.bolt.advertised_address configuration option to your expected externally visible address, for example to 192.168.10.216:7687 as per the screen shot @mp5088643 has shared earlier in the thread.

1 Like

Any update on the solution above ? I have just tried this solution with Community Edition 3.5.1 and I face the same issue as well. After reading some posts for solutions, I have the following configurations set up in the neo4j.conf file.

neo4j.conf:
dbms.connectors.default_listen_address=0.0.0.0
dbms.connectors.default_advertised_address="external IP"

dbms.connector.bolt.tls_level=OPTIONAL
dbms.connector.bolt.listen_address=:7687

dbms.connector.http.listen_address=:7474
dbms.connector.https.listen_address=:7473

Environment:

  • Using Chrome
  • Installed Community Edition v3.5.1 in Win 10 Pro

I can access the Neo4j browser via localhost but not via IP. Any comments and suggestions ? Thanks very much !

Thomas

Can you try what Ali shared here:

Hi, unfortunately there is no neo4j.conf file created during the installation of Desktop version...should it be manually created? In what location? Thanks

It is created when you create a graph instance and then you can access it from that graph

see: Neo4j Desktop User Interface Guide - Developer Guides

I am sure I'm being dim, but I am having what I think to be the same problem. I set up Neo4j 3.5.14 on Ubuntu server 18.04.3 and can connect on the IP address: https://MYIPADDRESS:7594/browser/

When I first set up the server I was able to ignore the SSL warning and continue through to the browser. I was able to connect to the database and run queries. However when I tried today I got the error:

WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver.**

I check the browser console and I see:

WebSocket connection to 'wss://MYIPADDRESS:7288/' failed: Error in connection establishment: net::ERR_CERT_AUTHORITY_INVALID

I don't have a certificate and can't install one with certbot as I only want to run this directly on the server IP address. I don't really want to set up a subdomain just for this server.

Settings in my /etc/neo4j/neo4j.conf file are:

`
dbms.connector.bolt.enabled=true
dbms.connector.bolt.tls_level=OPTIONAL
dbms.connector.bolt.listen_address=0.0.0.0:7288

dbms.connector.http.enabled=true
#dbms.connector.http.listen_address=:7594

dbms.connector.https.enabled=true
dbms.connector.https.listen_address=0.0.0.0:7594`

Any idea how to fix this please?

Thanks!