MongoDB connection problems

Hi,

We have detected some problems with 0.84 version for MongoDB node.

Currently, we have detected two problems:

  1. Connection string method

When chosing this method we get this sample


Database is below but it seems that is not appended to connection string. If we put database in connectionString, works.

Working:
Connection: mongodb://USER:PASSWORD@HOST:PORT/DATABASE
Database: WHATEVER

Not working
Connection: mongodb://USER:PASSWORD@HOST:PORT/
Database: WHATEVER

  1. Values

This case builds connection string by completed values but never works.

Could you check it please?

Thanks!

Hey @Miquel_Colomer!

I tried running the MongoDB node in 0.84.4 as well as 0.85.0 with the following Connection String and it did not give any error to me.

Connection String:
mongodb://USER:PASSWORD@HOST:PORT

This is what my credentials look like:

Can you please share what error did you get?

Thanks.

1 Like

Hi @harshil1712,

I have checked this. If I change config to your sample I get

User and password values are ok. If I add a connection string with this format
mongodb://USER:PASSWORD@HOST:PORT/DATABASE
authentication problem disappears.

Hey @Miquel_Colomer

I am not able to replicate the error. I tried it on three different versions - 0.84.4, 0.85.0, and 0.86.0 and it works on all these versions. I initially thought that this might be a issue with IP (you might not have whitelisted the IP) but since this mongodb://USER:PASSWORD@HOST:PORT/DATABASE connection string is working that possibility is ruled out.

Can you let me know the exact version you are using? Also, I would appreciate it if you could update n8n to a newer version and let me know if you’re still facing the issue. :slightly_smiling_face:

Hi @harshil1712,

n8n version is 0.86.0. Not sure if related but my Mongo version is 4.2.8.

It seems not a problem related with n8n node, but with authentication protocol applied by mongodb library when login at MongoDB server.

By the way, adding database at the end connection string fixes the issue.
Param values don’t work for me :frowning: