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

Can`t connect with Unix socket

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.3
    • Component/s: Core
    • Environment:
      debian 9

      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.

       

       

       

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

              Created:
              Updated:
              Resolved: