0

so I am trying to do some background job to run in my flask app , and in order to run the worker, I needed to use cygwin instead of my windows terminal. My application use MongoDb Atlas for documents storage and it works perfectly fine when I "flask run" it from my cmd . But I got the error once I run it or run the worker from cygwin. It is to note that I whitelisted my IP adress and installed the dnspython package , and still got the error. Any suggestions about what could be the problem? I don't seem to find any answer in previous asked questions . Thank you.

Adil Nouhail
  • 53
  • 1
  • 2
  • 4
  • not a programming questions so better to use SuperUser. You are not giving us nothing to help you anyway. What python ? Are you mixing cygwin python with settings for not Cygwin one ? Why do you need to run the application under Cygwin ? – matzeri May 09 '20 at 19:09
  • I am using python 3.7 , and Cygwin Terminal is used because 'RQ' package does not run on the Windows native Python interpreter .It can only be run under Unix emulation layer . – Adil Nouhail May 09 '20 at 21:44

2 Answers2

1

It's because of your dynamic DNS configuration from your ISP. make it static or you can use googleDNS server which is 8.8.8.8 or 8.8.4.4 as your DNS servers.

Akshay Salvi
  • 199
  • 2
  • 5
  • Man you just saved me. By the why would dynamic DNS config stop MongoDB Atlas to get connected? – Saurabh Mahra Dec 02 '21 at 17:07
  • 1
    I was wondering if you could expand on this? I'm having the same issue, but I can't figure out why its happening. I can connect to my DB Compass without issue. PyCharm can connect to my DB. but I get the same error above when I try to use pymongo via python script – keynesiancross Jun 13 '22 at 20:20
  • @keynesiancross were you able to resolve this? Pulling my hair out trying to troubleshoot. Thanks in advance! – Jay Aug 11 '23 at 18:45
0

I hit and resolved this same issue hit today w/ cygwin, python3.8, dnspython 1.16.0 by updating to dnspython 2.0.0 and ensuring there was a valid /etc/resolv.conf in place.

ramana
  • 1