splunk / terraform-provider-splunk

Terraform Provider for Splunk
Mozilla Public License 2.0
104 stars 78 forks source link

Error: context deadline exceeded (Client.Timeout exceeded while awaiting headers) #41

Closed kwhitejr closed 3 years ago

kwhitejr commented 3 years ago

Attempting to create my first splunk_saved_searches via Terraform. Seems like Terraform is having trouble authenticating with Splunk. Terraform init, validate and plan work without issue. However, when attempting to apply, the creation step hangs for the length of the timeout and then errors to:

Error: Post "https://my-company.splunkcloud.com:8089/servicesNS/nobody/search/saved/searches?count=-1&output_mode=json": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

What headers does this error message refer to? Is it actually relevant or misdirection?

main.tf

terraform {
  backend "s3" {
    encrypt = true
    region   = "us-east-1"
  }

  required_providers {
    splunk = {
      source = "splunk/splunk"
    }
  }
  required_version = ">= 0.13"
}

provider "splunk" {
  url               = var.splunk_url               // my-company.splunkcloud.com:8089
  auth_token = var.splunk_auth_token // SECRET
}

resource "splunk_saved_searches" "TEST_OFR_Error_Report" {
  name = "test report"
  search = <<-EOF
        ...
        EOF
}

The Terraform DEBUG logs also provide this warning:

2020/11/24 15:07:02 [WARN] Provider "registry.terraform.io/splunk/splunk" produced an invalid plan for splunk_saved_searches.TEST_OFR_Error_Report, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .action_slack_param_attachment: planned value cty.StringVal("none") does not match config value cty.NullVal(cty.String)
      - .is_visible: planned value cty.True does not match config value cty.NullVal(cty.Bool)
      - .acl: attribute representing nested block must not be unknown itself; set nested attribute values to unknown instead
splunk_saved_searches.TEST_OFR_Error_Report: Creating...
2020/11/24 15:07:02 [DEBUG] EvalApply: ProviderMeta config value set
2020/11/24 15:07:02 [DEBUG] splunk_saved_searches.TEST_OFR_Error_Report: applying the planned Create change
2020-11-24T15:07:02.962-0800 [DEBUG] plugin.terraform-provider-splunk_v1.3.4: 2020/11/24 15:07:02 [DEBUG] setting computed for "acl" from ComputedKeys
splunk_saved_searches.TEST_OFR_Error_Report: Still creating... [10s elapsed]
splunk_saved_searches.TEST_OFR_Error_Report: Still creating... [20s elapsed]
splunk_saved_searches.TEST_OFR_Error_Report: Still creating... [30s elapsed]
splunk_saved_searches.TEST_OFR_Error_Report: Still creating... [40s elapsed]
splunk_saved_searches.TEST_OFR_Error_Report: Still creating... [50s elapsed]
2020/11/24 15:08:02 [DEBUG] splunk_saved_searches.TEST_OFR_Error_Report: apply errored, but we're indicating that via the Error pointer rather than returning it: Post "https://my-company.splunkcloud.com:8089/servicesNS/nobody/search/saved/searches?count=-1&output_mode=json": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
anushjay commented 3 years ago

Hi @kwhitejr The Splunk provider currently only supports the Splunk Enterprise version. At this time, Splunk Cloud is not supported but we are looking into it. Please upvote https://ideas.splunk.com/ideas/PLECID-I-195.

kwhitejr commented 3 years ago

@anushjay Thank you for the clarification! Any chance you have this issue available as a separate GitHub issue / feature request on this repo? I'd prefer not to have to go through the hassle of creating a user at ideas.splunk.com just to upvote a feature request; please accept my upvote to your comment as an honorary +1 :)

anushjay commented 3 years ago

@kwhitejr There is one actually - https://ideas.splunk.com/ideas/PLECID-I-195 Please upvote!