Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Invalid character '<' looking for beginning of value #192

Closed
Gromkins opened this issue May 29, 2024 · 6 comments
Closed

[BUG] Invalid character '<' looking for beginning of value #192

Gromkins opened this issue May 29, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@Gromkins
Copy link

Gromkins commented May 29, 2024

What is the bug?

2024-05-29T14:38:10.367+0300 [ERROR] vertex "opensearch_index.test-simple-index" error: invalid character '<' looking for beginning of value

│ Error: invalid character '<' looking for beginning of value

How can one reproduce the bug?

resource "opensearch_index" "test-simple-index" {
name = "terraform-test"
number_of_shards = "1"
number_of_replicas = "1"
mappings = <<EOF
{
"properties": {
"name": {
"type": "text"
}
}
}
EOF
}

What is the expected behavior?

terraform could apply the change and create the index.

What is your host/environment?

terraform version = "1.8.4"
opensearch version = "2.2.1"

Do you have any screenshots?

image

image

Do you have any additional context?

the logs are recorded:

2024-05-29T14:38:09.838+0300 [WARN] unexpected data: registry.terraform.io/opensearch-project/opensearch:stderr="{"@caller":"github.com/hashicorp/terraform-plugin-sdk/[email protected]/internal/logging/helper_schema.go:21","@Level":"trace","@message":"Calling downstream","@module":"sdk.helper_schema","@timestamp":"2024-05-29T14:38:09.838292+03:00"}"
2024-05-29T14:38:09.844+0300 [INFO] provider.terraform-provider-opensearch_v1.0.0: 2024/05/29 14:38:09 [INFO] Pinging url to determine version https://localhost with timeout 5s: timestamp="2024-05-29T14:38:09.844+0300"
2024-05-29T14:38:10.358+0300 [WARN] unexpected data: registry.terraform.io/opensearch-project/opensearch:stderr="{"@caller":"github.com/hashicorp/terraform-plugin-sdk/[email protected]/internal/logging/helper_schema.go:21","@Level":"trace","@message":"Called downstream","@module":"sdk.helper_schema","@timestamp":"2024-05-29T14:38:10.357307+03:00"}"
2024-05-29T14:38:10.367+0300 [DEBUG] State storage *statemgr.Filesystem declined to persist a state snapshot
2024-05-29T14:38:10.367+0300 [ERROR] vertex "opensearch_index.test-simple-index" error: invalid character '<' looking for beginning of value

│ Error: invalid character '<' looking for beginning of value

│ with opensearch_index.test-simple-index,
│ on main.tf line 45, in resource "opensearch_index" "test-simple-index":
│ 45: resource "opensearch_index" "test-simple-index" {


2024-05-29T14:38:10.376+0300 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-05-29T14:38:10.382+0300 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/opensearch-project/opensearch/1.0.0/linux_amd64/terraform-provider-opensearch_v1.0.0 pid=226663
2024-05-29T14:38:10.382+0300 [DEBUG] provider: plugin exited

@Gromkins Gromkins added bug Something isn't working untriaged labels May 29, 2024
@rblcoder
Copy link
Collaborator

rblcoder commented Jun 3, 2024

The following code works for me

terraform {
  required_providers {
    opensearch = {
      source  = "opensearch-project/opensearch"
      version = "2.2.1"
    }
  }
}

provider "opensearch" {
  url         = "https://127.0.0.1:9200"
  healthcheck = "false"

  username = "admin"
  password = "myStrongPassword123@456"
  insecure = "true"

}

resource "opensearch_index" "test-simple-index" {
  name               = "terraform-test"
  number_of_shards   = "1"
  number_of_replicas = "1"
  mappings           = <<EOF
      {
      "properties": {
      "name": {
      "type": "text"
      }
      }
}
EOF
}


@rblcoder rblcoder removed the untriaged label Jun 3, 2024
@Gromkins
Copy link
Author

Gromkins commented Jun 4, 2024

image

image

The plan was succeed but terraform apply again appear the error with invalid character '<'.

Terraform v1.8.4
opensearch v2.2.1

@rblcoder
Copy link
Collaborator

rblcoder commented Jun 4, 2024

I am using the same terraform version and OpenSearch version 2.14.0

@Gromkins
Copy link
Author

Gromkins commented Jun 4, 2024

We're using self hosted open-search v 1.3.1 on cloud vm's. Could be this the reason?

@Gromkins
Copy link
Author

I tested it via 2.7.0. the same. one thing was another that i try to deploy to http://localhost not HTTPS.

@Gromkins
Copy link
Author

Tested via https:
image
It works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants