terraform-provider-statuscake icon indicating copy to clipboard operation
terraform-provider-statuscake copied to clipboard

Intermittent/Non-Actionable Error in statuscake_uptime_check resource

Open fishfacemcgee opened this issue 1 year ago • 4 comments

Describe the bug When attempting to run terraform plan in a workspace that manages some statuscake_uptime_check resources, we will intermittently get failures that cause the plan to hard error. However, there's no information in the error to suggest a cause, let alone a solution.

Error: failed to get uptime check with ID: undefined response type: failed to deserialise error response

To Reproduce

This is an intermittent error so I don't expect reproduction to be easy/likely. Best guess would be an intermittent outage in the Statuscake API itself and/or an unclear rate limit. The workspace manages 5 uptime checks.

Expected behaviour

Either no error, or an error that actually tells us what's wrong.

Screenshots

Screenshot 2024-10-23 at 2 08 41 PM

Additional context

These plans run in an HCP Terraform environment, so getting any additional diagnostic information may be difficult, if not impossible.

fishfacemcgee avatar Oct 23 '24 18:10 fishfacemcgee

Looking at Statuscake's API docs, it appears especially likely that ratelimiting is the issue, in which case the problem is the Provider is not handling that properly.

fishfacemcgee avatar Oct 23 '24 18:10 fishfacemcgee

As far as the errors being unable to be deserialized, it looks like https://github.com/StatusCakeDev/statuscake-go/issues/37 may be related.

fishfacemcgee avatar Oct 23 '24 18:10 fishfacemcgee

Poking around the docs more, I see that the rate limit side of this is a misconfiguration on my end. I wouldn't have expected to need to configure retry logic on the provider settings, but it's at least something the provider allows for, even if it's not automatic. That leaves the remaining issue that the provider is displaying non-actionable errors and/or the API is providing response data in a way the Go SDK cannot handle properly (and therefore can't pass along actionable information to the provider to give to us).

Can confirm that adding

  retries     = 2
  min_backoff = 5
  max_backoff = 10

to my statuscake provider block resolves the errors I was receiving, confirming they were rate limit based.

fishfacemcgee avatar Oct 23 '24 18:10 fishfacemcgee

We're seeing this as well - even with the backoff etc.

mattjamesaus avatar Oct 30 '24 03:10 mattjamesaus

we are also seeing this with high backoff configured (we are using pulumi which wraps this tf module). we are running with this commit included: https://github.com/StatusCakeDev/terraform-provider-statuscake/commit/8c8717aa2755100b99c2de5ff750dde080b8b2b9

this is the error message which we're getting:

       statuscake:index:UptimeCheck api-hostname.example.com  error: statuscake:index/uptimeCheck:UptimeCheck resource 'api-hostname.example.com' has a problem: expected "name" to not be an empty string, got . Examine values at 'api-hostname.example.com.name'.
  
      statuscake:index:UptimeCheck api-hostname.example.com **failed** 1 error
      pulumi:pulumi:Stack gynzy-backend-nest-prod  
  
  Diagnostics:
    statuscake:index:UptimeCheck (api-hostname.example.com):
      error: statuscake:index/uptimeCheck:UptimeCheck resource 'api-hostname.example.com' has a problem: expected "name" to not be an empty string, got . Examine values at 'api-hostname.example.com.name'.
  
  Resources:
      37 unchanged
      1 errored
  
  Duration: 9s

is this the same error ? should i report this in https://github.com/StatusCakeDev/statuscake-go/issues/37 also ?

we often get this error though:

      	* failed to get uptime check with ID: 7751768, error:

i think this is also rate limit related :(

genisd avatar Dec 02 '25 14:12 genisd