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

Aggregation with $out only runs after manually browsing target database

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.44.6
    • Component/s: None
    • Environment:
      OS: MacOS Sequoia 15.0
      node.js / npm versions: n/a
      Additional info: Latest Compass Version 1.44.6
    • 2
    • Developer Tools

      Problem Statement/Rationale

      I'm having trouble running an aggregation query containing an $out operation in Compass.

      My Compass environment includes various saved queries that we re-use across multiple environments. These primarily sync a collection from one database to another (e.g. DB1.somecollection -> DB2.renamedcollection).

      I'm only able to run the aggregation after manually browsing to both the source and target database/collection in Compass. Once this happens, the query succeeds (with popup warning like I expect). 

      The logs seem to indicate trouble listing collections in the source database when simply running the aggregation. If I browse to the source and target database/collections, then return to run the saved aggregation, it succeeds. 

      Please be sure to attach relevant logs with any sensitive data redacted.
      How to retrieve logs for: Compass; Shell

      I've attached a video showing the process of the error and how I managed to work around it. The attached log is from that same session.

      Steps to Reproduce

      Open a saved aggregation query with an $out pipeline operation to another database/collection in the same cluster.

      Try to run the aggregation.

      Expected Results

      A popup warning about the operation replacing the destination collection. Subsequently the aggregation to succeed.

      Actual Results

      Nothing happens in the Compass UI.

      Correlated error: 

      {"t":{"$date":"2024-11-14T15:06:11.850Z"},"s":"F","c":"COMPASS-MAIN","id":1001000294,"ctx":"app","msg":"Uncaught rejection: Cannot read properties of undefined (reading 'listCollections')","attr":{"message":"Cannot read properties of undefined (reading 'listCollections')","stack":"TypeError: Cannot read properties of undefined (reading 'listCollections')\n    at t.fetch (file:///Applications/MongoDB%20Compass.app/Contents/Resources/app.asar/build/index-bde52cb3.2f0acd92f5355c9bcb22.renderer.js:1:970032)\n    at e.forEach.<computed> [as fetch] (file:///Applications/MongoDB%20Compass.app/Contents/Resources/app.asar/build/index-bde52cb3.2f0acd92f5355c9bcb22.renderer.js:1:966205)\n    at t.fetchCollections (file:///Applications/MongoDB%20Compass.app/Contents/Resources/app.asar/build/index-5d3f7ed2.81c5203199e6311f61de.renderer.js:1:2147)\n    at e.forEach.<computed> [as fetchCollections] (file:///Applications/MongoDB%20Compass.app/Contents/Resources/app.asar/build/index-5d3f7ed2.81c5203199e6311f61de.renderer.js:1:663)\n    at t.getNamespace (file:///Applications/MongoDB%20Compass.app/Contents/Resources/app.asar/build/index-acf22cc3.774d6a2adedca6a02ec2.renderer.js:1:40294)\n    at async file:///Applications/MongoDB%20Compass.app/Contents/Resources/app.asar/build/index-bde52cb3.2f0acd92f5355c9bcb22.renderer.js:1:999538\n    at async file:///Applications/MongoDB%20Compass.app/Contents/Resources/app.asar/build/index-bde52cb3.2f0acd92f5355c9bcb22.renderer.js:1:999365"}} 

       

      Additional Notes

      Any additional information that may be useful to include.

        1. compass-error.mp4
          7.10 MB
        2. 673611d53302f956726a5d63_log
          151 kB

            Assignee:
            Unassigned Unassigned
            Reporter:
            tyler.mcentee@jona.health Tyler McEntee
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: