APOC: unavailable namespaces - neo4j

Just added apoc to a neo4j installation. As a result, got access to the namespaces apoc.coll and apoc.load only. Can't even do basic stuff like RETURN apoc.version().
The jar in the plugins directory contains much more than that, but in the localhost browser, I can't see anything but the above. Both apoc and neo4j version 3.3.
Before editing the config file, apoc was totally unavailable. Additions to config:
dbms.security.procedures.whitelist=apoc.coll.*,apoc.load.*
dbms.security.procedures.unrestricted=apoc.coll.*,apoc.load.*
dbms.security.procedures.whitelist=apoc.algo.*,apoc.atomic.*
dbms.security.procedures.unrestricted=apoc.algo.*,apoc.atomic.*
dbms.security.procedures.whitelist=apoc.trigger.*,apoc.meta.*
dbms.security.procedures.unrestricted=apoc.trigger.*,apoc.meta.*
dbms.security.procedures.whitelist=apoc.*
dbms.security.procedures.unrestricted=apoc.*
apoc.trigger.enabled=true
apoc.ttl.enabled=true
apoc.ttl.schedule=5
apoc.import.file.use_neo4j_config=true
apoc.import.file.enabled=true
apoc.export.file.enabled=true
# apoc.jdbc.<key>.uri=jdbc-url-with-credentials
# apoc.es.<key>.uri=es-url-with-credentials
# apoc.mongodb.<key>.uri=mongodb-url-with-credentials
# apoc.couchbase.<key>.uri=couchbase-url-with-credentials
apoc.jobs.scheduled.num_threads=number-of-threads
apoc.jobs.default.num_threads=number-of-threads
I added 'algo' and 'atomic' as an experiment, as I was thinking that I could see 'load' and 'coll' simply because they were declared in the config. But no - didn't help.
Restarted neo4j and rebooted the machine repeatedly.

Related

Embedded Neo4j APOC procedure apoc.load.json not working

I went through a couple of similar threads but none save my problem. I am running an embedded Neo4j instance (version 3.5, enterprise edition). When configuring DB I override plugin dir to location where I have my APOC jar (also 3.5 version).
Here is neo4j.conf file:
dbms.logs.debug.level=DEBUG
dbms.security.procedures.unrestricted=apoc.*
dbms.security.procedures.whitelist=apoc.*
apoc.export.file.enabled=true
apoc.import.file.enabled=true
I can confirm that configuration is correctly read upon database setup since on listing of configs (using dbms.listConfig()) I can confirm custom settings are present.
Issue occur upon running APOC procedure apoc.load.json:
Failed to invoke procedure `apoc.load.json`: Caused by: java.lang.RuntimeException: Import from files not enabled, please set apoc.import.file.enabled=true in your neo4j.conf
Also other APOC procedure (fore example apoc.util.validate works without issues).

Neo4J 4 + Apoc : Unable to set up injection for procedure 'Static'

Getting the following error on neo4j server startup with the apoc plugin.
Have copied the jar to the plugins folder.
Caused by:
org.neo4j.kernel.api.exceptions.ComponentInjectionException: Unable to
set up injection for procedure 'Static', the field 'apocConfig' has
type 'class apoc.ApocConfig' which is not a known injectable component
Neo4j version: 4.0.4
Apoc version: 4.0.0.13
What could be the problem?
I would suggest reviewing the installation procedure to see if you missed any steps,
https://neo4j.com/docs/operations-manual/current/installation/linux/
Also, double check the java version that neo4j is using, and check if there are any other local java environment factors specific to this install. class paths, other jars, etc.
We were having the same issue with neo4j 4.x and custom plugin folder.
Updating custom plugin folder in neo4j config didn't work, we had to add folder (or extension) into java CP (classpath) as well.
It worked in 3.x neo4j version without adding a folder into the classpath.
Try to make sure that you have plugins folder listed in -cp and might work for you.
Similar to Ilija's problem, our embedded database (using Eclipse with the Maven plugin) did not like our custom plugin folder.
Since the database was for setup and then deployment (effectively 2 separate things), we could move the database from the default Neo4j directory after it was setup.
As a test, you could delete the contents of your plugin folder and see if it works then.

Error when tring to execute apoc.refactor.mergeNodes

I have neo4j version server 3.5.18 and I've installed apoc version 3.5.0.11. I think that I have correctly modified the conf file in this way
dbms.directories.plugins=/Users/lx2pwnd/Desktop/dev/neo4j-community-3.5.18/plugins
...
dbms.security.procedures.unrestricted=algo.*,apoc.*
...
dbms.security.procedures.whitelist=apoc.coll.*,apoc.load.*
But when I try to execute a query which contains CALL apoc.refactor.mergeNodes(..) i get this error:
There is no procedure with the name `apoc.refactor.mergeNodes` registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.
What's wrong ?
I believe the plugins path needs to be relative to the neo4j installation directory. This is safer, since different neo4j versions can be installed simultaneously, and they may need different plugin versions.
Try changing the dbms.directories.plugins value back to plugins, putting the APOC jar file in the existing plugins directory under your neo4j installation directory, and restarting neo4j.

What is the location of the configuration file in Neo4J 3.0?

I have recently installed Neo4j 3.0, and since I need to enable outside access, I need the configuration file, and where in the 2.3.3 the configuration files were located in within the /var/lib/neo4j/ structure.
I am not able to locate them anywhere in the 3.0 version. I know it have changed name to neo4j.conf.
My folder structure in the above directory is:
plugins
import
data
certificates
I am running Ubuntu 16.04 (Xenial Xerus).
I have tried the documentation. However, that doesn't describe the location. I also already tried "find -name "neo4j.conf" without luck.
[UPDATED]
According to the 3.0.0 Operations Manual, the default location of the config file for "Debian" is:
/etc/neo4j/neo4j.conf

Start neo4j server with other configuration file

I try to start neo4j on OSX and change the chosen configuration file. I'd like to start a test server for unit tests with a different port and a database, which shall be deleted while startup (I will solve the deletion part in a shell script, which should stop and start the server).
My problem is neo4j ignores the configuration file from the parameter. My call looks like this (from the terminal and the current folder is bin:
./neo4j start -server -Dorg.neo4j.server.properties=conf/neo4j-server-test.properties
The default configuration file is still chosen.
Thanks for your help
There are no 'ad hoc' arguments to the neo4j command script, so your arguments after start are ignored. You need to either make a modified version of the neo4j command script, or swap out neo4j-server.properties files.
You can use ineo to manage two or more Neo4j instances:
https://github.com/cohesivestack/ineo
You can specify the path to a folder containing a customized configuration file with an environment variable:
NEO4J_CONF=../conf neo4j start

Resources