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

Improve error message for "Connection pool cleared"

    • Type: Icon: Task Task
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • No version
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      OS: macOS Ventura 13.4.1
      node.js / npm versions:
      Additional info: Macbook Pro 16-inch, 2021, Apple M1 Pro, 16GB RAM. MongoDB Compass 1.38.2 (but issue has been happening in several past major versions at least as far back as 1.33)
    • 3
    • Not Needed
    • Iteration Fortitudo, Iteration Light Year, Iteration Neptune

      Problem Statement/Rationale

      Experiencing a frequent error when trying to connect to mongos via GCP IAP tunnel:
       
      An error occurred while loading instance info: Connection pool for localhost:27027 was cleared because another operation failed with: "connection <monitor> to 127.0.0.1:27027 closed" * This happens about 9 out of 10 times until it successfully connects.

      • Connecting on the command line via mongosh with the same connection string succeeds 100% of the time. Same for Studio 3T and JetBrains Goland (DB plugin).
      • Once successfully connected the error does not appear for the duration of the session.
      • I've tried changing a bunch of different connection settings to no effect. e.g. direction connection, socket/connect timeouts, wait queue time, heartbeat frequency, etc.

      Please be sure to attach relevant logs with any sensitive data redacted.

      Compass logs attached.

      Steps to Reproduce

      1. Set up Mongo on a GCP VM such that it's accessible via IAP, mongos is running on port 27018, and LDAP authentication is required.
      2. Set up the tunnel. I used something like this: gcloud --project my-project compute start-iap-tunnel mongo-vm 27018 --local-host-port=127.0.0.1:27027 --zone=northamerica-northeast1-b
      3. Use a connection string like the following: mongodb://myusername%40example.com:*****@localhost:27027/?readPreference=primary&ssl=false&authMechanism=PLAIN&authSource=%24external&directConnection=true
      4. Connect a few times

      Expected Results

      Successful connection

      Actual Results

      Most of the time it errors out.

      Additional Notes

      My workaround right now is to quickly open a bunch of Compass windows and flip through them all, connecting in each one, and then closing any that have errored out. This is annoying enough that most of my team have moved off Compass.

        1. SCR-20230706-nclu.png
          SCR-20230706-nclu.png
          103 kB
        2. compass-logs.json
          24 kB

            Assignee:
            Unassigned Unassigned
            Reporter:
            dv@glyphy.com D V
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: