cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

IllegalArgumentException: requirement failed: Invalid uri

TonyLe
New Contributor

Hi all, 

I'm trying to connect to MongoDB using the Databricks notebook. I keep getting the error that my MongoDB uri is invalid. The uri works when connecting from my local machine using the Rust driver. I pretty much followed the tutorial that was given for MongoDB and Databricks.

Here are the things I've done/tried: 
- Made sure my scala and spark version matches up on the cluster with the Mongo-spark library. 
- Made sure to whitelist the ip of the cluster nodes.

Thank you

2 REPLIES 2

Ajay-Pandey
Esteemed Contributor III

Hi @TonyLe ,

Make sure mongoDB library should be installed and please refer below blog for your reference - 

MongoDB | Databricks on AWS

-werners-
Esteemed Contributor III

Also take in mind firewall issues in case the mongodb is on-prem or on some other location.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.