Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-4462

Connectivity exceptions are not caught in the connection form

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.31.0
    • Affects Version/s: None
    • Component/s: Connectivity
    • Labels:
      None
    • 5
    • Not Needed

      Some connection failures or authentication issues will break compass UI.

      There are exceptions that are shown after the connection screen and causes the user to be stuck on a blank screen (disconnect won't work either).

      To reproduce:

      Add this line to /etc/hosts

      127.0.0.1 mongodb-rs-1 mongodb-rs-2 mongodb-rs-3

      Start this docker-compose configuration:

      version: '2'
      
      services: 
        "mongodb-rs-1":
          image: "docker.io/bitnami/mongodb:4.4-debian-10"
          environment: 
            MONGODB_ADVERTISED_HOSTNAME: "mongodb-rs-1"
            MONGODB_REPLICA_SET_MODE: "primary"
            MONGODB_ROOT_PASSWORD: "password123"
            MONGODB_REPLICA_SET_KEY: "replicasetkey123"
            MONGODB_PORT_NUMBER: "27001"
          ports: 
            - "27001:27001"
      
        "mongodb-rs-2":
          image: "docker.io/bitnami/mongodb:4.4-debian-10"
          environment: 
            MONGODB_ADVERTISED_HOSTNAME: "mongodb-rs-2"
            MONGODB_REPLICA_SET_MODE: "secondary"
            MONGODB_REPLICA_SET_KEY: "replicasetkey123"
            MONGODB_PORT_NUMBER: "27002"
            MONGODB_INITIAL_PRIMARY_HOST: "mongodb-rs-1"
            MONGODB_INITIAL_PRIMARY_PORT_NUMBER: "27002"
            MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD: "password123"
          ports: 
            - "27002:27002"
      
        "mongodb-rs-3":
          image: "docker.io/bitnami/mongodb:4.4-debian-10"
          environment: 
            MONGODB_ADVERTISED_HOSTNAME: "mongodb-rs-3"
            MONGODB_REPLICA_SET_MODE: "secondary"
            MONGODB_REPLICA_SET_KEY: "replicasetkey123"
            MONGODB_PORT_NUMBER: "27003"
            MONGODB_INITIAL_PRIMARY_HOST: "mongodb-rs-1"
            MONGODB_INITIAL_PRIMARY_PORT_NUMBER: "27003"
            MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD: "password123"
          ports: 
            - "27003:27003"
      

      Try to connect to:

      mongodb://mongodb-rs-1:27001,mongodb-rs-1:27002,mongodb-rs-1:27003/db1?replicaSet=replicaset
      

       
      Since we are not passing credentials it will be able to connect but cause an issue immediately.

      Like this it connects:

      mongodb://root:password123@mongodb-rs-1:27001,mongodb-rs-2:27002,mongodb-rs-3:27003/db1?authSource=admin&replicaSet=replicaset&readPreference=primary&appname=MongoDB%20Compass&ssl=false
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            maurizio.casimirri@mongodb.com Maurizio Casimirri
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: