zhaoyi0113 / mongodb-runner

Other
18 stars 5 forks source link

User issue with Mongo Cloud #115

Open cyrilcs-squad opened 4 years ago

cyrilcs-squad commented 4 years ago

Hi, When i try to connect to my mongo cloud without password TestWithoutPass in setting, after the password prompt, I got: MongoError: user is not allowed to do action [listCollections] on [test.] at queryCallback

but When I put my password in clear TestWithPass in the setting it's works, but not secure. could you help ?

"mongoRunner": {
    "connections": [
        {
            "name": "TestWithoutPass",
            "url":  "mongodb+srv://cluster0-xxx.mongodb.net/mydb?retryWrites=true&w=majority",
            "user": "user1"   
        }
     {
            "name": "TestWithPass",
            "url":  "mongodb+srv://user1:pass1@cluster0-xxx.mongodb.net/mydb?retryWrites=true&w=majority"       
        },
    ]
}

}

zhaoyi0113 commented 4 years ago

Thanks for reporting this issue. I haven't tested it against DNS SRV record. So it is likely doesn't work with the prefix mongodb+srv. Is it possible you use the standard protocol which is mongodb://? If it is still not working, can you please let me know your mongodb server version?

cyrilcs-squad commented 4 years ago

hi @zhaoyi0113 first i've to thanks you for this tools, and also for you quick answer i tried, but i got: MongoNetworkError: failed to connect to server

On using Mongo Atlas in the cloud --> MongoDB server version: 4.2.3

you can try the Mongo university server:

mongodb://m001-student:m001-mongodb-basics@cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/admin?replicaSet=Cluster0-shard-0&ssl=true

zhaoyi0113 commented 4 years ago

Hi @cyrilcs-squad , thanks for sharing the configuration. I am able to connect to the server as shown in below screenshot.

image

The setting I have is and I typed the password int the prompt.

{
                "name": "issue 115 no pwd",
                "url": "mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/admin?replicaSet=Cluster0-shard-0&ssl=true",
                "user": "m001-student"
            }

Can you check whether you have the same configuration as I have?