neo4j-rstats / neo4r

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

Problems with connection in Neo4r #45

Closed joseraymar closed 5 years ago

joseraymar commented 5 years ago

I have the same problem in Neo4r than others persons (I can't do the connection with Neo4J), I can connect my R session 3.5.2 in R studio 1.1.4 in to Ne4j host this is the error:

con <- neo4j_api$new(url = "http://localhost:7474", user = "neo4j", password = "neo4j") con$ping() "Error: Failed to connect to localhost port 7474: Connection refused"

I do the change in to connected function neo4j_api$new neo4j_api <- R6::R6Class("Neo4JAPI", public = list( url = character(0), user = character(0), password = character(0),....

but this doesn't work.

@ColinFay
@statnmap

ColinFay commented 5 years ago

Hey @joseraymar

Can you point out to the other person you are referring to?

What con$ping() does is testing if the API is reachable, using your ursername and password.

The error you get "Error: Failed to connect to localhost port 7474: Connection refused" says that R is not able to reach the Neo4J server. This might be because the server is not on that port, or because it is not running, or because you entered a wrong password / username.

Can you try :

library(httr)
GET("http://localhost:7474")
status_code(GET("http://localhost:7474"))

And give me the output ?

Also, is "neo4j" / "neo4j" your username / password?

What's your Neo4J version ?

joseraymar commented 5 years ago

thanks Colin for your fast answer the problem was the connection with neo4j, the company where I work had a lot of firewalls and security connections problems.

thanks for all. @ColinFay

stvrd commented 4 years ago

Hello, I got the same problem. When I run status_code() I get '407' (Title = Secure Web Gateway). How did you solve the issue with the firewall?

In the browser, I can open http://localhost:7474 without any problem.

MarianTie commented 4 years ago

Hello,

Iam using R Version 3.6.2, RStudio Version 1.2.5033 and Neo4j Desktop Version 1.2.4 (neo4j Browser 4.0.2).

Unfortunately I cant connect from R to my local neo4j graph.

I try to connect with:

con <- neo4j_api$new(
  url = "http://localhost:7474",
  user = "neo4j", 
  password = "neo4j"
)

The response on con$ping() is 404 and the connection object gives the information "No registered Connection (Wrong credentials or hostname)". I am sure that my username and password is correct and my graph is active in the neo4j desktop.

The execution of:

library(httr)
GET("http://localhost:7474")
status_code(GET("http://localhost:7474"))

gives the following output:

Response [http://localhost:7474]
  Date: 2020-02-12 11:59
  Status: 200
  Content-Type: application/json;charset=utf-8
  Size: 223 B
{
  "bolt_routing" : "neo4j://localhost:7687",
  "transaction" : "http://localhost:7474/db/{databaseName}/tx",
  "bolt_direct" : "bolt://localhost:7687",
  "neo4j_version" : "4.0.0",
  "neo4j_edition" : "enterprise"

Obviously there is a connection, although it is not working with the connection object con.

Furthermore, when i open http://localhost:7474 in my internet browser i receive the :server connect output:

You are connected as user neo4j
to bolt://localhost:7687

That is confusing, because it seems to be that iam connected with the bolt port. Maybe I have to change something in the configuration file!?

Iam new in the neo4j community and up to now not very experienced, does anybody has an idea? Thanks in advance for help, I would like to start working with neo4j from R as soon as possible :-)

Best regards Marian

@ColinFay

MarianTie commented 4 years ago

Thanks a lot @davidlrosenblum. It is working with the older Neo4j Version 3.5.14!

markjhill commented 4 years ago

I'm having the same issue as MarianTie above. Is the solution rolling back the version of Neo4j being used?

fBedecarrats commented 4 years ago

My understanding is that neo4r has not yet been updated for Neo4J 4.0, so we should use it with Neo4J 3.5 for now. The cypher statements sent by neo4r to Neo4J 4.0 are working, but some functions like ping() are not. You might want to follow-up on the recent open issues relating to this subject.

ghost commented 4 years ago

Anyone has an update on this. I am having the same problem and could not work it out.

davidlrosenblum commented 4 years ago

I have an update that is in progress at https://github.com/davidlrosenblum/neo4r/tree/4.x https://github.com/davidlrosenblum/neo4r/tree/4.x

It fixes support for 4.x.

The connection object is now

url, db, user, password, and isV4

connect <- neo4j_api$new(url = "http://localhost:7474", db = "neo4j", user = "neo4j", password = "password", isV4 = TRUE)

Set isV4 to false to use 3.5 db, it will ignore the db field at that point.

On Sep 10, 2020, at 12:53 AM, AprilSong0323 notifications@github.com wrote:

Anyone has an update on this. I am having the same problem and could not work it out.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/neo4j-rstats/neo4r/issues/45#issuecomment-689980033, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBXAGAOG2WUEQWVH4RICU3SFBLUJANCNFSM4GTZEKAA.

ghost commented 4 years ago

I have an update that is in progress at https://github.com/davidlrosenblum/neo4r/tree/4.x https://github.com/davidlrosenblum/neo4r/tree/4.x It fixes support for 4.x. The connection object is now url, db, user, password, and isV4 connect <- neo4j_api$new(url = "http://localhost:7474", db = "neo4j", user = "neo4j", password = "password", isV4 = TRUE) Set isV4 to false to use 3.5 db, it will ignore the db field at that point.

Thanks for your quick response. Much appreciated.

I tried the code with isV4, but returned result is Error in .subset2(public_bind_env, "initialize")(...) : unused argument (isV4 = TRUE)

I updated the neo4r package to using update.package(neo4r) still not working.

Any further help? Thanks in advance

davidlrosenblum commented 4 years ago

If you want to test my changes...

Did you use the method to load the package based on https://cran.r-project.org/web/packages/githubinstall/vignettes/githubinstall.html https://cran.r-project.org/web/packages/githubinstall/vignettes/githubinstall.html ?

You will need devtools installed

library(devtools)

The install from the 4.x branch of the repo is: install_github("davidlrosenblum/neo4r@4.x”)

library(neo4r) packageVersion('neo4r') [1] ‘4.0.0’

The package version will say 4.0.0 instead of 0.1.1 (CRAN) or 0.1.3 (rstats/neo4r)

Then a connection like this should work:

con2neo4j <- neo4j_api$new( url = "http://localhost:7474",db = 'neo4j', user = "neo4j",password = “what your password is”, isV4 = TRUE )

You will need to change the url, db, password, etc to what your values are.

I went to a new install of R, and tested this out set of commands out, seemed ok.

<>

On Sep 10, 2020, at 11:37 AM, AprilSong0323 notifications@github.com wrote:

I have an update that is in progress at https://github.com/davidlrosenblum/neo4r/tree/4.x https://github.com/davidlrosenblum/neo4r/tree/4.x https://github.com/davidlrosenblum/neo4r/tree/4.x https://github.com/davidlrosenblum/neo4r/tree/4.x It fixes support for 4.x. The connection object is now url, db, user, password, and isV4 connect <- neo4j_api$new(url = "http://localhost:7474 http://localhost:7474/", db = "neo4j", user = "neo4j", password = "password", isV4 = TRUE) Set isV4 to false to use 3.5 db, it will ignore the db field at that point. … <x-msg://19/#> Thanks for your quick response. Much appreciated.

I tried the code with isV4, but returned result is Error in .subset2(public_bind_env, "initialize")(...) : unused argument (isV4 = TRUE)

I updated the neo4r package to using update.package(neo4r) still not working.

Any further help? Thanks in advance

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/neo4j-rstats/neo4r/issues/45#issuecomment-690372515, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBXAGAJ5DMQJT2QFOT4UW3SFDXCHANCNFSM4GTZEKAA.

ghost commented 4 years ago

If you want to test my changes... Did you use the method to load the package based on https://cran.r-project.org/web/packages/githubinstall/vignettes/githubinstall.html https://cran.r-project.org/web/packages/githubinstall/vignettes/githubinstall.html ? You will need devtools installed library(devtools) The install from the 4.x branch of the repo is: install_github("davidlrosenblum/neo4r@4.x”) library(neo4r) packageVersion('neo4r') [1] ‘4.0.0’ The package version will say 4.0.0 instead of 0.1.1 (CRAN) or 0.1.3 (rstats/neo4r) Then a connection like this should work: con2neo4j <- neo4j_api$new( url = "http://localhost:7474",db = 'neo4j', user = "neo4j",password = “what your password is”, isV4 = TRUE ) You will need to change the url, db, password, etc to what your values are. I went to a new install of R, and tested this out set of commands out, seemed ok. <>

Thanks for your reply!

I was not using the right package and got the right one installed. I followed your step and I am using the 4.0.0 version now.

But when I tried the connect. The con$ping() returned Error: API error.

here is the code I used:

con <- neo4j_api$new( url = "http://localhost:7474",db = 'neo4r', user = "neo4j",password = "123", isV4 = TRUE )

note that I am not super clear what should I put in db=''. I am assuming that is the name of the database in Neo4j that I am trying to connect with.

I also tried

con <- neo4j_api$new( url = "http://localhost:7474",db = 'neo4j', user = "neo4j",password = "123", isV4 = TRUE ) where I changed my db name. the following con$ping() test did not return anything.

Any idea why this is the case?

(I had the database opened in neo4j and made sure I was using the right password. Another piece of information might help: in my neo4j connection status. it says: You are connected as user neo4j to bolt://localhost:7687 I tired 7687 as my url also, which did not work either. )

Thanks in advance.

davidlrosenblum commented 4 years ago

Hi,

db=“yourdbname”

In 4.x you get by default at least two databases. In community, this is the limit. Enterprise allows for many more depending on resource and conf settings. 1) system 2) neo4j

If you are using Neo4j Desktop, that uses Enterprise features and you can have more databases that you can go to the Neo4j Browser and create like this (could be any name, lower case, no punctuation) CREATE DATABASE statsdb

So if you just setup neo4j, and didn’t do anything db=’neo4j’ , if you wanted to access the statsdb you would use db = “statsdb"

Also that should be a comma between the port and db=

con <- neo4j_api$new( url = “http://localhost:7474 http://localhost:7474/” , db = "neo4j", user = "neo4j",password = "123", isV4 = TRUE )

I realize that it would be better if we could do all the system functions like create databases from the neo4r API, but we are trying to get 4.x databases to work in a basic way and then make improvements from there.

On Sep 10, 2020, at 8:50 PM, Apri

lSong0323 notifications@github.com wrote:

If you want to test my changes... Did you use the method to load the package based on https://cran.r-project.org/web/packages/githubinstall/vignettes/githubinstall.html https://cran.r-project.org/web/packages/githubinstall/vignettes/githubinstall.html https://cran.r-project.org/web/packages/githubinstall/vignettes/githubinstall.html https://cran.r-project.org/web/packages/githubinstall/vignettes/githubinstall.html ? You will need devtools installed library(devtools) The install from the 4.x branch of the repo is: install_github("davidlrosenblum/neo4r@4.x”) library(neo4r) packageVersion('neo4r') [1] ‘4.0.0’ The package version will say 4.0.0 instead of 0.1.1 (CRAN) or 0.1.3 (rstats/neo4r) Then a connection like this should work: con2neo4j <- neo4j_api$new( url = "http://localhost:7474",db http://localhost:7474%22,db = 'neo4j', user = "neo4j",password = “what your password is”, isV4 = TRUE ) You will need to change the url, db, password, etc to what your values are. I went to a new install of R, and tested this out set of commands out, seemed ok. <> … <x-msg://21/#> Thanks for your reply!

I was not using the right package and got the right one installed. I followed your step and the 4.0.0 version.

But when I tried the connect. The con$ping() returned Error: API error.

here is the code I used:

con <- neo4j_api$new( url = "http://localhost:7474",db http://localhost:7474%22,db = 'neo4r', user = "neo4j",password = "123", isV4 = TRUE )

note that I am not super clear what should I put in db=''. I am assuming that is the name of the database in Neo4j that I am trying to connect with.

I also tried

con <- neo4j_api$new( url = "http://localhost:7474",db http://localhost:7474%22,db = 'neo4j', user = "neo4j",password = "123", isV4 = TRUE ) where I changed my db name. the following con$ping() test did not return anything.

Any idea why this is the case? Thanks in advance.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/neo4j-rstats/neo4r/issues/45#issuecomment-690807453, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBXAGAQ7HM3YQJR3LTIYPTSFFX5DANCNFSM4GTZEKAA.

ghost commented 4 years ago

Hi, db=“yourdbname” In 4.x you get by default at least two databases. In community, this is the limit. Enterprise allows for many more depending on resource and conf settings. 1) system 2) neo4j If you are using Neo4j Desktop, that uses Enterprise features and you can have more databases that you can go to the Neo4j Browser and create like this (could be any name, lower case, no punctuation) CREATE DATABASE statsdb So if you just setup neo4j, and didn’t do anything db=’neo4j’ , if you wanted to access the statsdb you would use db = “statsdb" Also that should be a comma between the port and db= con <- neo4j_api$new( url = “http://localhost:7474 http://localhost:7474/” , db = "neo4j", user = "neo4j",password = "123", isV4 = TRUE ) I realize that it would be better if we could do all the system functions like create databases from the neo4r API, but we are trying to get 4.x databases to work in a basic way and then make improvements from there. Thanks for your response. I appreciate your help.

So, db=’neo4j’ in this case. I tried the following code again at my end and it's not working unfortunately.

con <- neo4j_api$new( url = "http://localhost:7474" , db = "neo4j", user = "neo4j",password = "123", isV4 = TRUE )

R returns nothing for con$ping()

any idea where went wrong?

Is url always "http://localhost:7474"? In my neo4j connection status. it says: You are connected as user neo4j to bolt://localhost:7687 I tired 7687 as my url also, which did not work either.

Thanks in advance.

davidlrosenblum commented 4 years ago

Save it to an object and test it

pingres <- con$ping()

On Sep 11, 2020, at 10:00 AM, AprilSong0323 notifications@github.com wrote:

Hi, db=“yourdbname” In 4.x you get by default at least two databases. In community, this is the limit. Enterprise allows for many more depending on resource and conf settings. 1) system 2) neo4j If you are using Neo4j Desktop, that uses Enterprise features and you can have more databases that you can go to the Neo4j Browser and create like this (could be any name, lower case, no punctuation) CREATE DATABASE statsdb So if you just setup neo4j, and didn’t do anything db=’neo4j’ , if you wanted to access the statsdb you would use db = “statsdb" Also that should be a comma between the port and db= con <- neo4j_api$new( url = “http://localhost:7474 http://localhost:7474/ http://localhost:7474/ http://localhost:7474/” , db = "neo4j", user = "neo4j",password = "123", isV4 = TRUE ) I realize that it would be better if we could do all the system functions like create databases from the neo4r API, but we are trying to get 4.x databases to work in a basic way and then make improvements from there. … <x-msg://22/#> Thanks for your response. I appreciate your help.

So, db=’neo4j’ in this case. I tried the following code again at my end and it's not working unfortunately.

con <- neo4j_api$new( url = "http://localhost:7474 http://localhost:7474/" , db = "neo4j", user = "neo4j",password = "123", isV4 = TRUE )

R returns nothing for con$ping()

any idea where went wrong?

Is url always "http://localhost:7474 http://localhost:7474/"? In my neo4j connection status. it says: You are connected as user neo4j to bolt://localhost:7687 I tired 7687 as my url also, which did not work either.

Thanks in advance.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/neo4j-rstats/neo4r/issues/45#issuecomment-691112380, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBXAGAYMOLPUR3N2GHOGJDSFIUP5ANCNFSM4GTZEKAA.

ghost commented 4 years ago

Save it to an object and test it pingres <- con$ping()

Thanks for your quick response.

code:

con <- neo4j_api$new( url = "http://localhost:7474" , db = "neo4j", user = "neo4j",password = "123", isV4 = TRUE ) test <- con$ping() test

return:

$error_code [1] "Neo.ClientError.Procedure.ProcedureNotFound"

$error_message [1] "There is no procedure with the name db.ping registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed."

davidlrosenblum commented 4 years ago

LOL - well - you have a live database there!

I see now that there is no db.ping() function for 3.5, there is for 4.x, you realize you are help me test!

Pls run

con$get_version()

On Sep 11, 2020, at 10:08 AM, AprilSong0323 notifications@github.com wrote:

Save it to an object and test it pingres <- con$ping() … <x-msg://24/#> Thanks for your quick response.

code:

con <- neo4j_api$new( url = "http://localhost:7474 http://localhost:7474/" , db = "neo4j", user = "neo4j",password = "123", isV4 = TRUE ) test <- con$ping() test

return:

$error_code [1] "Neo.ClientError.Procedure.ProcedureNotFound"

$error_message [1] "There is no procedure with the name db.ping registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed."

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/neo4j-rstats/neo4r/issues/45#issuecomment-691116727, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBXAGB4M2GKZSELI6PX55LSFIVN5ANCNFSM4GTZEKAA.

ghost commented 4 years ago

LOL - well - you have a live database there! I see now that there is no db.ping() function for 3.5, there is for 4.x, you realize you are help me test! Pls run con$get_version() On Sep 11, 2020, at 10:08 AM, AprilSong0323 @.***> wrote: Save it to an object and test it pingres <- con$ping() … <x-msg://24/#> Thanks for your quick response. code: con <- neo4j_api$new( url = "http://localhost:7474 http://localhost:7474/" , db = "neo4j", user = "neo4j",password = "123", isV4 = TRUE ) test <- con$ping() test return: $error_code [1] "Neo.ClientError.Procedure.ProcedureNotFound" $error_message [1] "There is no procedure with the name db.ping registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed." — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#45 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBXAGB4M2GKZSELI6PX55LSFIVN5ANCNFSM4GTZEKAA.

I closed my neo4j database so there is no live database running.

I tried the above code again. Here is the return:

Error in curl::curl_fetch_memory(url, handle = handle) : Failed to connect to localhost port 7474: Connection refused

We are supposed to have the database on right? the one we are trying to connect with.

davidlrosenblum commented 4 years ago

Yes - the database needs to be running.

On Sep 11, 2020, at 10:24 AM, AprilSong0323 notifications@github.com wrote:

LOL - well - you have a live database there! I see now that there is no db.ping() function for 3.5, there is for 4.x, you realize you are help me test! Pls run … <x-msg://25/#> con$get_version() On Sep 11, 2020, at 10:08 AM, AprilSong0323 @.***> wrote: Save it to an object and test it pingres <- con$ping() … x-msg://24/# Thanks for your quick response. code: con <- neo4j_api$new( url = "http://localhost:7474 http://localhost:7474/ http://localhost:7474/ http://localhost:7474/" , db = "neo4j", user = "neo4j",password = "123", isV4 = TRUE ) test <- con$ping() test return: $error_code [1] "Neo.ClientError.Procedure.ProcedureNotFound" $error_message [1] "There is no procedure with the name db.ping registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed." — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#45 (comment) https://github.com/neo4j-rstats/neo4r/issues/45#issuecomment-691116727>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBXAGB4M2GKZSELI6PX55LSFIVN5ANCNFSM4GTZEKAA https://github.com/notifications/unsubscribe-auth/AFBXAGB4M2GKZSELI6PX55LSFIVN5ANCNFSM4GTZEKAA.

I closed my neo4j database so there is no live database running.

I tried the above code again. Here is the return:

Error in curl::curl_fetch_memory(url, handle = handle) : Failed to connect to localhost port 7474: Connection refused

We are supposed to have the database on right? the one we are trying to connect with.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/neo4j-rstats/neo4r/issues/45#issuecomment-691125222, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBXAGAFVQK6B5FG2OAHXCDSFIXJPANCNFSM4GTZEKAA.

ghost commented 4 years ago

Yes - the database needs to be running.

any other thoughts?

davidlrosenblum commented 4 years ago

After you start Neo4j What does

con$get_version give you? How about x <- 'match (n) return count(n)' %>% call_neo4j(con,type="row") str(x)

On Sep 11, 2020, at 10:31 AM, AprilSong0323 notifications@github.com wrote:

Yes - the database needs to be running. … <x-msg://26/#> any other thoughts?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/neo4j-rstats/neo4r/issues/45#issuecomment-691129211, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBXAGC4FPPR2Z7G3SRYZWTSFIYDLANCNFSM4GTZEKAA.

ghost commented 4 years ago

code: con$get_version()

return: Error in curl::curl_fetch_memory(url, handle = handle) : Failed to connect to localhost port 7474: Connection refused

ghost commented 4 years ago

x <- 'match (n) return count(n)' %>% call_neo4j(con,type="row") Error in curl::curl_fetch_memory(url, handle = handle) : Failed to connect to localhost port 7474: Connection refused

str(x) Error in str(x) : object 'x' not found

ghost commented 4 years ago

it seems R is not connect with Neo4j.

davidlrosenblum commented 4 years ago

Hi,

I think there is some confusion here.

The database needs to be running. I don’t know where it is running, or the port. The defaults for your own computer are http://localhost:7474 http://localhost:7474/. If you set it up differently, you will need to change that. When you got the db.ping error, that while it is an “error” is a cypher error and your database and connection was 100% connected. Congratulations - you found a bug if you are connected to a 3.5 db. I guess it wouldn’t work if you connected to db=“system" either, but only certain commands work against that.

Before you do anything you need a connection object, so I am assuming you have run that.

If you want to attend a zoom session with me (I am a Neo4j Employee) I can see what the issue is in a few minutes, your choice.

On Sep 11, 2020, at 10:37 AM, AprilSong0323 notifications@github.com wrote:

code: con$get_version()

return: Error in curl::curl_fetch_memory(url, handle = handle) : Failed to connect to localhost port 7474: Connection refused

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/neo4j-rstats/neo4r/issues/45#issuecomment-691132812, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBXAGCOYTFG7666D6XTVQLSFIY2BANCNFSM4GTZEKAA.

ghost commented 4 years ago

Hi, I think there is some confusion here. The database needs to be running. I don’t know where it is running, or the port. The defaults for your own computer are http://localhost:7474 http://localhost:7474/. If you set it up differently, you will need to change that. When you got the db.ping error, that while it is an “error” is a cypher error and your database and connection was 100% connected. Congratulations - you found a bug if you are connected to a 3.5 db. I guess it wouldn’t work if you connected to db=“system" either, but only certain commands work against that. Before you do anything you need a connection object, so I am assuming you have run that. If you want to attend a zoom session with me (I am a Neo4j Employee) I can see what the issue is in a few minutes, your choice.

I would love a zoom session. It would be great if you could send me the zoom link either here or gmail if you prefer. (Aprilsong0323@gmail.com)

BJWiley233 commented 3 years ago

When I install with: remotes::install_github("davidlrosenblum/neo4r@4.x") I get a really old package version 0.2.0. Any idea why?

BJWiley233 commented 3 years ago

ok nevermind its just remotes::install_github("davidlrosenblum/neo4r") now. I guess we are waiting on API error fix? When I run con$ping() I get Error: API error

EDIT: sorry I had a BLONDE moment and didn't enter my password :)

davidlrosenblum commented 3 years ago

Hi

The consensus was the to reduce the version number to 0.2.0. I pushed my changes up to my master on GitHub at davidlrosenblum/neo4r.

The API error means you didn’t get a good (200) response. You can now look in con$last_error to see the error.
You will need to either fix your connection setup

Maybe the host, port, database us wrong, the database isn’t running, whatever.

You should verify that you can get to the database with your web browser. Try http://llocalhost:7474 http://llocalhost:7474/. (Replace the host and port with yours) , Then put in your user and password. If that doesn’t work, this connector can’t work either. Use Chrome, Firefox or New Edge (Please, no IE).

3.5 database con35 <- neo4j_api$new( url = "http://localhost:7474", user = "neo4j",password = “your password here”)

4.x database con40 <- neo4j_api$new( url = "http://localhost:7474", user = "neo4j",password = “your password", db = ‘optional database - defaults to neo4j’ )

If you are using Neo4j Community, you can most likely leave off the database, as it defaults to Neo4j.

On Oct 25, 2020, at 6:19 PM, BJWiley23 notifications@github.com wrote:

ok nevermind its just remotes::install_github("davidlrosenblum/neo4r") now. I guess we are waiting on API error fix?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/neo4j-rstats/neo4r/issues/45#issuecomment-716221610, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBXAGGLHT26PFPZM6RU43DSMSP6VANCNFSM4GTZEKAA.

billmclellan commented 2 years ago

Thank you for all of the above, very helpful. It now appears I have a valid connection. However, I am still getting an error related to the isV4 argument: Error in if (con$is_V4 == TRUE) { : argument is of length zero.

con <- neo4j_api$new(url = "http://localhost:7474", db = "onebridge", user = "neo4j", password = "onebridge", isV4 = TRUE) Error in initialize(...) : unused argument (isV4 = TRUE) con <- neo4j_api$new(url = "http://localhost:7474", db = "onebridge", user = "neo4j", password = "onebridge") #, isV4 = TRUE) con

Connected at http://localhost:7474 User: neo4j Neo4j database: onebridge Neo4j version: 4.4.3 str(con) Classes 'Neo4JAPI', 'R6' Public: access: function () auth: bmVvNGo6b25lYnJpZGdl clone: function (deep = FALSE) db: onebridge get_constraints: function () get_index: function () get_labels: function () get_property_keys: function () get_relationships: function () get_version: function () initialize: function (url, user, password, db = "neo4j") labels: data.frame major_version: active binding ping: function () print: function () relationships: data.frame reset_db: function (db) reset_password: function (password) reset_url: function (url) reset_user: function (user) url: http://localhost:7474 user: neo4j Private: password: ...

Some methods work fine, but others error:

con$ping() [1] 200 con$get_version() [1] "4.4.3" con$get_labels() Error in if (con$is_V4 == TRUE) { : argument is of length zero con$is_V4 NULL

sessionInfo() R version 4.1.2 (2021-11-01) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 22000) Actually I am on Windows 11 x64

Matrix products: default

Random number generation: RNG: Mersenne-Twister Normal: Inversion Sample: Rounding

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] ggraph_2.0.5 ggplot2_3.3.5 tidygraph_1.2.0 readxl_1.3.1 neo4r_0.2.0 remotes_2.4.2

loaded via a namespace (and not attached): [1] tidyselect_1.1.2 graphlayouts_0.8.0 purrr_0.3.4 colorspace_2.0-3 vctrs_0.3.8 generics_0.1.2 viridisLite_0.4.0 [8] htmltools_0.5.2 utf8_1.2.2 rlang_1.0.2 later_1.3.0 pillar_1.7.0 glue_1.6.2 withr_2.5.0
[15] DBI_1.1.2 tweenr_1.0.2 lifecycle_1.0.1 munsell_0.5.0 gtable_0.3.0 cellranger_1.1.0 labeling_0.4.2
[22] fastmap_1.1.0 httpuv_1.6.5 curl_4.3.2 fansi_1.0.2 Rcpp_1.0.8 xtable_1.8-4 promises_1.2.0.1
[29] scales_1.1.1 jsonlite_1.8.0 farver_2.1.0 mime_0.12 gridExtra_2.3 ggforce_0.3.3 digest_0.6.29
[36] ggrepel_0.9.1 dplyr_1.0.8 shiny_1.7.1 polyclip_1.10-0 grid_4.1.2 cli_3.2.0 tools_4.1.2
[43] magrittr_2.0.2 tibble_3.1.6 crayon_1.5.0 tidyr_1.2.0 pkgconfig_2.0.3 ellipsis_0.3.2 MASS_7.3-54
[50] data.table_1.14.2 attempt_0.3.1 viridis_0.6.2 assertthat_0.2.1 httr_1.4.2 rstudioapi_0.13 R6_2.5.1
[57] igraph_1.2.11 compiler_4.1.2

medseddik1999 commented 2 years ago

Hello , I have a same issue , when I run :

`install_github("davidlrosenblum/neo4r@4.x") library(neo4r) packageVersion('neo4r')

con2neo4j <- neo4j_api$new(url = "server http url", user = "neo4j",password = "my_paasword" ,db="graph.db",isV4 = TRUE) ` or

con2neo4j <- neo4j_api$new(url = "server http url", user = "neo4j",password = "my_paasword" ,db="graph.db",is_V4 = TRUE)

or

con2neo4j <- neo4j_api$new(url = "server http url", user = "neo4j",password = "my_paasword" ,db="graph.db",isv4 = TRUE)

I have this error : Error in initialize(...) : unused argument (isV4 = TRUE)

and the only way to have a connection I run con2neo4j <- neo4j_api$new(url = "server http url", user = "neo4j",password = "my_paasword" ,db="graph.db") without is_V4=TRUE but a lot of important method don't work as get_labels , get_relationship and I have this error :

Error in if (con$is_V4 == TRUE) { : argument is of length zero.

I have a MacBook and I tried the code in Rstudio cloud and is always a same problem