neo4j-rstats / neo4r

A Modern and Flexible Neo4J Driver
https://neo4j-rstats.github.io/user-guide/
Other
106 stars 29 forks source link

Cannot connect to my Neo4j instance #18

Closed IraRe closed 6 years ago

IraRe commented 6 years ago

Here is the output of my reprex file:

library(neo4r)
library(httr)
con <- neo4j_api$new(url = "http://107.23.190.94:33961", user = "codes", password = "codes")
con
#> <Neo4JAPI>
#>   Public:
#>     access: function () 
#>     auth: Y29kZXM6Y29kZXM=
#>     clone: function (deep = FALSE) 
#>     get_constraints: function () 
#>     get_labels: function () 
#>     get_relationships: function () 
#>     get_schema: function () 
#>     get_version: function () 
#>     initialize: function (url, user, password) 
#>     password: codes
#>     ping: function () 
#>     reset_password: function (password) 
#>     reset_url: function (url) 
#>     reset_user: function (user) 
#>     url: http:/107.23.190.94:33961
#>     user: codes

con$get_version()
#> Error in curl::curl_fetch_memory(url, handle = handle): Could not resolve host: http

x <- GET("http://107.23.190.94:33961")
x
#> Response [http://107.23.190.94:33961/]
#>   Date: 2018-04-05 04:58
#>   Status: 200
#>   Content-Type: application/json; charset=UTF-8
#>   Size: 151 B
#> {
#>   "management" : "http://107.23.190.94:33961/db/manage/",
#>   "data" : "http://107.23.190.94:33961/db/data/",
#>   "bolt" : "bolt://107.23.190.94:33960"

I get the error message could not resolve host: http also by trying to execute con$ping(). The same error comes also by using a local Neo4j instance with http:\\localhost:7474 and by trying to connect from my Databricks Notebook.

Do you need any information about my local environment? I use Linux Mint if it makes any difference.

IraRe commented 6 years ago

I'm not sure if that helps, but the connection can be established by RNeo4j:

library(RNeo4j)
graph = startGraph("http://107.23.190.94:33961/db/data/", username = "codes", password = "codes")
query = "match (n:Court) return distinct n.courtName"
cypher(graph, query)
#>                    n.courtName
#> 1                          BGH
#> 2                     OLG Köln
#> 3  Schleswig-Holsteinisches VG
#> 4            LG Neubrandenburg
#> 5                StA München I
#> 6                   VG Hamburg
#> 7              AG Berlin-Mitte
#> 8                  OLG Dresden
#> 9                 LG München I
#> 10                        EuGH
#> 11                  LG Hamburg
#> 12                  AG München
#> 13                    AG Riesa
#> 14                  LG Rostock
#> 15                 LG Landshut
#> 16                OLG Naumburg
#> 17               OLG Schleswig
#> 18                 AG Dortmund
#> 19                  LG Koblenz
#> 20                  OLG Bremen
#> 21                          KG
ColinFay commented 6 years ago

Hi @IraRe

Thanks a lot for sharing, any bug report really helps :)

I've tried on my Mac here, and unfortunately couldn't reproduce the error.

Do you run into this issue only with Databricks notebook, or do you have the same error message if you're trying on an RStudio / R session ?

I'm quite confused about how to solve this error, as the con object calls httr::GET, the behavior should be the same 🤔 I'm digging into this and I'll let you know.

I'll run it on a Linux and will ask for Windows users, to see if anybody can reproduce the issue you're running into.

statnmap commented 6 years ago

@IraRe Can you verify if the last commit corrected your problem ?

IraRe commented 6 years ago

Hello @statnmap, well, yes it workes in the Databricks notebook now. So I assume, the issue is fixed. Thank you for that!

I still get the error on my local machine though. Probably due to the wrong "reinstall" of the package.

Just rerunning devtools::install_github("neo4j-rstats/neo4r") apparently doesn't uninstall the previously installed version. Do you know how can I do clean uninstall with devtools first, so that I could make a fresh installation of neo4r?

ColinFay commented 6 years ago

Hi @IraRe,

I'm glad to hear that the issue is resolved.

You can uninstall a package from R with remove.packages("neo4r"), then reinstall it with the devtools command you've mentioned.

Thanks again for reporting this bug,

Colin

ColinFay commented 6 years ago

Issue resolved, closing now.