Open jankowtf opened 4 years ago
Hi! Have you tried connecting to http://localhost:7474 with your web browser and entering your user name and password on the UI there to check that they had been correctly set?
Hi!
I did yesterday and was able to connect via my browser (Firefox).
But when I check now (both in Firefox and Chrome with emptied cache and docker run --rm -p 7474:7474 -v $(pwd)/data:/data --env NEO4J_AUTH=neo4j/12345 --name neo4j neo4j
), I see the following error:
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 unavailable, using th
Strangely, I also get the error after stopping, removing the $(pwd)/data
directory and restarting with docker run --rm -p 7474:7474 -v $(pwd)/data:/data --name neo4j neo4j
again and using the defaults neo4j/neo4j
What am I doing wrong?
Ah, found the reason why I couldn't connect via the browser: yesterday while troubleshooting, I took out the second port forwarding -p 7687:7687
which as I understand is for Bolt.
When I bring it back, start the container with docker run --rm -p 7474:7474 -p 7687:7687 -v $(pwd)/data:/data --name neo4j neo4j
and request http://localhost:7474
via my browser, the server asks me to specify a new password (I used 12345
again for testing) and lets me connect afterwards.
However, when I use that very password in con <- neo4j_api$new()
, I still get a 404
(which is also strange; I'd expected a 401
rather than a 404
here)
Hi @rappster, I think the problem comes from the fact that with you're running the newest version of Neo4J (version 4), while neo4r only works with Neo4J version 3.
If you run the same command, adding ":3.5.3" at the end, then it works.
In terminal:
docker run --rm -p 7474:7474 -p 7687:7687 -v $(pwd)/data:/data --env NEO4J_AUTH=neo4j/12345 --name neo4j neo4j:3.5.3
Then in R:
> library(neo4r)
> con <- neo4j_api$new(
+ url = "http://localhost:7474",
+ user = "neo4j",
+ password = "12345"
+ )
> con$ping()
[1] 200
>
@fBedecarrats thanks a lot, works like a charm with 3.5.3
.
Are you planning on making neo4j
work with 4.x
versions anytime soon or will that still be a while?
As far as I know it's only the ping()
method that fails, other methods still work. Can you confirm?
@ColinFay yeb, I can confirm that.
Just checked again with the latest Neo4j version and a CREATE
statement went through just fine.
Thanks for looking into this
Hi !
I am having an issue falling under the scope of the name of this issue.
( EDIT: this might also suit in #64 )
I create a shiny container on a side, and a neo4j container one one other side. Launching both containers is ok, connecting to both the shiny app and neo4j browser from the host is ok, but having the shiny app connecting to the neo4j DB is not working properly. I made it work in local.
I would have expected my shiny app to connect by the docker network. I set up the connection as follow:
con = neo4r::neo4j_api$new(
url = "http://0.0.0.0:7474", # 0.0.0.0 is better on my os aka ubuntu
user = "neo4j",
password = "pw"
)
but get this error:
> con
<neo4j connection object>
Error: Failed to connect to 0.0.0.0 port 7474: Connection refused
No registered Connection
(Wrong credentials or hostname)
However, using the same id/pw in the neo4j browser results in a valid connection.
I am not proficient with docker, so I might have forgotten something. Please find attached my docker-compose file.
docker-compose.yml
version: '3'
services:
neo4j:
image: neo4j:3.5-enterprise
restart: unless-stopped
container_name: neo4j
depends_on: ["shiny4cartosib"]
ports:
- 7474:7474 # HTTP
- 7473:7473 # HTTPS
- 7687:7687 # bolt
volumes:
# import data
- ./neo4j_setup/import/:/var/lib/neo4j/import
- ./neo4j_setup/:/neo4j_setup
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
# Install APOC library
- NEO4JLABS_PLUGINS='[\"apoc\"]'
# Raise memory limits
- NEO4J_dbms_memory_pagecache_size=1G
- NEO4J_dbms.memory.heap.initial_size=1G
- NEO4J_dbms_memory_heap_max__size=1G
# Authentication setup
- NEO4J_AUTH=neo4j/pw
shiny4cartosib:
build: .
# image: shiny4cartosib:local
container_name: shiny4cartosib
ports:
- 3838:3838
My problem is solved (but sorry, could not show the whole repo since it is private)
Hi Colin,
first of: thanks you and your team so much for
neo4r
and all your other packages - highly appreciated!I just wanted to take
neo4r
for a spin, but somehow I can't connect to the Neo4j server running in a docker container.First try
Keeping the defaults for username (
neo4j
) and password (neo4j
)Docker:
Reprex:
Second try
Providing/setting explicit
username/password
via environment variableDocker:
Reprex:
Session info