Skip to content

it can't connect correctly when admin password contains @ char  #130

@istrike

Description

@istrike

i both set auth and admin password using docker-compose.yml file down below,but it can't connect mongodb correctly

services:
  mongo-express:
    image: mongo-express:1.0-20-alpine3.19
    restart: always
    ports:
      - 8081:8081
    environment:
      - ME_CONFIG_MONGODB_SERVER=$ip
      - ME_CONFIG_MONGODB_PORT=$port
      - ME_CONFIG_MONGODB_ADMINUSERNAME=root
      - ME_CONFIG_MONGODB_ADMINPASSWORD="xxx@123"
      - ME_CONFIG_BASICAUTH_USERNAME=root
      - ME_CONFIG_BASICAUTH_PASSWORD="xxx@123"
      - ME_CONFIG_MONGODB_URL=mongodb://$ip:$port
MongoServerSelectionError: getaddrinfo EAI_AGAIN 123"
    at Timeout._onTimeout (/app/node_modules/mongodb/lib/sdam/topology.js:285:38)
    at listOnTimeout (node:internal/timers:581:17)
    at process.processTimers (node:internal/timers:519:7) {
  reason: TopologyDescription {
    type: 'Unknown',
    servers: Map(1) {
      '123":27017' => ServerDescription {
        address: '123":27017',
        type: 'Unknown',
        hosts: [],
        passives: [],
        arbiters: [],
        tags: {},
        minWireVersion: 0,
        maxWireVersion: 0,
        roundTripTime: -1,
        lastUpdateTime: 3885911706,
        lastWriteDate: 0,
        error: MongoNetworkError: getaddrinfo EAI_AGAIN 123"
            at connectionFailureError (/app/node_modules/mongodb/lib/cmap/connect.js:387:20)
            at Socket.<anonymous> (/app/node_modules/mongodb/lib/cmap/connect.js:310:22)
            at Object.onceWrapper (node:events:633:26)
            at Socket.emit (node:events:518:28)
            at emitErrorNT (node:internal/streams/destroy:169:8)
            at emitErrorCloseNT (node:internal/streams/destroy:128:3)
            at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
          cause: Error: getaddrinfo EAI_AGAIN 123"
              at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26) {
            errno: -3001,
            code: 'EAI_AGAIN',
            syscall: 'getaddrinfo',
            hostname: '123"'
          },
          [Symbol(errorLabels)]: Set(1) { 'ResetPool' }
        },
        topologyVersion: null,
        setName: null,
        setVersion: null,
        electionId: null,
        logicalSessionTimeoutMinutes: null,
        primary: null,
        me: null,
        '$clusterTime': null
      }
    },
    stale: false,
    compatible: true,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    setName: null,
    maxElectionId: null,
    maxSetVersion: null,
    commonWireVersion: 0,
    logicalSessionTimeoutMinutes: null
  },
  code: undefined,
  [Symbol(errorLabels)]: Set(0) {}
}

Node.js v20.18.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions