Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-1940

Can`t connect with Unix socket

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 3.2.3
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:
      debian 9
    • MongoDB Version:
      4.0.0

      Description

      I try to connect mongo with Unix Domain Socket, but It prompts me my connection string has the problem.

      this.connection = await mongodb.connect('mongodb:///tmp/mongodb-27017.sock', { autoReconnect: true });
      

      Error: Unsupported host '/tmp/mongodb-27017.sock', hosts must be URL encoded and contain at most one unencoded slash
          at parseConnectionString (/app/node_modules/mongodb/lib/url_parser.js:243:11)
          at parseHandler (/app/node_modules/mongodb/lib/url_parser.js:129:14)
          at module.exports (/app/node_modules/mongodb/lib/url_parser.js:25:12)
          at deprecated (internal/util.js:71:15)
          at connect (/app/node_modules/mongodb/lib/operations/mongo_client_ops.js:195:3)
          at connectOp (/app/node_modules/mongodb/lib/operations/mongo_client_ops.js:284:3)
          at /app/node_modules/mongodb/lib/utils.js:433:24
          at new Promise (<anonymous>)
          at executeOperation (/app/node_modules/mongodb/lib/utils.js:428:10)
          at MongoClient.connect (/app/node_modules/mongodb/lib/mongo_client.js:175:10)
      
      

      I have followed the error description change my connection string to 'mongodb://%2Ftmp%2Fmongodb-27017.sock', but it still doesn`t work.

       

       

       

        Attachments

          Activity

            People

            Assignee:
            daniel.aprahamian Daniel Aprahamian (Inactive)
            Reporter:
            wujingtao wujingtao
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: