Why can't mongomirror initiate connection to the destination source? [server selection timeout]

I want to migrate a database from one cluster to another. The source and destination are withing the same VPC, but I keep getting Unknown, Last error: connection() error occured during connection handshake error.

    mongomirror --host "Replicaset-Name/host-0.domain.com:27017,host-1.domain.com:27017,host-2.domain.com:27017" \
       --username "<username>" \
       --password "<password>" \
       --authenticationDatabase "admin" \
       --destination "Replicaset-Name/mongodb-0.mongodb-svc.mongodb.svc.cluster.local:27017,mongodb-1.mongodb-svc.mongodb.svc.cluster.local:27017,mongodb-2.mongodb-svc.svc.cluster.local:27017" \
       --destinationUsername "<username>" \
       --destinationPassword "<password>"

Output:

    mongomirror version: 0.12.5
    git version: 6e5a5489944845758420e8762dd5e5a89d2e8654
    Go version: go1.16.9
       os: linux
       arch: amd64
       compiler: gc
    2022-08-16T16:53:29.353+0000	Source isMaster output:  {IsMaster:true MinWireVersion:0 MaxWireVersion:7 Hosts:[host-0.domain.com:27017 host-1.domain.com:27017 host-2.domain.com:27017}
    2022-08-16T16:53:29.353+0000	Source buildInfo output: {Version:4.0.12 VersionArray:[4 0 12 0] GitVersion:5776e3cbf9e7afe86e6b29e22520ffb6766e95d4 OpenSSLVersion: SysInfo: Bits:64 Debug:false MaxObjectSize:16777216}
    2022-08-16T16:55:29.356+0000	Error initializing mongomirror: could not initialize destination connection: could not connect to server: server selection error: server selection timeout, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: mongo-1.mongo-svc.mongodb.svc.cluster.local:27017, Type: Unknown, Last error: connection() error occured during connection handshake: EOF }, { Addr: mongo-0.mongo-svc.mongodb.svc.cluster.local:27017, Type: Unknown, Last error: connection() error occured during connection handshake: EOF }, { Addr: mongo-2.mongo-svc.mongodb.svc.cluster.local:27017, Type: Unknown, Last error: connection() error occured during connection handshake: EOF }, ] }

I’ve tested the connection with mongosh. It has no issues while establishing the connection.

mongosh --host mongodb-1.mongodb-svc.mongodb.svc.cluster.local:27017 --username <username>

telnet mongodb-1.mongodb-svc.mongodb.svc.cluster.local 27017

So what might I have missed here?

Thanks!

Is your target an Atlas cluster?
Check below thread
The mongosh connection you have shown is connecting to only one node
What about connection to replicaset?
What does rs.status() show?

Hello Mongo Support,

We want to migrate our community mongo databases running on AWS to Atlas Cluster . Since it will be a different version movement(3.2 → 5.0) , We would like to make use of mongomirror utility to do a near to zero downtime migration.

However the mongo dbs on AWS are running on Docker containers.
What will be the exact syntax to specify the source host address .

/mongomirror --host replsetname\ip:port,ip:port,ip:port
–username xxxx
–password xxxx
–authenticationDatabase admin
–destination clusterxxx-shard-00-00.xxxx.mongodb.net:27017
–destinationUsername xxx
–destinationPassword xxx
–includeDB=xxx
–ssl
–forceDump

is giving me error
2023-08-08T12:31:09.332+0000 Error initializing mongomirror: could not initialize source connection: could not connect to server: server selection error: server selection timeout, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: xxx:27017, Type: Unknown, Last error: connection() error occured during connection handshake: EOF }, ] }

Any idea how to achieve this.
Thanks

What type is your cluster?
There are several restrictions like it cannot be free M0 or M2/M5 cluster
Are you giving correct cluster string?
For host you should pass all your replica host names.In the target/destination also you gave single hostname
Please go thru this link