PagerDuty / terraform-provider-pagerduty

Terraform PagerDuty provider
https://www.terraform.io/docs/providers/pagerduty/
Mozilla Public License 2.0
205 stars 210 forks source link

Error on Azure pipelines: connection reset by peer #416

Open ancspiir opened 2 years ago

ancspiir commented 2 years ago

Hi there,

we are getting Get "https://api.pagerduty.com/*": read tcp IP_address->IP_address: read: connection reset by peer error on every second run on Azure pipelines. This issue is not happening locally, only when running in the pipeline.

Pagerduty provider token is passed as pipeline variable: terraform plan -lock-timeout=30m -var PAGERDUTY_TOKEN=*** -out plan -detailed-exitcode

After refreshing many pagerduty states it is failing with connection reset by peer just for some.

##[error]Terraform command 'plan' failed with exit code '1'.
##[error]╷
│ Error: Get "https://api.pagerduty.com/teams/<id>": read tcp IP_address->IP_address: read: connection reset by peer
│ 
│   with module.<module_name>.<resource>.<name>,
│   on ../../../<name>.tf line 7, in resource "<resource>" "<name>":
│    7: resource "<resource>" "<name>" {

Terraform Version

Terraform: 1.0.2 PagerDuty provider: 1.10.0

Affected Resource(s)

Random terraform PagerDuty resources.

Steps to Reproduce

  1. Azure pipeline
  2. Store PAGERDUTY_TOKEN as variable
  3. terraform plan -lock-timeout=30m -var PAGERDUTY_TOKEN=*** -out plan -detailed-exitcode
  4. Run a second time if the first is successful.
stephanebruckert commented 2 years ago

These happen a lot!

mfmbarros commented 9 months ago

Was there any workaround for this? Happens a lot but not all the time and only on Azure Pipelines ( couldn't replicate the issue locally )

simontabor commented 6 months ago

This is happening frequently on GitHub Actions too. It's weird that this provider works so poorly via CI providers and perfectly fine locally - I assume there's an undocumented IP rate limit.

This is a major issue as when it crashes whilst creating a service Error: Post "https://api.pagerduty.com/services": read tcp 10.1.180.1:38038->35.163.146.4:443: read: connection reset by peer, the service is sometimes created but isn't present in the state, so re-running results in another error

POST API call to https://api.pagerduty.com/services failed 400 Bad Request. Code: 2001, Errors: [Name has already been taken], Message: Invalid Input Provided