neo4j / neo4j-browser

Neo4j Browser is the general purpose user interface for working with Neo4j. Query, visualize, administrate and monitor the database.
https://neo4j.com
GNU General Public License v3.0
690 stars 347 forks source link

WebSocket connection to 'ws://xx.xx.xx.xx:7687/' failed #1896

Open GejarajanCognizant opened 1 year ago

GejarajanCognizant commented 1 year ago

"WebSocket connection to 'ws://xx.xx.xx.xx:7687/' failed" getting the above error in browser console and unable to login with the credential, getting "ServiceUnavailable: Failed to establish connection in 30000ms" error message in the login page. Help me to resolve the issue. Port #s 7687 and 7474 are opened for the server where Neo4j is setup

Guidelines

Please note that GitHub issues are only meant for bug reports/feature requests. If you have questions on how to use Neo4j, please ask on StackOverflow instead of creating an issue here.

Before creating a new issue, please check whether someone else has raised the same issue. You may be able to add context to that issue instead of duplicating the report. However, each issue should also only be focussed on a single problem, so do not describe new problems within an existing thread - these are very hard to track and manage, and your problem may be ignored. Finally, do not append comments to closed issues; if the same problem re-occurs, open a new issue, and include a link to the old one.

To help us understand your issue, please specify important details, primarily:

Additionally, include (as appropriate) log-files, stacktraces, and other debug output.

Example bug report

I discovered that when I mount data/ to a volume on my host, and then stop the container, the write.lock is not removed as well as a number of other files not being cleaned up properly.

Neo4j Version: 3.0M03 Operating System: Ubuntu 15.10 API: Docker

Steps to reproduce

  1. Pull the image: docker pull neo4j/neo4j:3.0.0-M03
  2. Create a directory on the host that will be a mount for the data: mkdir /home/neo4j-data
  3. Start a new container that mounts to this directory: docker run -d --name neo4j-test -p 7474:7474 -v /home/neo4j-data:/data neo4j/neo4j:3.0.0-M03
  4. Navigate to the write.lock file located in the directory: /data/databases/graph.db/schema/label/lucene/labelStore/1/
  5. Stop the container: docker stop neo4j-test

Expected behavior

write.lock should be removed now.

Actual behavior

write.lock is still present and preventing access by other programs.

OskarDamkjaer commented 1 year ago
  1. Are you able to connect via cypher shell?
  2. What do you get when running curl -H "Content-Type: application/json" localhost:7687
  3. Are you running neo4j browser from 7474?
GejarajanCognizant commented 1 year ago
  1. Are you able to connect via cypher shell? - Yes able to connect to cypher shell via command line
  2. What do you get when running curl -H "Content-Type: application/json" localhost:7687 - Getting below error when tried to use curl command curl: (7) Failed to connect to localhost port 7687: Connection refused
  3. Are you running neo4j browser from 7474? - Yes
OskarDamkjaer commented 1 year ago

Ah I see you were not running on localhost but on some "x.x.x.x" domain. Does the same curl command (but directed at your neo4j instance run without error?

OskarDamkjaer commented 1 year ago

Browser requires websockets (which use their own protocol) so debugging suggestion would be to first check that the port is reachable from your computer (via curl like I mentioned earlier) and then check your network to make sure you are able to open a websocket connection on that port

GejarajanCognizant commented 1 year ago

Sorry I tested in wrong server...just now realized. Actual response is curl: (52) Empty reply from server

OskarDamkjaer commented 1 year ago

Which version of neo4j do you run? if it's from before 4.4 that would be the expected result.

If it is reachable via curl but not via websocket it would indicate your network setup/firewall/load balancer/etc is the issue

GejarajanCognizant commented 1 year ago

Yes running 4.4 version. We have opened the firewall from OS and also for outside access

OskarDamkjaer commented 1 year ago

I know this is a frustrating error and I'm working to improve the error messages that we give from Neo4j Browser.

What it comes down to in the end is that browser is unable to execute the following line of code to open a websocket new WebSocket("ws://YOUR_URL_HERE:7687") without error. When running that snippet works without error in your web browser console, you should be able to connect without issue

GejarajanCognizant commented 1 year ago

Any solutions to this issue?