mailjet-apiv3-python icon indicating copy to clipboard operation
mailjet-apiv3-python copied to clipboard

Transport endpoint is not connected

Open mehdiboutouzte opened this issue 1 year ago • 4 comments

Hello,

I'm using mailjet wrapper with python 3.7 on google cloud function, but i'm getting some times this error message :

"/layers/google.python.pip/pip/lib/python3.7/site-packages/mailjet_rest/client.py", line 113, in api_call raise ApiError(e) mailjet_rest.client.ApiError: ('Connection aborted.', OSError(107, 'Transport endpoint is not connected'))

mehdiboutouzte avatar Aug 17 '23 17:08 mehdiboutouzte

Yes I have the same issue mentioned. I don't think that the current code is compatible with up to python 3.6 at that point.

sahid avatar Sep 07 '23 11:09 sahid

I have stopped to use the python client and replaced it by requests. That works perfectly well now.

@mehdiboutouzte, if you only send emails, It's easy:

requests.post("https://api.mailjet.com/v3.1/send", json=data, auth=(api_key, api_secret))

sahid avatar Sep 22 '23 07:09 sahid

I have the same issue with python 3.7. The same code works utilizing a testing notebook in google vertex AI workbench, when I deploy and run utilizing a cloud function this error (the same error happens utilziing the request library)

Error; in send_emergency_mail_to_maintainers result = requests.post("https://api.mailjet.com/v3.1/send", json=data, auth=(API_KEY,API_SECRET)) File "/layers/google.python.pip/pip/lib/python3.7/site-packages/requests/api.py", line 115, in post return request("post", url, data=data, json=json, **kwargs) File "/layers/google.python.pip/pip/lib/python3.7/site-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, **kwargs) File "/layers/google.python.pip/pip/lib/python3.7/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/layers/google.python.pip/pip/lib/python3.7/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/layers/google.python.pip/pip/lib/python3.7/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', OSError(107, 'Transport endpoint is not connected'))

nchMrz avatar Sep 27 '23 07:09 nchMrz

I deployed an flask app on heroku and encountered the same error. Restarting the dyno fixes it so it must be some kind of a timeout error.

fruecker avatar Jan 09 '24 15:01 fruecker