Closed Paankajshah closed 1 month ago
Hi @Paankajshah ,
The following code in the lambda should result in a status 405 (method not allowed) from PagerDuty in the form of a urllib.error.HTTPError
:
import urllib.request
urllib.request.urlopen('https://events.pagerduty.com/v2/enqueue')
Otherwise, it might tell us more specifically what kind of connection error results.
One way or another I suspect something in the lambda's network or DNS configuration that caused this and not the routing key, based on the error message. If the routing key doesn't match the expected format, the response would be 400, and if it did match the format the response would be 202, either of which would elicit different messages from pdpyras.
Any luck reproducing the connection / DNS / etc error with urllib
?
Every time I run my AWS Lambda code, I encounter the following error:
[ERROR] PDClientError: POST https://events.pagerduty.com/v2/enqueue: Non-transient network error; exceeded maximum number of attempts (3) to connect to the API.
I am using AWS Lambda to trigger events in PagerDuty, however, I am consistently facing this error message. It seems to be related to a non-transient network error when attempting to connect to the PagerDuty API.
python version: 3.9 pdpyras versoin: 5.2.0
code:
this works fine in my local environment.