Skip to content

Mongoose 5.2.0 fails to connect to an URL which specifies a DNS SRV record #6656

@ivanpadalko

Description

@ivanpadalko

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Mongoose returns an error when attempting to connect to an URL of the likes of: mongodb+srv://username:password@host/database

Error message:

{ MongoError: seed list contains no mongos proxies, replicaset connections requires the parameter replicaSet to be supplied in the URI or options object, mongodb://server:port/db?replicaSet=name
    at connectCallback (/var/app/current/node_modules/mongodb/lib/operations/mongo_client_ops.js:236:23)
    at process.nextTick.err (/var/app/current/node_modules/mongodb/lib/operations/mongo_client_ops.js:436:7)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickDomainCallback (internal/process/next_tick.js:128:9)
  name: 'MongoError',
  message: 'seed list contains no mongos proxies, replicaset connections requires the parameter replicaSet to be supplied in the URI or options object, mongodb://server:port/db?replicaSet=name' }

Possibly related to the issue: #6651

If the current behavior is a bug, please provide the steps to reproduce.

const mongoose = require('mongoose');

mongoose.connect('mongodb+srv://user:password@host/database');

What is the expected behavior?

Mongoose should connect normally to this URL

Please mention your node.js, mongoose and MongoDB version.
Node: 9.11.1
Mongoose: 5.2.0
MongoDB: 3.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions