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

illegal_argument_exception - unexpected metadata [op:[TEST]] in source #107209

Open
rishabh-mmc opened this issue Apr 8, 2024 · 8 comments
Open
Labels
>bug :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache Team:Core/Infra Meta label for core/infra team

Comments

@rishabh-mmc
Copy link

rishabh-mmc commented Apr 8, 2024

Elasticsearch Version

8.12.2

Installed Plugins

No response

Java Version

bundled

OS Version

Mac OS Sonomo (14.4.1)

Problem Description

Unable to update any document when there is field named op in mapping.

Steps to Reproduce

// Create Mapping

PUT op_index_test

{
  "mappings": {
    "properties": {
      "firstName": {
        "type": "text"
      },
      "lastName": {
        "type": "text"
      },
      "op": {
        "type": "keyword"
      },
      "orgId": {
        "type": "integer"
      }
    }
  }
}

// insert data
POST op_index_test/_doc/1

{"firstName": "BQCayRMVdN", "lastName": "vVDUmYONQW", "orgId": 1, "op": ["TEST"]}

// update by query
POST op_index_test/_update_by_query

{
  "script": {
    "source": """
    if (ctx._source.orgId == 1) { ctx._source.firstName = ctx._source.firstName}
    """,
    "lang": "painless"
  },
  "query": { 
    "match": {
      "orgId": 1
    }
  }
}

Error:

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "unexpected metadata [op:[TEST]] in source"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "unexpected metadata [op:[TEST]] in source"
  },
  "status": 400
}

Logs (if relevant)

No response

@rishabh-mmc rishabh-mmc added >bug needs:triage Requires assignment of a team area label labels Apr 8, 2024
@gwbrown gwbrown added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache and removed needs:triage Requires assignment of a team area label labels Apr 8, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Apr 8, 2024
@williamrandolph
Copy link
Contributor

I wasn't able to reproduce this issue. Is there a stack trace in the Elasticsearch application logs that you could share?

@rishabh-mmc
Copy link
Author

@williamrandolph I am not seeing any logs while hitting this request.

@rishabh-mmc
Copy link
Author

@williamrandolph can you share configuration you used while trying to reproduce this?
i have installed Elastic search using docker on ES 8 and server I am using eck-operator helm chart.

also, I have disabled tls using rejectUnauthorized: false in configuration.

@williamrandolph
Copy link
Contributor

I used the .zip archive on MacOS. I'll try the docker image.

@rishabh-mmc
Copy link
Author

@williamrandolph any update here?

@jpmat296
Copy link
Contributor

I have faced similar error message with Elasticsearch 8.11.3.

I'm able to reproduce the exact same error as @rishabh-mmc. Please find attached the 3 commands to execute in Dev Tools : dev_tools.txt

@rishabh-mmc
Copy link
Author

@williamrandolph @jpmat296 what are next steps here as this is reproduced. we are using op key in our project and this is impacting out functionality thus not able to upgrade to ES 8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache Team:Core/Infra Meta label for core/infra team
Projects
None yet
Development

No branches or pull requests

5 participants