activegraph
activegraph copied to clipboard
NoMethodError (undefined method `to_sym' for nil:NilClass) when fetching Node
Hi
I have an issue with fetching data - all operation like Model.first, Model.last, Model.find_by(name: 'some name') ends up with error NoMethodError (undefined method `to_sym' for nil:NilClass)
BUT when I copy/paste ActiveGraph::Core::Schema
from activegraph source code to my app and in application.rb I'm loading this code like this:
overrides = "#{Rails.root}/app/services/active_graph"
Rails.autoloaders.main.ignore(overrides)
config.to_prepare do
Dir.glob("#{overrides}/**/*.rb").each do |override|
load override
end
end
everything is working fine
label(keys, row)
from below's method is causing this error (only then I'm not including this code in my rails app)
def indexes
raw_indexes do |keys, result|
result.map do |row|
{ type: row[:type].to_sym, label: label(keys, row), properties: properties(row), state: row[:state].to_sym }
end
end
end
gem 'activegraph', '~> 10.1'
gem 'neo4j-ruby-driver', '~> 1.7', '>= 1.7.5'
I run neo4j db as a docker image
Do you know why could it be?
Might be related, activegraph
10 doesn't seem to support neo4j above 4.0. 😢
@michalkorzawski Is there any specific INDEX in DB which is causing this issue?
We are also running into this issue on Neo4j 4.4.0 (a co-workers instance), but I don't seem to have the issue running 4.2.1. We are going to attempt to downgrade to 4.2.12 on the co-workers instance.
I also ran into this issue and the underlying issue is the 2 seemingly default indexes in the neo4j db.
def label(result, row)
if v34?(result)
row[:label]
else
(v4?(result) ? row[:labelsOrTypes] : row[:tokenNames]).first # this code is accessing the first element of the index's empty labelsOrTypes array
end.to_sym
end
I'm not sure exactly what creates these indexes, if they're necessary/default etc? But these are in the default neo4j docker image database, and in my neo4j desktop generated db as well.
Should activegraph be able to assume these to be empty? / for the label to be nil?
Might be related,
activegraph
10 doesn't seem to support neo4j above 4.0. 😢
Any idea when it will? I'm having the same issue trying to connect to AuraDB and I'm DYING to use Neo4j in my Rails 7 app. Please help :)
Can I downgrade to a version that is supported with AuraDB? I have bolt installed too. Just can't figure this out.
I assume this has been fixed with https://github.com/neo4jrb/activegraph/pull/1669
Can I confirm that this gem is not supported on AuraDB with v4?
Using the connection string like: neo4j+s://XXX.databases.neo4j.io
throw:
Neo4j::Driver::Exceptions::ClientException: Unsupported URI scheme: neo4j+s
Is this only for JRuby and not MRI development?
@amitsuryavanshi switching to
gem
'activegraph', git: 'https://github.com/neo4jrb/activegraph', branch: '10'`
resolved this issue,
thank you