Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Romain
@RomainCavrot_gitlab

Hi, unfortunately I still haven't solved my problem.
I deleted my Gemfile.lock and restarted a bundle and now I have an error when bundling. This error occurs only when I run it the first time, if I restart it I don't get the error anymore.
Here is the error:

Installing neo4j-java-driver 4.3.0 (java)
Installing activemodel 6.1.4.1
  jar dependencies for neo4j-java-driver-4.3.0-java.gemspec . . .
Installing gem 'ruby-maven' . . .

using maven for the first time results in maven
downloading all its default plugin and can take time.
as those plugins get cached on disk and further execution
of maven is much faster then the first time.

unsupported Java version "16", defaulting to 1.7
[ERROR] Internal error: org.jruby.exceptions.RaiseException: (LoadError) library `java' could not be loaded: java.lang.reflect.InaccessibleObjectException: Unable to make protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException accessible: module java.base does not "opens java.lang" to unnamed module @3730ab42 -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: org.jruby.exceptions.RaiseException: (LoadError) library `java' could not be loaded: java.lang.reflect.InaccessibleObjectException: Unable to make protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException accessible: module java.base does not "opens java.lang" to unnamed module @3730ab42
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:121)
    ...
Caused by: org.jruby.exceptions.RaiseException: (LoadError) library `java' could not be loaded: java.lang.reflect.InaccessibleObjectException: Unable to make protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException accessible: module java.base does not "opens java.lang" to unnamed module @3730ab42
## Backtrace
Errno::ENOENT: No such file or directory - /PATH/vendor/jruby/2.5.0/gems/neo4j-java-driver-4.3.0-java/deps.lst
  org/jruby/RubyIO.java:1237:in `sysopen'
  org/jruby/RubyIO.java:3774:in `read'
  /PATH/.rbenv/versions/jruby-9.2.19.0/lib/ruby/stdlib/jars/installer.rb:69:in `load_from_maven'
  /PATH/.rbenv/versions/jruby-9.2.19.0/lib/ruby/stdlib/jars/installer.rb:235:in `install_dependencies'
  ...

It seems that there is a problem with the java version, which I find strange.
Did I miss something about the installation protocol?

Heinrich Klobuczek
@klobuczek
I think java 16 is not yet supported in 9.2.19.0, I use java 11.
rfurtad
@rfurtad
Is there any way to find network issues and neo4j? Well, when I'm using activegraph gem, latency for remote neo4j (it's on the same network) takes 500ms to return response, that's too much. But accessing neo4j via browser there is no slow response, and the same query returns result set in 15ms~20ms. I've been benchimarking and the piece of code that calls neo4j takes 480ms to run. Any hint for this issue?
Heinrich Klobuczek
@klobuczek
@rfurtad please provide some non private version of the “piece of code”.
rfurtad
@rfurtad

@klobuczek
I call

ActiveGraph::Base.query(cypher_query)
def cypher_query
    <<-CYPHER
      MATCH (d:Disciplina)-[r:EQUIVALE_A{idversaocurriculo: 1087, idalunocurriculo: 0}]->(d2:Disciplina)
      WITH d,r,d2, r.idequivalencia as idequiv
      RETURN idequiv, collect(d.iddisciplina) as disc_curr,
      collect(d2.iddisciplina) as disc_equiv
    CYPHER
  end

And it takes sometimes 710 ms to return a response. I'm using index on iddisciplina and this query returns 133 nodes only. Sometimes response take less time, maybe 200ms, but it never takes less than 100ms.

Heinrich Klobuczek
@klobuczek
Execute the query in rails console, you will see how long the cypher query alone takes.
Heinrich Klobuczek
@klobuczek
For me with no data the query takes 1 ms in the browser and 2-3 ms in rails console, consistently
Exactly the same with one matching relationship
rfurtad
@rfurtad
@klobuczek in console it was fast, the problem is when running application.
image.png
Heinrich Klobuczek
@klobuczek
on local neo4j server with activegraph 11
rfurtad
@rfurtad
I'm using activegraph 10
is activegraph 11 available to mri?
Heinrich Klobuczek
@klobuczek
shouldn’t make big difference
ah, well if you are using the ffi driver then it could
rfurtad
@rfurtad
I'm using gem 'neo4j-ruby-driver', it seems that use ffi driver
and seabolt
Heinrich Klobuczek
@klobuczek
but it is rather clear that it is related to some resource shortage if console is fast but rails server is not
rfurtad
@rfurtad
Yes. I'm gonna try increase some resources. This neo4j is using 8gb of ram and running in a container in enviroment production
@klobuczek , I'm gonna try increase resources, and thanks for the tips
Heinrich Klobuczek
@klobuczek
yes I’m pretty sure it is not activegraph nor driver
hng
@hng:matrix.org
[m]
We've got the problem that if the web app that uses neo4j via activegraph wasn't accessed for some time the first user accessing it again (e.g. in the morning) produces a "SessionExpiredException" error. After refreshing everything works again. I've tried settin keep_alive to true but that did not help. Any idea? Related, but we are not using a proxy: neo4jrb/activegraph#1633
Heinrich Klobuczek
@klobuczek
Yes you are right he driver should purge such stale connections, but it probably doesn’t. The problem with the ffi based driver is that it is based on seabolt (a discontinued c library). We are currently full hands writing pure ruby driver 4.4, so it will be very hard for us to look into that. I think the quickest solution would be apply something externally to keep the connection engaged. Sorry about that.
2 replies
David Adeyemi
@byFemi
Hi guys, in setting up; rake neo4j:migrate returns gives this error Neo4j::Driver::Exceptions::ServiceUnavailableException: Could not perform discovery. No routing servers available.
Using neo4jv 4.3.6 (which i had to download manually, the rake neo4j:install didn't work). I have confirmed that rake neo4j:start is working (navigated to localhost:7474)
30 replies
David Adeyemi
@byFemi
Hi, can a Relationship type be used by multiple Node types? e.g. from_class :Runner, :Biker
Jacob Ablowitz
@jacob-ablowitz
Yes
from_class :any
or to_class :any
I don't recall (and haven't tried) limiting it down to a set of specific Node types, but I know :all works (actively using in production)
@klobuczek sent you a PM - would like to reconnect on driver matters
Jacob Ablowitz
@jacob-ablowitz
@byFemi :point_up:
5 replies
newk67
@newk67
Hi, I'm moving from neo4j.rb v9 to active_graph v10. Is there native support for pagination in views or an additional gem I could leverage?
Heinrich Klobuczek
@klobuczek
in activegraph itself there is support for specifying offset (start) and size (limit) on every query
Heinrich Klobuczek
@klobuczek
you should be able to use the same pagination as with neo4j gem if you had one
newk67
@newk67
i was using kaminari-neo4j, which is setup to work only with the neo4j.rb v9+ gem. i modified the kaminari-neo4j locally to work with activegraph but am getting an error when attempting to use the 'page' method on the ActiveGraph::Node::Query::QueryProxy results in a controller.
Heinrich Klobuczek
@klobuczek
@newk67 looked at that gem, should be easy to adapt it to activegraph. We cannot help hands on ourselves, but if you need support in figuring out things and bringing that gem up to speed then post here the exact errors and questions. Try to trigger the errors in specs rather than in your app or even better set up github actions on your fork of the gem so we can directly look at the errors.
Wojciech Maciejak
@wmaciejak

Hello. Is there any way to create a property in our model which will be overriden by method?
Imagine this one:

class User
  include Neo4j::ActiveNode

  property :custom_property

  def custom_property
    "custom string"
  end
end

Is this possible to make this code operational?

Heinrich Klobuczek
@klobuczek
@wmaciejak what do you want to achieve? Are you just having a name conflict? Have you looked at UndeclaredProperties module?
Wojciech Maciejak
@wmaciejak
To be honest I did not heard about it :( Generally I want to have kinda "virtual attribute" which will be vissible in object representation, but won't be stored in DB - something like attribute generated on the fly. It looks like UndeclaredProperties module should fulfill my requirements
Thanks @klobuczek will prepare a test drive
Wojciech Maciejak
@wmaciejak

Well. I've tried hard, but unfortunately undeclared properties are available when we explicitely fetch them, by running user[:custom_property]. I would like to add virtual property to object representation like here:

user = User.create(name: "Wojciech")
user
=>  #<User name: "Wojciech", custom_property: "custom string" >

In general I'm not sure if it's possible, just considered that maybe there is some way to make some magic around.

Heinrich Klobuczek
@klobuczek
With custom_property being saved in database or just present in the object?
Heinrich Klobuczek
@klobuczek
in case it’s the latter attr_reader?
Wojciech Maciejak
@wmaciejak
Hmm, could you elaborate how attr_reader can help me here? 🤔
Heinrich Klobuczek
@klobuczek
Sorry I missed one of your answers. But am still wondering. If you don’t want to store custom_property don’t declare a property for it. Everything else is basic ruby.
attr_reader :custom_property

def initialize(*args)
  super
  @custom_property = ‘custom string’
end
rfurtad
@rfurtad
A new version of neo4jrb will be relesead for neo4j 4.3?
Heinrich Klobuczek
@klobuczek
there is already activegraph 11 and neo4-java-driver 4.3 only for jruby, once we release neo4j-ruby-driver 4.4 activegraph 11 will start working on MRI
Johan André
@johanandre
Is there any estimate when that would be?
Heinrich Klobuczek
@klobuczek
We set our goal for end of year but this doesn’t look very doable now.
rfurtad
@rfurtad
Does anyone know what happens to Neo4jDriver session get expired? I got this error:
Neo4j::Driver::Exceptions::SessionExpiredException: code: fff, error: 4, state: 4, error_context: `plain_socket_send(/tmp/seabolt/src/seabolt/src/bolt/communication-plain.c:231), send error code