-
Notifications
You must be signed in to change notification settings - Fork 55
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
Unable to communicate to Mollie: : HTTPSConnectionPool(host='api.mollie.com', port=443): Max retries exceeded with url: /v2/payments/xxxxxx #339
Comments
That's odd. I'm a bit of a noob on both Azure and Python, but is there a way for you to confirm which stage exactly times out? I'm getting some DNS vibes, as we have a discussion around mysterious DNS problems in mollie/mollie-api-php#578 spanning multiple years now.
|
Which stage you mean? Thanks for your reply! |
Ah, sorry for being unclear. Do you have any way of identifying which step exactly fails, specifically whether it's the DNS lookup. The error message doesn't sound like it, but I want to be sure. |
Just to make sure that it's not a problem with Azure, could you verify that this only happens when sending a request to Mollie by sending a request to a different API? For quickly testing this, you could use https://httpbin.org/post to mimic a POST request. |
@hcvdwerf Any progress? The |
@fjbender We have the same issue since we upgraded from 2.12.0 to 3.6.0. Sometimes we get the said error when receiving a mollie webhook and the error happens exactly when we are try to fetch the related payment with
|
@sommejan @hcvdwerf Did you try the suggestion that @geertjanvdenbosch gave? What is the outcome when you run a script like the one below, in a similar environment as where you would create the payment at Mollie? import logging
import time
import requests
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s %(levelname)s %(name)s %(message)s",
)
start = time.monotonic()
resp = requests.post("https://httpbin.org/post", json={"foo": "bar"})
end = time.monotonic()
logging.info(f"HTTP response {resp} received after {end - start} seconds")
logging.info(f"HTTP response payload: {resp.json()}") Note that in the v3 client, a client timeout and retry mechanism was added. This should not interfere with a request to the Mollie API under normal conditions, but can be tuned if needed. |
@whyscream Yes, we don't have issues with other APIs. The script you provided got me a response received in 0.5265... seconds |
We have the exact same problem... When trying the call 10 times it might give the timeout 7 out of 10 and 3 times without a problem. Python 3.10.12 and mollie-api-python version 3.6.0.. We have so far been unable to pinpoint what the trigger might be for the timeout. @whyscream when trying the above mentioned code we also instantly get a successful response. Below our error code (tr_ was replaced with xxx) |
Hi, any updates on this issue? We are facing the same problem (mollie-api-python 3.6.0 and Python 3.12). Could not identify anything that causes that error on our side so far. Thanks in advance! |
Still relevant this issue I have the following packages installed (python 3.9)
|
Hi @hcvdwerf, It's related to the way Azure handles timeouts https://learn.microsoft.com/en-us/azure/firewall/firewall-faq#how-does-azure-firewall-handle-idle-timeouts. Could you try instantiating a new client each request? |
I' am not using Azure firewall, VNET and an Azure VM. App is just deployed on Azure web app |
Could you still try instantiating a new client for each request? It resolved the issue for multiple other users who where hosing on Azure. |
You mean imitate every time the following lines of code for each request:
That means no connection reuse Correct? |
Hi @hcvdwerf, Yes that's correct, no connection reuse (unless it's a call immediately following the previous one). |
In azure I am running a simple mollie api and I got the following error:
mollie.api.error.RequestError: Unable to communicate with Mollie: HTTPSConnectionPool(host='api.mollie.com', port=443): Max retries exceeded with url: /v2/payments/xxxx. (Caused by ReadTimeoutError("HTTPSConnectionPool(host='api.mollie.com', port=443): Read timed out. (read timeout=10)"))
The fist attempt nearly always fail. Second succeed. What happens here? See code snippet bellow:
` unique_id = str(ObjectId())
The text was updated successfully, but these errors were encountered: