SessionExpired: WebSocket connection failure

Connection to remote neo4j does not work:
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 unavailabl

Yep, I tried different configuration playing with these options:

# Bolt connector
dbms.connector.bolt.enabled=true
#dbms.connector.bolt.tls_level=DISABLED
dbms.connector.bolt.advertised_address=:7687

# Bolt connector
dbms.connector.bolt.enabled=true
#dbms.connector.bolt.tls_level=DISABLED
dbms.connector.bolt.advertised_address=0.0.0.0:7687

# Bolt connector
dbms.connector.bolt.enabled=true
#dbms.connector.bolt.tls_level=DISABLED
dbms.connector.bolt.advertised_address=some_ip_address:7687

# Bolt connector
dbms.connector.bolt.enabled=true
dbms.connector.bolt.tls_level=OPTIONAL
dbms.connector.bolt.advertised_address=some_ip_address:7687

Nothing works.
Shoul'd you just stay with http instead of some exotic 'bolt'....

I am not sure if it will help
Even I faced the same issue. So moved to Neo4j Browser and sometime later came back to Http and it worked.

Sorry, I do not get it. Could you please explain?

I am not sure but somehow i got the above error at http://localhost:7474 while logging to the server
I moved to Neo4j Browser and started my query there and it worked good.
After sometime back i rebooted my system and again came to http://localhost:7474 and this time i did not face any issue and was good

Is the Neo4j instance running on a different system than the client?

If so, then on the system where the Neo4j instance is running, you should configure:

Bolt connector

dbms.connector.bolt.enabled=true

#dbms.connector.bolt.tls_level=DISABLED

dbms.connector.bolt.advertised_address=:7687

dbms.connectors.default_listen_address=0.0.0.0

Elaine

Hi ,

Is the issue resolved?
Just try to see the ports on which your DB instance is working

Nope, nothing has changed. Still does not work. Ports? Bolt on 7687, http on 7474. Locally it works. From remote PC not (but i can receive login screen)

What login screen are you referring to, Neo4j Browser where you provide your credentials for server connect?

What happens when you provide the credentials for logging in to the server, typically neo4j/xxx where xxx is the password you set up for the Neo4j instance.

Elaine

Thanks for reply Elaine!

What login screen are you referring to, Neo4j Browser where you provide your credentials for server connect?

Yes, exactly.
On localhost as "connect URL" I have there "neo4j://localhost:7687"

What happens when you provide the credentials for logging in to the server, typically neo4j/xxx where xxx is the password you set up for the Neo4j instance.

On localhost I simply log in.
On remote PC ("connect URL" is "neo4j://10.X.X.X:7687) I get message:

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 includ..

Regards

Set:

dbms.connector.bolt.address=0.0.0.0:7687

Elaine

Thanks you very much but it is still not working.

'dbms.connector.bolt.address' is probably some old parameter because neo4j does not recognize it:


Unrecognized setting. No declared setting with name: dbms.connector.bolt.address

Anyway, it changes nothing.

Some advises say 'set dbms.connector.bolt.tls_level=OPTIONAL but this will make neo4j crash.

I did debug it in Firefoex and I see log:

Request URL:ws://x.x.x.x:7687/

Request Method:GET

Remote Address:x.x.x:7687

Status Code:

101

For test I disabled FW - still nothing.
I tested connection from Pentaho plugin to avoid browser - does not work

In fact I'm able to log on (process takes about one minute) but working is not possible... sooooo slow.

My opinion is - neo4j does NOT work through network (at least version 4).
I tried in Firefox and Chrome, Pentaho

What version of Neo4j is this?

Elaine

Neo4j: 4.0.1 ----------------

Hello
same probleme here with my classroom
all my students did docker pull neo4j getting the last version as of today
the ubuntu and mac students had no problem running the neo4j browser and connecting. all the windows users are stuck.
we ve tried the different configuration options we found online, connecting with external ip adress instead of localhost, disabling windows firewall.
neo4j://0.0.0.0:7687 does not work

neo4j://192.168.0.27:7687 take us a bit further(local ip adress), but is slow, we have the "Server is taking a long time to respond..." message. then the page changes, but it seems that we are still not connected.

we are stuck ..

We found a solution , it worked for all students :
here it is :

dbms.default_listen_address=0.0.0.0

Bolt connector

dbms.connector.bolt.enabled=true
#dbms.connector.bolt.tls_level=DISABLED
dbms.connector.bolt.listen_address=0.0.0.0: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=false
#dbms.connector.https.listen_address=:7473
dbms.connector.bolt.advertised_address=:7687

Unfortunately the problem persists for a secure connection (HTTPS).
For us this issue has started when we switched to version 4 (4.0.2) of neo4j Enterprise.

The same issue is actually reproducible on neo4j Desktop - when trying to connect to localhost:7473 using Chrome the exact same error message appears and unable to connect / login.

I need to set this get it working.

dbms.default_advertised_address=192.168.1.184

That is the address of the box where I have my Neo4J community edition running.

I only wasted 6 hours to figure this.

I have same problem.

My project is in SpringBoot with Docker and not connect as bolt in Neo4j Community.

My configuration in neo4j:

dbms.connector.bolt.enabled=true
#dbms.connector.bolt.tls_level=DISABLED
dbms.connector.bolt.listen_address=sasa-neo4j:7687
dbms.default_listen_address=sasa-neo4j

Configuration in my project:

spring.data.neo4j.uri=bolt://sasa-neo4j
spring.data.neo4j.username=neo4j
spring.data.neo4j.password=streams

The error is:

sasa-mw           | INFO: Direct driver instance 137038838 created for server address sasa-neo4j:7687
sasa-mw           | Feb 05, 2021 7:09:10 PM org.neo4j.driver.internal.logging.JULogger info
sasa-mw           | INFO: Closing connection pool towards sasa-neo4j:7687

My Docker:
image

docker-compose.yml:

 version: '3.7'
 services:
   neo4j:
     image: neo4j:4.0.3
     hostname: sasa-neo4j
     container_name: sasa-neo4j
     ports:
       - "7474:7474"
       - "7687:7687"
     volumes:
       - ./neo4j/plugins:/plugins
       - ./neo4j/conf:/conf
     environment:
       NEO4J_AUTH: neo4j/streams
       NEO4J_dbms_logs_debug_level: DEBUG