1

I have deployed a ReactJS application with neo4j database on CentOS 7 server. Neo4j version is 4.4.2. The application also uses apoc library. So i added apoc-4.4.0.1-all.jar file to the /var/lib/neo4j/plugins directory on the server. Then i did following-

  1. chown neo4j:neo4j apoc-4.4.0.1-all.jar

  2. chmod 755 apoc-4.4.0.1-all.jar

  3. Modify /etc/neo4j/neo4j.conf file to

    • dbms.security.procedures.whitelist=apoc.coll.*,apoc.load.*,apoc.*

    • dbms.security.procedures.unrestricted=apoc.*

    • uncomment dbms.directories.plugins=/var/lib/neo4j/plugins

  4. systemctl restart neo4j

After deploying the project, when i open the application on the browser and insert some values in a form, it shows following error-

Unknown function 'apoc.map.submap' (line 3, column 14 (offset: 56)) " WHERE apoc.map.submap(properties(n), keys(obj), [], false) = obj" ^

Did i miss anything in apoc configuration ?

Raman
  • 17
  • 5

2 Answers2

0

Try changing the plugin directory from: /var/lib/neo4j/plugins to /var/lib/neo4j/graph.db/plugins directory then restart the neo4j server. You need to create the folder if not found.

If you install neo4j using an installer rather than download/untar/unzip a zipped/tar file; then neo4j server is looking at the apoc under default.graphdb folder

related: APOC is only partially installing its extension in neo4j (one procedure)

jose_bacoy
  • 12,227
  • 1
  • 20
  • 38
  • you mean plugin directory should be /var/lib/neo4j/graph.db/ ? – Raman Jan 13 '22 at 14:06
  • pls use this instead: /var/lib/neo4j/graph.db/plugins – jose_bacoy Jan 13 '22 at 14:07
  • i used RPM package to install neo4j on CentOS 7 server. – Raman Jan 13 '22 at 14:07
  • and what should be the access permission of the newly created files ? – Raman Jan 13 '22 at 14:16
  • i created new folders /var/lib/neo4j/graph.db/plugins and copied apoc-4.4.0.1-all.jar file into it. then updated dbms.directories.plugins=/var/lib/neo4j/graph.db/plugins in neo4j.conf file. then restarted with sudo service neo4j restart . but the error on the form is still there. – Raman Jan 13 '22 at 14:34
  • can you try this in the conf file? dbms.directories.plugins=plugins – jose_bacoy Jan 13 '22 at 14:44
  • i updated neo4j.conf to dbms.directories.plugins=plugins and restarted with 'sudo service neo4j restart'. but error is still there – Raman Jan 13 '22 at 14:56
  • i am still facing same error. apoc is not registered with neo4j community version. any clue ? – Raman Jan 14 '22 at 09:54
  • i don't know why this line (dbms.security.procedures.allowlist=) is missing in neo4j.conf file – Raman Jan 14 '22 at 15:04
0

The ownership of /var/lib/neo4j/data folder has to be neo4j, not root

Raman
  • 17
  • 5