Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[loopback-connector-mongodb] 6.2.0, raise error "Invalid URL" when mongoDB is for cluster #665

Closed
mstiunicon opened this issue Apr 15, 2022 · 2 comments

Comments

@mstiunicon
Copy link

mstiunicon commented Apr 15, 2022

package.json

"loopback-connector-mongodb": "^6.2.0",

Logs:

Cannot start the application. TypeError: Cannot initialize connector "mongodb": Invalid URL
    at new NodeError (node:internal/errors:371:5)
    at onParseError (node:internal/url:552:9)
    at new URL (node:internal/url:628:5)
    at MongoDB.connect (xxxxxxxxxxx\node_modules\loopback-connector-mongodb\lib\mongodb.js:337:20)
    at Object.initializeDataSource [as initialize] (xxxxxxxxxx\node_modules\loopback-connector-mongodb\lib\mongodb.js:127:28)        
    at FeederDataSource.DataSource.setup (xxxxxxxxxx\node_modules\loopback-datasource-juggler\lib\datasource.js:515:19)

URL:
url =mongodb://admin:password@75a46762-47a8-477c-aaae-4c336442d784-0.databases.appdomain.cloud:32491,75a46762-47a8-477c-aaae-4c336442d784-1.databases.appdomain.cloud:32491,75a46762-47a8-477c-aaae-4c336442d784-2.databases.appdomain.cloud:32491/feeder?authSource=admin&replicaSet=replset&ssl=true&retryWrites=false&connectTimeoutMS=60000

image

I just create a simple test script to check the method "new URL(url)"
it raise same exception...

const url = "mongodb://admin:password@75a46762-47a8-477c-aaae-4c336442d784-0.databases.appdomain.cloud:32491,75a46762-47a8-477c-aaae-4c336442d784-1.databases.appdomain.cloud:32491,75a46762-47a8-477c-aaae-4c336442d784-2.databases.appdomain.cloud:32491/feeder?authSource=admin&replicaSet=replset&ssl=true&retryWrites=false&connectTimeoutMS=60000"
const urlObj = new URL(url)
console.log('urlObj=', urlObj)
@achrinza
Copy link
Member

Thanks for the report! It looks like this is a duplicate of #663. I'll proceed to close the issue in favour of #663.

If you believe this was done in error, please add a comment to re-open this issue.

@achrinza
Copy link
Member

Duplicate of #663

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants