terraform-provider-opensearch
terraform-provider-opensearch copied to clipboard
[BUG] Error: invalid character 'U' looking for beginning of value when basic auth credentials are incorrect
What is the bug?
It appears that the plugin does not handle basic authentication errors gracefully. If invalid credentials are provided there is a confusing error message.
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: invalid character 'U' looking for beginning of value
I haven't looked into the code at all but this appears to be an issue where the code expects valid JSON.
How can one reproduce the bug?
Specify an incorrect username and password with the following provider configuration:
provider "opensearch" {
url = "..."
username = "..."
password = "..."
healthcheck = false
sign_aws_requests = false # Must be set for basic auth
}
What is the expected behavior?
I would expect to see a more helpful error message
It appears this happens when health checking is disabled. If health checking is enabled, a 401 is returned.
[Untriage]
Thanks @Sovietaced, there are some PR's went in with fix related to basic auth https://github.com/opensearch-project/terraform-provider-opensearch/pull/87 https://github.com/opensearch-project/terraform-provider-opensearch/pull/76, I dont think they fix this invalid character
error, can you please take a look and contribute if its a quick fix?
Thanks
Adding @bbarani @rblcoder
[Untriage] Thanks @Sovietaced, there are some PR's went in with fix related to basic auth #87 #76, I dont think they fix this
invalid character
error, can you please take a look and contribute if its a quick fix? Thanks Adding @bbarani @rblcoder
Yeah, I will try taking a look at this and report what I find.
Thanks @rblcoder, @Sovietaced closing this issue, please feel-free to re-open or add comments if required. Thank you