twilio / twilio-python

A Python module for communicating with the Twilio API and generating TwiML.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTTPSConnectionPool(host='chat.twilio.com', port=443): Max retries exceeded with url

kumarusa2020 opened this issue · comments

Issue Summary

Hello when running below code from a python rest api and invoked from a docker container receiving below error. Please let me know if it's a known issue and if any remedies

        client = Client(self.accountSid, self.accountAuthToken)
        user_data = client.chat.services(self.chatServiceID) \
            .users \
            .create(identity=identity)

Steps to Reproduce

used above code from docker container

Code Snippet

            client = Client(self.accountSid, self.accountAuthToken)
            user_data = client.chat.services(self.chatServiceID) \
                .users \
                .create(identity=identity)

Exception/Log

Unexpected error: HTTPSConnectionPool(host='chat.twilio.com', port=443): Max retries exceeded with url: /v2/Services/ISxxxxxxxxxxxxxxxxxxxxxxxx/Users (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f858c3e2a90>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))
^CINFO:     Shutting down

Technical details:

  • twilio-python version: twilio==6.46.0
  • python version: python:3.7

Hello @kumarusa2020,

It looks like you are facing a networking issue from within Docker. Please check out this thread for some possible solutions.

I'm closing this ticket because the exception is not directly related to this helper library.

With best regards,

Elmer

thank you, you are correct and I resolved the issue by altering docker network configuration.