Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConnectionFailed: Failed to connect to MongoDB #912

Open
AnuradhaGarje606 opened this issue Dec 4, 2020 · 0 comments
Open

ConnectionFailed: Failed to connect to MongoDB #912

AnuradhaGarje606 opened this issue Dec 4, 2020 · 0 comments

Comments

@AnuradhaGarje606
Copy link

I am trying to sync two mongodb services with replicasets. i.e. first service have 3 replicas and second service also have 3 replicas. So I want to sync all the data from first service to second service, which is giving below error.

`Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 425, in init
self._ensure_connected(True)
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1083, in _ensure_connected
self.__ensure_member()
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 957, in __ensure_member
member, nodes = self.__find_node()
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1048, in __find_node
raise AutoReconnect(', '.join(errors))
pymongo.errors.AutoReconnect: connection closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/mongo_connector/doc_managers/mongo_doc_manager.py", line 70, in init
self.mongo = pymongo.MongoClient(url, **kwargs.get("clientOptions", {}))
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 428, in init
raise ConnectionFailure(str(e))
pymongo.errors.ConnectionFailure: connection closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/mongo-connector", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.9/site-packages/mongo_connector/util.py", line 107, in wrapped
func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/mongo_connector/connector.py", line 1409, in main
conf.parse_args()
File "/usr/local/lib/python3.9/site-packages/mongo_connector/config.py", line 124, in parse_args
option.apply_function(
File "/usr/local/lib/python3.9/site-packages/mongo_connector/connector.py", line 1134, in apply_doc_managers
dm_instances.append(DocManager(target_url, **kwargs))
File "/usr/local/lib/python3.9/site-packages/mongo_connector/doc_managers/mongo_doc_manager.py", line 74, in init
raise errors.ConnectionFailed("Failed to connect to MongoDB")`

my config file contents are as below

`{
"mainAddress": "mongodb://$USERNAME:$PASSWORD@68******************-0.budep0g.databases.appdomain.cloud:31933,68*******-1.budep0g.databases.appdomain.cloud:31933,68*******-2.budep***********0g.databases.appdomain.cloud:31933/?authSource=admin&replicaSet=replset",
"verbosity": 3,

"docManagers": [
{
"docManager": "mongo_doc_manager",
"targetURL": "mongodb://$USERNAME:$PASSWORD@68******************-0.budep0g.databases.appdomain.cloud:31933,68*******-1.budep0g.databases.appdomain.cloud:31933,68*******-2.budep***********0g.databases.appdomain.cloud:31933/?authSource=admin&replicaSet=replset"
}
]
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant