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

Custom script processor (Painless) gives stackOverFlow Error and causes node crash #101881

Closed
akhilma-kore opened this issue Nov 7, 2023 · 4 comments
Labels
>bug :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache Team:Core/Infra Meta label for core/infra team

Comments

@akhilma-kore
Copy link

Elasticsearch Version

7.17.7

Installed Plugins

No response

Java Version

17.0.8.1

OS Version

Linux ki0566 5.15.0-84-generic #93~20.04.1-Ubuntu SMP

Problem Description

Whenever I try to execute the below custom script the elasticsearch node is always getting crashed with the StackOverflowError
Script:
{"script": {"tag": "Custom Script##1", "ignore_failure": true, "lang": "painless", "source": " ctx.a=ctx;"}}
'''
[2023-11-07T11:45:30,094][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [my_es_node] fatal error in thread [elasticsearch[my_es_node][management][T#4]], exiting
java.lang.StackOverflowError: null
at org.elasticsearch.ingest.IngestDocument.deepCopy(IngestDocument.java:784) ~[elasticsearch-7.17.7.jar:7.17.7]
at org.elasticsearch.ingest.IngestDocument.deepCopy(IngestDocument.java:777) ~[elasticsearch-7.17.7.jar:7.17.7]
'''
This is caused due to the circular dependency between the variables. Is there a way we can catch this error and throw it as an exception and avoid ES node crashes?

Steps to Reproduce

** Any simulate/index API with the above mentioned script will reproduce the error

Logs (if relevant)

[2023-11-07T11:45:30,094][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [my_es_node] fatal error in thread [elasticsearch[my_es_node][management][T#4]], exiting
java.lang.StackOverflowError: null
at org.elasticsearch.ingest.IngestDocument.deepCopy(IngestDocument.java:784) ~[elasticsearch-7.17.7.jar:7.17.7]
at org.elasticsearch.ingest.IngestDocument.deepCopy(IngestDocument.java:777) ~[elasticsearch-7.17.7.jar:7.17.7]

@akhilma-kore akhilma-kore added >bug needs:triage Requires assignment of a team area label labels Nov 7, 2023
@andreidan andreidan added :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP and removed needs:triage Requires assignment of a team area label labels Nov 20, 2023
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Nov 20, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@dakrone dakrone added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache and removed :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP labels Nov 20, 2023
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Nov 20, 2023
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine removed the Team:Data Management Meta label for data/management team label Nov 20, 2023
@rjernst
Copy link
Member

rjernst commented Nov 20, 2023

This was already fixed in #100872, but that was not backported to 7.17. I opened #102394 to backport it.

@rjernst
Copy link
Member

rjernst commented Nov 20, 2023

closed by #102394

@rjernst rjernst closed this as completed Nov 20, 2023
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