-
Notifications
You must be signed in to change notification settings - Fork 725
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
Google API client breaks name resolution for paho in a docker context #529
Comments
I have a bug with a completely different context, a completely different setup, but the same symptoms. e.g. Paho sees a My issue: Azure/azure-iot-sdk-python#548 @wsw70 - how easily can you repro this issue? Correction: in your example, other objects in the current process are also able to resolve names, so it may be slightly different. |
I don't think this is related to my issue after all. Or, at least, it's not directly related. For your problem, I've been looking at the As to why this is broken in Docker and not outside docker, it's very possible that your outside-docker DNS resolver is different from your inside-docker DNS resolver. One possible way to fix your issue is to install nscd into your container. This should cache DNS entries and make this error less likely. reference: https://stackoverflow.com/a/19930436/6262999 |
I'm going to close this off due to age/inactivity. If you are still having issues (with the latest client) then please feel free to reopen. However it would be useful if you could confirm that |
My (home grade) code accesses the Google Calendar API and then publishes information it finds there to a MQTT bus.
It used to run as a service on my server and I decided to move it into a docker container (also on my server).
The problem I encounter is that calling the Google API libraries apparently breaks name resolution in paho when ran in a docker container.
The following code works OK when started from the command line of my server (keys and endpoints redacted)
In an MQTT explorer I see that the topic has been published to twice, with
before google
andafter google
, and the output isSo far, so good.
I then moved that code file into docker via the following
Dockerfile
:The build went fine but the program crashes with (this is the only log)
I do see that
testtopic
received a payload ofbefore google
, but the one after the Google API calls is not there anymore.socket.gaierror: [Errno -2] Name or service not known
suggests thatmqtt.mydomain
is not resolvable (I think).I added a
print(requests.get("http://google.com").status_code)
call after the Google API part and it works, so resolution is fine.It means that the resolution is broken only for paho MQTT.
The text was updated successfully, but these errors were encountered: