Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Jonathan Linowes
@linojon
$ jruby -S rails generate scaffold User name:string email:string
2020-11-13T11:37:59.585-05:00 [main] WARN FilenoUtil : Native subprocess control requires open access to the JDK IO subsystem
Pass '--add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens java.base/java.io=org.jruby.dist' to enable.
2020-11-13T11:38:03.555-05:00 [main] WARN FilenoUtil : Native subprocess control requires open access to the JDK IO subsystem
Pass '--add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens java.base/java.io=org.jruby.dist' to enable.
      invoke  active_graph
   identical    app/models/user.rb
ArgumentError: Can not transliterate strings with Windows-1252 encoding
             transliterate at D:/jruby-9.2.13.0/lib/ruby/gems/shared/gems/activesupport-6.0.3.4/lib/active_support/inflector/transliterate.rb:67
              parameterize at D:/jruby-9.2.13.0/lib/ruby/gems/shared/gems/activesupport-6.0.3.4/lib/active_support/inflector/transliterate.rb:123
              parameterize at D:/jruby-9.2.13.0/lib/ruby/gems/shared/gems/activesupport-6.0.3.4/lib/active_support/core_ext/string/inflections.rb:196
  base_migration_file_name at D:/jruby-9.2.13.0/lib/ruby/gems/shared/gems/activegraph-10.0.1/lib/rails/generators/active_graph_generator.rb:15
       migration_file_name at D:/jruby-9.2.13.0/lib/ruby/gems/shared/gems/activegraph-10.0.1/lib/rails/generators/active_graph_generator.rb:19
        migration_template at D:/jruby-9.2.13.0/lib/ruby/gems/shared/gems/activegraph-10.0.1/lib/rails/generators/active_graph_generator.rb:40
         create_model_file at D:/jruby-9.2.13.0/lib/ruby/gems/shared/gems/activegraph-10.0.1/lib/rails/generators/active_graph/model/model_generator.rb:21
                       run at D:/jruby-9.2.13.0/lib/ruby/gems/shared/gems/thor-1.0.1/lib/thor/command.rb:27
            invoke_command at D:/jruby-9.2.13.0/lib/ruby/gems/shared/gems/thor-1.0.1/lib/thor/invocation.rb:127
                invoke_all at D:/jruby-9.2.13.0/lib/ruby/gems/shared/gems/thor-1.0.1/lib/thor/invocation.rb:134
                      each at org/jruby/RubyHash.java:1415
                       map at org/jruby/RubyEnumerable.java:886
                invoke_all at D:/jruby-9.2.13.0/lib/ruby/gem
Jacob Ablowitz
@jacob-ablowitz
Has anyone gotten libseabolt17 to install to a debian container? Alternatively, has anyone gotten it to install to a CentOS 8 container? Those are the two we've set up our app to run upon and I'm really not excited about trying to get "yet another" container platform working...
Tomasz Kapłon
@kapone89
Hello @klobuczek . 3.3.2020 you said that "the 1.7 drivers even the official ones do not support multiple databases, the driver can only access the default database. Java driver 4.0 can do it, but we are not at that level yet, seabolt does not support it. I have an open neo4j support ticket suggesting simple server side fix to that"
Could you please provide a link to this server side fix description because we can't find it? Or could you say something more about it? Thank you!
CC @ekampp
@jacob-ablowitz check that :
RUN apt-get install -y wget
RUN wget https://github.com/neo4j-drivers/seabolt/releases/download/v1.7.4/seabolt-1.7.4-Linux-ubuntu-18.04.deb
RUN dpkg -i seabolt-1.7.4-Linux-ubuntu-18.04.deb
RUN rm seabolt-1.7.4-Linux-ubuntu-18.04.deb
Heinrich Klobuczek
@klobuczek
@kapone89 I asked neo4j to allow the addtion of query parameter to the server url e.g. neo4j://neo01.graph.example.com?database=sales like they already do with routing context neo4j://neo01.graph.example.com?policy=europe (https://neo4j.com/docs/driver-manual/current/client-applications/#driver-routing-context) but they didn’t want to do it.
This was an internal support ticket.
Tomasz Kapłon
@kapone89
@klobuczek Thanks for your answer!
Tomasz Kapłon
@kapone89
@klobuczek I think that allowing to pass all the connection params via URL would be a nice feature. Postgres and many DBs support that and it simplifies the setup especially when someone uses Docker or Heroku.
Tomasz Kapłon
@kapone89
@klobuczek Hello! W are currently testing latest betas of activegraph and neo4j_java_driver. How can we connect to the different database than the default one? And are we able to switch between databases without reloading entire rails app? Thank you
Heinrich Klobuczek
@klobuczek
@kapone89 theoretically this should work. You will have to use explicit sessions and transactions. And you will not be able to interleave sessions between databases in the same thread. But sequential use on mutiple databases should be possible.
Heinrich Klobuczek
@klobuczek
how migrations would work is unclear to me at that moment. Multiple databases are fully supported on neo4j-java-driver gem, but on activegraph it is untested.
Tomasz Kapłon
@kapone89
Could you provide any link to documentation or sample code?
Heinrich Klobuczek
@klobuczek
@kapone89 we include something like that in our controllers not for the purpose of switching databases but to ensure causal cluster replication level. Every application using causal cluster should have something like that not neccessarily wrapping entire action but somewhere inside the action. You could have multiple such session blocks addressing different databases.
  included do
    around_action :wrap_in_session_or_transaction
  end

  def wrap_in_session_or_transaction
    ActiveGraph::Base.session(bookmarks: transaction_bookmarks) do
      wrap_in_transaction? ? ActiveGraph::Base.send(transaction_method) { yield } : yield
    end
    @last_bookmark = serialize_bk(ActiveGraph::Base.last_bookmark)
    auth_token_headers
  end
transaction_method is read_transaction or write_transaction. You need to specify this correctly to get the full benefit of causal cluster.
Ilgiz Mustafin
@imustafin

Hi. We have an array field in our nodes and I want to search by this field.

If I do Node.where(ar: [1, 2, 3]) the query is ... WHERE n.ar IN $ar..., how can I use the equality operator = instead of IN?

I tried making a custom type with a custom converter where to_db returned an array, but even then the query used IN but not =.

Heinrich Klobuczek
@klobuczek
where(’n.ar = $ar’, ar: [1,2,3])
Ilgiz Mustafin
@imustafin
Thanks. But what if I want to use this field as the id_property? Can I make Node.find work with arrays?
Heinrich Klobuczek
@klobuczek
Now you are crossing the line. Sounds like you have semantic composite keys. Rails with ActiveRecord took the approach of having single id field if necessary in addtion to the semantic keys. ActiveGraph follows the same approach. It should not be attempted to work around this by encoding the composite keys into single id field. Another aspect to consider is if neo4j would properly index such an array property, which I don’t know from the top of my head.
Ilgiz Mustafin
@imustafin
Actually we are trying to join several databases by this id. On one side we have MongoDB with BSON Binary ids, on the neo4j side we wanted to have the same ids but encoded as arrays of bytes. Maybe we are missing something...
Heinrich Klobuczek
@klobuczek
Whatever it is with ActiveGraph you would have create a node with a scalar property as primary key and you can add to the node the keys to other databases as additional properties.
Ilgiz Mustafin
@imustafin
I see. Thanks for the tips
Heinrich Klobuczek
@klobuczek
BTW neo4j has a ByteArray type so no need to encode that as array of bytes, but again I believe ByteArray properties cannot be index.
Johan André
@johanandre

Anyone else using Neo4j Aura with ActiveGraph? I got an email today saying:
"It seem you are using a Ruby driver (we believe via http://neo4jrb.io/ ) to connect to Aura and as you know unfortunately this driver is not part of the official Neo4j supported drivers certified to work well with Aura.
Note that this driver https://github.com/neo4jrb/activegraph#neo4j-version-support states that support for 4.1 and above are not supported and since Aura is running 4.2+ this is indeed an issue."

Anyone else got this?

Tomasz Kapłon
@kapone89
@klobuczek Thanks for help
Heinrich Klobuczek
@klobuczek
@johanandre Was this an unsolicited email?
And are you using seabolt driver or jruby driver?
Heinrich Klobuczek
@klobuczek
@johanandre who is the sender of that email? I’m trying to investigate with neo4j.
Johan André
@johanandre
@klobuczek it's from Neo4j Aura Support signed a guy named Pierre!
OpenCoderX
@OpenCoderX
I've recently had an issue where an association defined in an ActiveRel class and validated on the from_class like"validates :assoc, presence: true" fails, but when I remove the ActiveRel and replace with rel type defined on the from class the validation works. This is with version 9.6.2. Any similar experiences out there?
Johan André
@johanandre
@klobuczek any news about the neo4j aura compatibility? i'm using seabolt.
Yanny Andres Castrillon
@yannycastrillon
Have anyone integrated Administrate gem with Neo4j? Can someone point me in the right direction to approach this?. Thank you
Heinrich Klobuczek
@klobuczek
@johanandre if Aura can provide neo4j 4.2 only then there is no support for C-ruby at the moment. For C-ruby they would have to enable the option create 4.0 instances.
Johan André
@johanandre
@klobuczek i see. Do you know of any other service providing 4.0 instances? GrapheneDB?
Heinrich Klobuczek
@klobuczek
Yes, looks like GrapheneDB allows you to select the neo4j version.
Mark Fruhling
@mfruhling
Are nested attributes supported in ActiveGraph? A Google search turns up a result an old version of Neo4j::Rails, but I don't see the #accepts_nested_attributes_for anywhere in the ActiveGraph codebase.
Heinrich Klobuczek
@klobuczek
Yes looks like this issue neo4jrb/activegraph#1116 never resulted in a PR
hng
@hng:matrix.org
[m]
How can I edit/delete relationships? As I can have multiple relationships between the same node and relationships have no ID, I am confused as how I would do this.
1 reply
hng
@hng:matrix.org
[m]
yeah seems to work using neo_id
Duccio
@giovannelli
Anyone of you is using ruby3.0 with activegraph 10 and sidekiq and have trouble with concurrency? I've resolved applying this patch to the ruby driver (neo4jrb/neo4j-ruby-driver#47) but it seems there's something else there that needs to be addressed.
Heinrich Klobuczek
@klobuczek
@giovannelli where is your patch?
Duccio
@giovannelli
Hi @klobuczek, sorry I provided the wrong link, I used the temporary patch suggested by joshjordan here (https://github.com/joshjordan/neo4j-ruby-driver/tree/temp-disable-logging-fix-deadlock) and I see the threaded sidekiq process stop lingering. But looking at my queue, even with 10 threads running, only one is running adding nodes and relationship to the graph, the others are just in wait.
Heinrich Klobuczek
@klobuczek
that still depends how the worker code is organized, the workers are still subject to GVL and of course potential neo4j transaction locks
Duccio
@giovannelli
@klobuczek makes sense thank you. So probably the only viable way is to go with JRuby.
Heinrich Klobuczek
@klobuczek
@giovannelli well jRuby will not help with the neo4j locks if any and the common way of achieving true pralellism on MRI is through mutliple processes rather then threads. So in theory MRI with the driver patch should still be usable.
Duccio
@giovannelli
@klobuczek thank you. I'm investigating why the nodes creation is so slow in my case, just wondering if batch creation would help. I can't see any batch methods on the activegraph gem, in case I'll do a pull request!
Ilgiz Mustafin
@imustafin

In our project we faced some random freezes and decided to try jruby with neo4j-java-driver.

In the dev environment we use docker-compose with the Rails app and Neo4j 3.5 running in different containers.

In config/neo4j.yml I have

development:
  url: bolt://docker_neo4j:7687
  username: neo4j
  password: password

But I get

Invalid address format `bolt://docker_neo4j:7687`
/usr/local/bundle/gems/neo4j-java-driver-1.7.4-java/jruby/neo4j/driver/ext/exception_checkable.rb:18:in `check'
/usr/local/bundle/gems/neo4j-java-driver-1.7.4-java/jruby/neo4j/driver/ext/graph_database.rb:14:in `driver'
/usr/local/bundle/gems/neo4j-java-driver-1.7.4-java/lib/neo4j/driver/auto_closable.rb:16:in `block in driver'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/railtie.rb:75:in `setup!'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/railtie.rb:53:in `block in Railtie'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/base.rb:29:in `establish_driver'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/base.rb:19:in `driver'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/transactions.rb:37:in `send_transaction'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/transactions.rb:21:in `transaction'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/base.rb:33:in `query'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/core/schema.rb:20:in `constraints'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/model_schema.rb:35:in `model_constraints'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/model_schema.rb:131:in `each_schema_element'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/model_schema.rb:94:in `validate_model_schema!'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/base.rb:73:in `validate_model_schema!'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/base.rb:50:in `new_query'

This was working on MRI with neo4j-ruby-driver.

Interestingly, bolt://localhost:7687 works.

I tried bolt://neo4j:password@docker_neo4j:7687 and neo4j://docker_neo4j:7687, but they also give the same error

dimitriwoei
@dimitriwoei
Hi, I was wondering if there is a function to sanitize strings before passing them to activegraph, to prevent code injection?
Ken Lynch
@kendocode
Curious if anyone recognizes this error ActionView::Template::Error (code: `fff`, error: `13`, state: `4`, error_context: `secure_openssl_send(/tmp/seabolt/src/seabolt/src/bolt/communication-secure-openssl.c:469), SSL_write error code: 1, underlying error code: 0`):
Tomasz Kapłon
@kapone89
@klobuczek Hello,
Could you please release a new beta version of neo4j-java-driver based on the latest java driver jar?
Thank you :-)