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

Segmentation violation error instead of a "wrong credentials" message when trying to apply with an invalid token

Open christianbrideau opened this issue 3 years ago • 1 comments

Terraform Version

Terraform v1.0.11 on linux_amd64

Affected Resource(s)

  • pagerduty_user
  • pagerduty_team
  • Probably others

The problem occurs when trying to apply using a bad token.

Terraform Configuration Files

terraform {
  required_providers {
    pagerduty = {
      source = "PagerDuty/pagerduty"
      version = "2.1.1"
    }
  }
}

provider "pagerduty" {
  token = "any_incorrect_token"
}

resource "pagerduty_user" "muser" {
      name  = "Mister User"
      email = "[email protected]"

}

Debug Output

https://gist.github.com/christianbrideau/7af93697c93092e7b6e36a55bcb12c62

Panic Output

No crash.log file created.

Expected Behavior

Expecting a message of type "access denied" or "wrong credentials" when a bad token is used (missed a character when copying/pasting).

Actual Behavior

Getting a segmentation fault error. I can see the access denied message, but only when turning on debugging. This sent me on a wild goose chase to find out why it segfaulted. Tried different versions of Terraform, the provider and operating system, when it was just me not being able to do a copy/paste correctly.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Use the config file from above.
  2. Use a wrong token.
  3. terraform apply

Important Factoids

This was done on a sandbox account.

References

No

christianbrideau avatar Nov 18 '21 19:11 christianbrideau

This may now be addressed as part of #458, released as part of 2.3.0.

In this particular case the error message should now be surfaced rather than causing a segfault.

dobs avatar Feb 11 '22 18:02 dobs