# Troubleshooting Connection Issues to Neo4j

**URL:** <https://community.neo4j.com/t/troubleshooting-connection-issues-to-neo4j/129>\
**Category:** Browser\
**Tags:** cypher-shell, browser, connection, knowledge-base\
**Created:** [August 8, 2018, 5:03pm UTC](https://community.neo4j.com/t/troubleshooting-connection-issues-to-neo4j/129 "2018-08-08T17:03:14Z")\
**Posts on this page:** 8\
**Page:** 3

<div class="post-metadata">

**Author:** ![omkarrajmane94](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/omkarrajmane94/32/5484_2.png) [@omkarrajmane94](https://community.neo4j.com/u/omkarrajmane94)\
**Post date:** [August 12, 2020, 4:28am UTC](https://community.neo4j.com/t/troubleshooting-connection-issues-to-neo4j/129/41 "2020-08-12T04:28:17Z")

</div>

I have a problem in dotnet connection with neo4j

**Error:-**  
**An unhandled exception of type 'Neo4j.Driver.V1.ServiceUnavailableException' occurred in Neo4j.Driver.dll**

**Additional information: Failed after retried for 6 times in 30000ms. Make sure that your database is online and retry again.**

I'm using,  
visual studio 2015,  
Neo4j driver 1.7,  
Neo4j desktop application with 4.1.0

---

<div class="post-metadata">

**Author:** ![timothy.rickett](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/timothy.rickett/32/4351_2.png) [@timothy.rickett](https://community.neo4j.com/u/timothy.rickett)\
**Post date:** [October 13, 2020, 9:35am UTC](https://community.neo4j.com/t/troubleshooting-connection-issues-to-neo4j/129/42 "2020-10-13T09:35:44Z")

</div>

I'm having trouble connecting to neo4j browser behind haproxy. I'm running 4.1 Enterprise in a casual cluster configuration. I have no issues connecting to individual cluster members. However the browser fails to load when I access cluster via haproxy. This same configuration worked in 3.5 Enterprise.

I can verify that it connects to a server and starts to load js files via the proxy log and network traffic in browser. It appears to timeout while loading ui.chunkhash.bundle.js, cypher-codemirror.chunkhash.bundle.js or app-340ee6332805876eb588.js

I increased ha proxy timeouts to 2 minutes. I tried changing the default advertising address to the load balancer and to the cluster member. Neither worked Does Neo4j 4.1 Enterprise work behind haproxy or any load balancers?

---

<div class="post-metadata">

**Author:** ![pratikmakune3](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/pratikmakune3/32/14489_2.png) [@pratikmakune3](https://community.neo4j.com/u/pratikmakune3)\
**Post date:** [October 15, 2020, 6:34pm UTC](https://community.neo4j.com/t/troubleshooting-connection-issues-to-neo4j/129/43 "2020-10-15T18:34:20Z")

</div>

@david_allen  
We're facing the issue - We're trying to visualize neo4j data on frontend, react app using neovis library, We get, "Uncaught Error: Encryption/trust can only be configured either through URL or config, not both". We currently use neo4j version 3.5 deployed on AWS.

---

<div class="post-metadata">

**Author:** ![david\_allen](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/david_allen/32/13090_2.png) [@david\_allen](https://community.neo4j.com/u/david_allen)\
**Post date:** [October 15, 2020, 7:11pm UTC](https://community.neo4j.com/t/troubleshooting-connection-issues-to-neo4j/129/44 "2020-10-15T19:11:07Z")

</div>

@pratikmakune3 This error:

> Uncaught Error: Encryption/trust can only be configured either through URL or config, not both

When you create a driver instance, you can pass it configuration parameters. One of them is "trust" which specifies whether or not to trust self-signed certificates, for example. Here's an example of driver configuration options I'm talking about: [Function | Neo4j Bolt Driver 5.x for JavaScript](https://neo4j.com/docs/api/javascript-driver/current/function/index.html#static-function-driver)

When you specify a Neo4j URL, you can specify the same information. For example `neo4j+s://` means that you insist on secure certs, while `neo4j+ssc://` means that self-signed certificates are also OK.

If you did this in javascript:

```auto
const driver = neo4j.driver("neo4j+ssc://myhost", authDetails, { trust: 'TRUST_SYSTEM_CA_SIGNED_CERTIFICATES' })

```

Then you would _both_ be telling the driver to only trust system CA signed certs but ALSO be telling it to trust self-signed certs as well. This is a conflict, and so you would get this error.

The solution is to specify the trust strategy in EITHER the URL _or_ the driver settings, but never both, which explains the message. For example, if in that code example you used `neo4j://` instead of `neo4j+ssc://` it would probably work.

---

<div class="post-metadata">

**Author:** ![john.allen](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/john.allen/32/14500_2.png) [@john.allen](https://community.neo4j.com/u/john.allen)\
**Post date:** [November 6, 2020, 4:30pm UTC](https://community.neo4j.com/t/troubleshooting-connection-issues-to-neo4j/129/45 "2020-11-06T16:30:23Z")

</div>

I solved our issue here.. works sweet !! except now mongodb relationships as objids are not showing as lines in neo.. BUT we sovled by ensuring our neo4j db was created ! using v 3.5.17 .. no now connection issue from mono-connector

---

<div class="post-metadata">

**Author:** ![shawnngtq](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/shawnngtq/32/16345_2.png) [@shawnngtq](https://community.neo4j.com/u/shawnngtq)\
**Post date:** [June 10, 2021, 8:37am UTC](https://community.neo4j.com/t/troubleshooting-connection-issues-to-neo4j/129/46 "2021-06-10T08:37:05Z")

</div>

@david_allen

Neo4j version: 4.2.6

I have problem using cypher shell after making changes to `neo4j.conf`:

```bash
dbms.default_listen_address=0.0.0.0

dbms.default_advertised_address=abc.com

dbms.connector.bolt.tls_level=REQUIRED

dbms.connector.http.enabled=false

dbms.connector.https.enabled=true

dbms.ssl.policy.bolt.enabled=true
dbms.ssl.policy.bolt.base_directory=certificates/bolt
dbms.ssl.policy.bolt.private_key=private.key
dbms.ssl.policy.bolt.public_certificate=public.crt
dbms.ssl.policy.bolt.client_auth=NONE

dbms.ssl.policy.https.enabled=true
dbms.ssl.policy.https.base_directory=certificates/https
dbms.ssl.policy.https.private_key=private.key
dbms.ssl.policy.https.public_certificate=public.crt
dbms.ssl.policy.https.client_auth=NONE

```

Using browser, `abc.com:7473` works fine and `abc.com:7687` returns `not a WebSocket handshake request: missing upgrade`.

```bash
# expected error when I call without stating address
$ ./cypher-shell
Connection to the database terminated. Please ensure that your database is listening on the correct host and port and that you have compatible encryption settings both on Neo4j server and driver. Note that the default encryption setting has changed in Neo4j 4.0.
# I tried the following, but they gave the same error
$ ./cypher-shell -a abc.com:7687
$ ./cypher-shell -a neo4j://abc.com:7687
$ ./cypher-shell -a neo4j+s://abc.com:7687
$ ./cypher-shell -a bolt://abc.com:7687
$ ./cypher-shell -a bolt+s://abc.com:7687

```

This problem goes away if I set `dbms.connector.bolt.tls_level=OPTIONAL`. Can I understand how I can fix this?

Also I would like to hear your opinion on `dbms.default_listen_address=0.0.0.0`, to make it more secure, I should change `0.0.0.0` to specific ip right?

---

<div class="post-metadata">

**Author:** ![nikhil1](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/nikhil1/32/4239_2.png) [@nikhil1](https://community.neo4j.com/u/nikhil1)\
**Post date:** [June 25, 2021, 1:03pm UTC](https://community.neo4j.com/t/troubleshooting-connection-issues-to-neo4j/129/47 "2021-06-25T13:03:41Z")

</div>

Hi

I am also getting intermittent connectivity issues from Neo4j Desktop to the server deployed in an Azure VM.

95% of the time it work's fine, but some times when my co workers try and connect ,they get that websocket connection issue and says that the error message cannot be displayed on your browser(Neo4j Desktop).

Any idea why there would be intermittent issues ? How can i check what is going wrong ? because it occurs rarely and gets resolved by itself within half an hour or so .  
This is the exact error message ,

Tue, 15 Jun 2021 12:59:50 GMT

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 i..."  
Neo4j Version: 4.2.2  
Neo4j Desktop Version :1.4.5

---

<div class="post-metadata">

**Author:** ![markstockwell2021](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/markstockwell2021/32/22359_2.png) [@markstockwell2021](https://community.neo4j.com/u/markstockwell2021)\
**Post date:** [February 10, 2022, 8:56am UTC](https://community.neo4j.com/t/troubleshooting-connection-issues-to-neo4j/129/48 "2022-02-10T08:56:05Z")

</div>

Downloaded AMI today [AWS Marketplace: Neo4j - Community Edition](https://aws.amazon.com/marketplace/pp/prodview-k4c7xihxgbafk)  
After about 6 hours was able to connect from desktop.  
set dbms.default\_listen\_address=0.0.0.0  
changing advertised addresses to external ip's:  
dbms.connector.bolt.advertised\_address  
dbms.default\_advertised\_address  
hard coded in template.conf (chmod go+rw)  
Connecting on port 7474 seems to work not 7473  
Make sure security groups permit traffic on all 3 ports

| Security group rule ID | Port range | Protocol | Source | Security groups |
| --- | --- | --- | --- | --- |
| sgr-0b28a793018f4e67a | 7473 | TCP | 0.0.0.0/0 | Neo4j - Community Edition-4-4-3-AutogenByAWSMP- |
| sgr-0e0f5b3241925da6d | 7474 | TCP | 0.0.0.0/0 | Neo4j - Community Edition-4-4-3-AutogenByAWSMP- |
| sgr-0c9c074eb3a5a8fe3 | 7687 | TCP | 0.0.0.0/0 | Neo4j - Community Edition-4-4-3-AutogenByAWSMP- |
| sgr-010232536bc92fafd | 22 | TCP | 0.0.0.0/0 | Neo4j - Community Edition-4-4-3-AutogenByAWSMP- |

[Previous page](https://community.neo4j.com/t/troubleshooting-connection-issues-to-neo4j/129.md?page=2)
