Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-275

Can not connect to AWS DocumentDB with Rust driver

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.2.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      OS: Fedora 31 X86_64
      Rust: cargo 1.42.0-nightly (ad3dbe10e 2020-01-13)
      rust mongodb: 0.9.0

      Hello, I can not connect to AWS DocumentDB using the new rust mongo driver.

      I fully understand that MongoDB does not make it a priority to be interoperable with AWS DocumentDB and that they are competitors, however I do not get to decide on the database backend we utilize and I have been tasked with working with AWS DocumentDB from rust.

      I am able to connect to DocumentDB over an SSH tunnel using the Python driver without issue.

      For example, in Python I have:

      uri: str = mongodb://redacted:redacted@localhost:27017/?tls=true&tlsCAFile=/redacted/rds-ca-2019-root.pem&tlsInsecure=true
      client: pymongo.MongoClient = pymongo.MongoClient(uri)
      for db_name in client.list_database_names():
          print(db_name)
      

      And this works fine to display our databases.

      However, in Rust, I have:

      Unable to find source-code formatter for language: rust. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      let uri: String = "mongodb://redacted:redacted@localhost:27017/?tls=true&tlsCAFile=/redacted/rds-ca-2019-root.pem&tlsInsecure=true".to_string();
      let client = Client::with_uri_str(&uri).unwrap();
      for db in client.list_database_names(None).unwrap() {
          println!("{}", db);
      }
      

       This eventually fails with the error:

      {{thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: ServerSelectionError

      { message: "timed out while trying to select server" }

      }', src/main.rs:31:15}}

      I've done a little big of digging, but haven't gotten very far. At a minimum, I can observe that select_server is not able to find any suitable servers. It appears that all servers have a description of "Unknown".

      I am happy to submit a PR and do some digging if anyone has any ideas as to the cause of this issue and where I might look.

      Your time is greatly appreciated and I look forward to working with you to resolve these issues. Please let me know if there is any other information I can provide. I have access to the rust mongo source and can debug from within it if needed.

       

            Assignee:
            isabel.atkinson@mongodb.com Isabel Atkinson
            Reporter:
            anthony.christe@gmail.com Anthony Christe
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: