Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket error on Chrome and Firefox when rendering more than 300 nodes #85

Closed
alexisgra opened this issue Feb 5, 2020 · 6 comments · Fixed by #86
Closed

Websocket error on Chrome and Firefox when rendering more than 300 nodes #85

alexisgra opened this issue Feb 5, 2020 · 6 comments · Fixed by #86

Comments

@alexisgra
Copy link

alexisgra commented Feb 5, 2020

Hello !

I have a problem with Neovis on Firefox and Chrome on mac (not on safari). My neo4j is running in a local docker container.

I have the following code:

function draw() {
            var config = {
                container_id: "viz",
                server_url: "bolt://localhost:7687",
                server_user: "neo4j",
                server_password: "root",
                labels: {
                    "Pom": {
                        "caption": "fullRepositoryName"
                    },
                    "MavenProfile": {
                        "caption": "name",
                        "sizeCypher": "MATCH (n:MavenProfile) WHERE id(n) = {id} RETURN SIZE((n)<--()) AS s;",
                    }
                },
                relationships: {
                    "PROFILES": {
                        "caption": false,
                        "thickness": "0.1"
                    }
                },
                initial_cypher: "MATCH (n)-[r:PROFILES]->(m) RETURN * LIMIT 400"
            }

            var viz = new NeoVis.default(config);
            viz.render();
        }

When I query with a LIMIT X (X<300 in the cypher query), I get the graph.
When I request with a LIMIT X (X>300 in the cypher query), I get a web socket error.

On chrome :

WebSocket connection to 'ws://localhost:7687/' failed: Unknown reason
Uncaught (in promise) Neo4jError: 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

On firefox:

NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIInterfaceRequestor.getInterface]

I've seen a lot of problems related to Chrome and neo4j community. I tried everything (neo4j conf, SSL certificates on Chrome...).
Did I make a mistake? Have people managed to run Neovis on big graphs in these browsers? Please note that I don't have the problem on Safari, but I can't use it because Safari is too slowed down by the JS rendering.

Thanks a lot!

@thebestnom
Copy link
Collaborator

thebestnom commented Feb 5, 2020

Do you have a small docker compose + project to test it on?
Ill do say it looks like neo4j driver error and not neovis, but have you tried putting in the config
encripted:"ENCRYPTION_ON"?

@alexisgra
Copy link
Author

alexisgra commented Feb 5, 2020

Thank you for your response.
The encripted:"ENCRYPTION_ON" didn't work.

My docker-compose is :

version: "3"

services:
  neo4j:
    image: neo4j:3.5.0
    container_name: neo4j
    ports:
      - "127.0.0.1:7474:7474"
      - "127.0.0.1:7687:7687"
    environment:
      - NEO4J_AUTH=neo4j/root
      - NEO4J_apoc_import_file_enabled=true
      - NEO4J_apoc_export_file_enabled=true
      - NEO4J_apoc_import_file_use_neo4j_config=true
      - NEO4JLABS_PLUGINS=["apoc"]
    volumes:
      - ./neo4j/data:/var/lib/neo4j/data
      - ./neo4j/import:/var/lib/neo4j/import
      - ./neo4j/plugins:/var/lib/neo4j/plugins
      - ./neo4j/conf:/var/lib/neo4j/conf

My neo4j config is :

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

wrapper.java.additional=-Dneo4j.ext.udc.source=docker
ha.host.data=c377d049090e:6001
ha.host.coordination=c377d049090e:5001
dbms.tx_log.rotation.retention_policy=100M size
dbms.memory.pagecache.size=512M
dbms.memory.heap.max_size=512M
dbms.memory.heap.initial_size=512M
dbms.connectors.default_listen_address=0.0.0.0
dbms.connector.https.listen_address=0.0.0.0:7473
dbms.connector.http.listen_address=0.0.0.0:7474
causal_clustering.transaction_listen_address=0.0.0.0:6000
causal_clustering.transaction_advertised_address=c377d049090e:6000
causal_clustering.raft_listen_address=0.0.0.0:7000
causal_clustering.raft_advertised_address=c377d049090e:7000
causal_clustering.discovery_listen_address=0.0.0.0:5000
causal_clustering.discovery_advertised_address=c377d049090e:5000
apoc.import.file.use.neo4j.config=true
apoc.import.file.enabled=true
apoc.export.file.enabled=true
EDITION=community

I can't provide my database because it's big.
Thank you for your help !

@thebestnom
Copy link
Collaborator

thebestnom commented Feb 5, 2020

Anyway of direct contact? I managed to run the docker, but even trying to connect via the neo4j web interface seems to raise the same error, have you tried to run it with the secure port?

EDIT: managed to login, Im dumb and didnt saw you put password root

@thebestnom
Copy link
Collaborator

I think I found the bug, if you have a sizeCypher it opens a new session for every node that needs it (which is stupid and I feel dumb TT^TT) which opens a new websocket every node... so it seems like 300 websockets is the maximum for chrome/firefox... I will fix it later, for now you can remove the sizeCypher

@thebestnom
Copy link
Collaborator

Fixed, opening a merge request

@alexisgra
Copy link
Author

Thank you !
You've helped me a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants