cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

MongoDB Dependencies Causing Neo4j Malfunction

TK36
Node Clone

I am using Neo4j on a remote server (ubuntu 20.4) and would like to stream data from MongoDB to Neo4j. I followed the instructions here. I tried both ways by using the following approaches:

1) Use the following command:

sudo wget https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/tag/4.3.0.7/apoc-mongodb-dependencie... -O /mnt/neo4j/plugins/apoc-mongodb-dependencies-4.3.0.7.jar

Note that the plugins directory has a different path due to mounting. I changed the path in the configuration file accordingly. This should not be causing any problems because I had the same problem before mounting.

2) Use the following commands:

sudo wget https://repo1.maven.org/maven2/org/mongodb/mongo-java-driver/3.12.11/mongo-java-driver-3.12.11.jar -O /mnt/neo4j/plugins/mongo-java-driver-3.12.11.jar

sudo wget https://repo1.maven.org/maven2/org/mongodb/mongodb-driver/3.12.11/mongodb-driver-3.12.11.jar -O /mnt/neo4j/plugins/mongodb-driver-3.12.11.jar

sudo wget https://repo1.maven.org/maven2/org/mongodb/mongodb-driver-core/4.7.1/mongodb-driver-core-4.7.1.jar -O /mnt/neo4j/plugins/mongodb-driver-core-4.7.1.jar

sudo wget https://repo1.maven.org/maven2/org/mongodb/bson/4.7.1/bson-4.7.1.jar -O /mnt/neo4j/plugins/bson-4.7.1.jar

Note that I used the latest versions. I tried the versions available in the instructions as well with no difference in the outcome.

Now when restarting the neo4j.service, I no longer can access the cypher-shell nor the browser. In the first case, I get "connection refused", while I get a blank page in the browser case. When I check the status, the service is active and running. But I noticed that it is missing a line compared to when I don't have the dependencies.

  Starting...

 This instance is ServerId{#}

======== Neo4j 4.4.5 ======== (This line is missing with the dependencies downloaded!)

When I delete the dependencies from the plugins directory and restart, everything goes back to normal and functions as expected. One more thing to note is that other apoc procedures work just fine!

I don't know if I'm doing something wrong here or if there is some sort of underlying problem!

 

1 ACCEPTED SOLUTION

@giuseppe_villan 

After following your instructions and analyzing the debug.log file, I was able to identify the reason for the issue and I managed to resolve it. I truly appreciate your effort and patience throughout this time 🙂

Here is what caused the problem:

I found an error in the debug.log stating that the downloaded dependencies are corrupted. I then found this post and followed the solution mentioned. However, I noticed that the links I used  previously to download the dependencies were not the right ones. They have .../releases/tag/... instead of .../releases/download/...

Here is how I resolved it:

sudo curl -OL https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/4.4.0.8/apoc-mongodb-dependencies-4.4.0.8.jar 

sudo curl -OL https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/4.4.0.8/apoc-4.4.0.8-all.jar 

Then I added the following line to the neo4j.conf file and restarted:

dbms.security.procedures.unrestricted=apoc.trigger.*,apoc.*,algo.*

Now I can use the browser as expected, and the apoc.mongo procedures seem to work as well.

View solution in original post

6 REPLIES 6

@TK36 

If you still have the problem, which apoc version do you have?

And besides apoc. do you have any other plugins installed?

@giuseppe_villan 

Yeah, I still have the problem. I use apoc-4.4.0.3-core.jar and it's the only plugin installed

The "connection refused" error is weird indeed, anyway the apoc mongodb procedures requires APOC full to work, you can see for example in the page you linked initallly after the title:

mongo_apoc.png

so perhaps by installing an APOC full version you should solve the problem.

 

Secondly, as you can see, the mongo procedure you linked is "Deprecated". I'd suggest you use these procedures instead.

@giuseppe_villan 

Thank you for taking the time to look into this issue. I tried to install both apoc-4.4.0.3-all.jar and apoc-mongodb-dependencies-4.4.0.3.jar, and I removed apoc-4.4.0.3-core.jar.

I still experience the same problem. When I deleted apoc-mongodb-dependencies-4.4.0.3.jar from the plugins directory, the problem persisted. Then I deleted the apoc-4.4.0.3-all.jar and the browser worked for me!! 

I'm so confused and not sure why the .jar files cause this odd behavior!

@TK36 

Can you try using the latest apoc version (4.4.0.8)?

And, if it still does not work, can you try to insert in the neo4j.conf, the configuration "dbms.jvm.additional = -verbose: class" and, after restarting, share the "debug.log" and the "neo4j.log" you obtain?

@giuseppe_villan 

After following your instructions and analyzing the debug.log file, I was able to identify the reason for the issue and I managed to resolve it. I truly appreciate your effort and patience throughout this time 🙂

Here is what caused the problem:

I found an error in the debug.log stating that the downloaded dependencies are corrupted. I then found this post and followed the solution mentioned. However, I noticed that the links I used  previously to download the dependencies were not the right ones. They have .../releases/tag/... instead of .../releases/download/...

Here is how I resolved it:

sudo curl -OL https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/4.4.0.8/apoc-mongodb-dependencies-4.4.0.8.jar 

sudo curl -OL https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/4.4.0.8/apoc-4.4.0.8-all.jar 

Then I added the following line to the neo4j.conf file and restarted:

dbms.security.procedures.unrestricted=apoc.trigger.*,apoc.*,algo.*

Now I can use the browser as expected, and the apoc.mongo procedures seem to work as well.