Hi,
After changing a network environment, I cannot access mflix DB with the code in jupyter notebook, the pymongo client show below error:
‘---------------------------------------------------------------------------’
Timeout Traceback (most recent call last)
/anaconda3/envs/mflix/lib/python3.7/site-packages/pymongo/uri_parser.py in _get_dns_srv_hosts(hostname)
286 try:
–> 287 results = resolver.query(’_mongodb._tcp.’ + hostname, ‘SRV’)
288 except Exception as exc:
/anaconda3/envs/mflix/lib/python3.7/site-packages/dns/resolver.py in query(qname, rdtype, rdclass, tcp, source, raise_on_no_answer, source_port)
1131 return get_default_resolver().query(qname, rdtype, rdclass, tcp, source,
-> 1132 raise_on_no_answer, source_port)
1133
/anaconda3/envs/mflix/lib/python3.7/site-packages/dns/resolver.py in query(self, qname, rdtype, rdclass, tcp, source, raise_on_no_answer, source_port)
948 for nameserver in nameservers[:]:
–> 949 timeout = self._compute_timeout(start)
950 port = self.nameserver_ports.get(nameserver, self.port)
/anaconda3/envs/mflix/lib/python3.7/site-packages/dns/resolver.py in _compute_timeout(self, start)
857 if duration >= self.lifetime:
–> 858 raise Timeout(timeout=duration)
859 return min(self.lifetime - duration, self.timeout)
Timeout: The DNS operation timed out after 30.00463104248047 seconds
‘---------------------------------------------------------------------------’
But I’m able to connect to my mflix DB with both pymongo and mongoshell in MAC terminal. And restarting jupyter notebook doesn’t solve it.
Does jupyter notebook have some special settings related to DNS or network?
Thank you