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] Error: opensearch version 2.5.0 is older than 6.0.0 and is not supported, flavor: 0. #36

Closed
komgritz opened this issue Apr 18, 2023 · 13 comments
Assignees
Labels
bug Something isn't working

Comments

@komgritz
Copy link

What is the bug?

Error: opensearch version 2.5.0 is older than 6.0.0 and is not supported, flavor: 0.

How can one reproduce the bug?

1.Provisioning AWS Opensearch version 2.5.0.
2.Create some resource with terraform.
Example
resource "opensearch_index_template" "log_aws_default" { count = var.environment == "prod" ? 1 : 0 name = "log-aws_default" body = <<EOF { "index_patterns": [ "log-aws-*" ], "order": 0, "settings": { "index": { "number_of_shards": "1", "number_of_replicas": "1" } }, "mappings": { "_source": { "enabled": true } }, "aliases" : { "log-aws": {} } } EOF }
3. Run terraform apply.

What is the expected behavior?

Terraform apply all resources successfully.

What is your host/environment?

AWS Opensearch version 2.5.0.

Do you have any screenshots?

│ Error: opensearch version 2.5.0 is older than 6.0.0 and is not supported, flavor: 0. │ │ with opensearch_ism_policy.log_aws_default[0], │ on index-opensearch.tf line 2, in resource "opensearch_ism_policy" "log_aws_default": │ 2: resource "opensearch_ism_policy" "log_aws_default" { │ ╵ ╷ │ Error: opensearch version 2.5.0 is older than 6.0.0 and is not supported, flavor: 0. │ │ with opensearch_index_template.log_aws_default[0], │ on index-opensearch.tf line 9, in resource "opensearch_index_template" "log_aws_default": │ 9: resource "opensearch_index_template" "log_aws_default" {

@komgritz komgritz added bug Something isn't working untriaged labels Apr 18, 2023
@cristianpirtea
Copy link

@komgritz - i specified the version using below format and it worked:

provider "opensearch" {

url = "https://${aws_opensearch_domain.osdomain.endpoint}"
sign_aws_requests = true
healthcheck = false
opensearch_version = "OpenSearch_2.5"

}

@rishabh6788
Copy link
Contributor

@komgritz OS 2.x is still not fully supported, we have a PR open to add support.
@prudhvigodithi

@maidanskyi
Copy link

maidanskyi commented Jun 30, 2023

Hi, @rishabh6788, any updates on the PR mentioned above?

@komgritz caught this issue because the documentation doesn't clearly describe how to specify the OpenSearch version. I caught the same error specifying:

provider "opensearch" {
  url                = var.opensearch_url
  username           = var.dash_master_username
  password           = var.dash_master_password
  healthcheck        = false
  opensearch_version = "2.5.0"
}

But

{
  ...
  opensearch_version = "OpenSearch_2.5"
}

works fine.

Pls, provide a more detailed description of all module variables.

@moritzzimmer
Copy link
Contributor

We get a similar error using 2.0.0-beta.1 against a AWS OpenSearch 2.7.0 cluster:

Error: opensearch version OpenSearch_2.7 is older than 1.0.0 and is not supported, flavor: 0.

Provider config:

provider "opensearch" {
  aws_region         = data.aws_region.current.name
  healthcheck        = false
  opensearch_version = "OpenSearch_2.7"
  url                = "https://${module.logs.proxy_url}"
}

Ping response:

{
    "name": "foo",
    "cluster_name": "bar",
    "cluster_uuid": "baz",
    "version": {
        "distribution": "opensearch",
        "number": "2.7.0",
        "build_type": "tar",
        "build_hash": "unknown",
        "build_date": "some-date",
        "build_snapshot": false,
        "lucene_version": "9.5.0",
        "minimum_wire_compatibility_version": "7.10.0",
        "minimum_index_compatibility_version": "7.0.0"
    },
    "tagline": "The OpenSearch Project: https://opensearch.org/"
}

@ravi4theja
Copy link

@moritzzimmer We're having the same problem with the exact versions. Did you find any resolution to this? Did anyone else figure out the issue behind the version incompatibility?

@moritzzimmer
Copy link
Contributor

@ravi4theja it seems like you could leave out the opensearch_version in the provider config. In this case, the provider tries to configure itself internally using the OpenSearch response from the ping endpoint.

For us this leads to downstream problems like #69

@olexade
Copy link

olexade commented Sep 9, 2023

@moritzzimmer Check your Terraform state. Review the resources and remove deprecated from the state like aws_elasticsearch_domain, elasticsearch_opensearch_user, elasticsearch_opensearch_roles_mapping, etc. Import the resources aws_opensearch_domain, opensearch_user, opensearch_roles_mapping, etc.

@fcuza
Copy link

fcuza commented Nov 21, 2023

Hey folks if you come across this problem and even with the given solution you still have some issues make sure the iam user/role your are using have the correct permission for it :
"es:DescribeDomain*"

@moritzzimmer
Copy link
Contributor

update: we currently have no problems using this provider (2.1.0) against an AWS OpenSearch 2.11 with this provider config:

provider "opensearch" {
  aws_region  = var.region
  healthcheck = false
  url         = "https://${some.output}"
}

@DenisBY
Copy link

DenisBY commented Dec 19, 2023

I have the same issue with On-Premise OS 2.11.1:

opensearch version OpenSearch_2.11 is older than 1.0.0 and is not supported, flavor: 0.

@jclavoie22
Copy link

jclavoie22 commented Mar 4, 2024

It seems like the version is only correctly parsed for Serverless OpenSearch. .
Regular OS will enter the first condition, flavor is not set and then it fails in the sink here

@necoras
Copy link

necoras commented Mar 12, 2024

@jclavoie22 Agreed. Is there any way to hack a flavor in there to make it accept non-serverless installs?

We had a cluster get destroyed and can't finish rebuilding it because we can't create indexes, users, etc. At this point it looks like we might have to fork this just to rip this bad check out.

@prudhvigodithi
Copy link
Member

Thanks @rblcoder, the version checks are removed (related PR #168). Closing this issue @necoras @jclavoie22 @DenisBY @moritzzimmer @olexade @fcuza @ravi4theja @maidanskyi @cristianpirtea @komgritz please feel-free to re-open or add comments if required.
Thank you

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
Status: ✅ Done
Development

No branches or pull requests