-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Fix NPE in rolling over unknown target and return 404 #125352
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
Fix NPE in rolling over unknown target and return 404 #125352
Conversation
Since elastic#122905 we were throwing NPEs (i.e. 5xxs) when a rollover request has an unknown/non-existent target. This PR restores that to it's original behavior (which is to return a 400 - illegal argument exception). Additionally, to avoid this from happening again, we add a YAML test that asserts the correct exception behavior.
|
Pinging @elastic/es-data-management (Team:Data Management) |
rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.rollover/10_basic.yml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, but I think instead of a >non-issue, we should mark it as >bug and add in the changelog that this fixes an NPE and makes the response a 404.
|
@dakrone I thought about that but figured this wasn't relevant enough for a changelog item. I guess it makes sense to have one (and doesn't hurt). Will update, thanks 👍 |
|
Here's the stack trace in case anyone comes across this problem: |
|
Nice catch @nielsbauman! Do we need to run by this one by the BCC @dakrone? |
|
I think this fits under the |
|
Hi @nielsbauman, I've created a changelog YAML for you. |
💔 Backport failed
You can use sqren/backport to manually backport by running |
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
Since elastic#122905 we were throwing NPEs (i.e. 5xxs) when a rollover request has an unknown/non-existent target. Before that, we returned a 400 - illegal argument exception. We now return a 404 which matches "missing target" better. Additionally, to avoid this from happening again, we add a YAML test that asserts the correct exception behavior. (cherry picked from commit fdd4537) # Conflicts: # server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverService.java
Since elastic#122905 we were throwing NPEs (i.e. 5xxs) when a rollover request has an unknown/non-existent target. Before that, we returned a 400 - illegal argument exception. We now return a 404 which matches "missing target" better. Additionally, to avoid this from happening again, we add a YAML test that asserts the correct exception behavior. (cherry picked from commit fdd4537) # Conflicts: # server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverService.java
) Since #122905 we were throwing NPEs (i.e. 5xxs) when a rollover request has an unknown/non-existent target. Before that, we returned a 400 - illegal argument exception. We now return a 404 which matches "missing target" better. Additionally, to avoid this from happening again, we add a YAML test that asserts the correct exception behavior. (cherry picked from commit fdd4537) # Conflicts: # server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverService.java
) Since #122905 we were throwing NPEs (i.e. 5xxs) when a rollover request has an unknown/non-existent target. Before that, we returned a 400 - illegal argument exception. We now return a 404 which matches "missing target" better. Additionally, to avoid this from happening again, we add a YAML test that asserts the correct exception behavior. (cherry picked from commit fdd4537) # Conflicts: # server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverService.java
) Since #122905 we were throwing NPEs (i.e. 5xxs) when a rollover request has an unknown/non-existent target. Before that, we returned a 400 - illegal argument exception. We now return a 404 which matches "missing target" better. Additionally, to avoid this from happening again, we add a YAML test that asserts the correct exception behavior. (cherry picked from commit fdd4537) # Conflicts: # server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverService.java
Since elastic#122905 we were throwing NPEs (i.e. 5xxs) when a rollover request has an unknown/non-existent target. Before that, we returned a 400 - illegal argument exception. We now return a 404 which matches "missing target" better. Additionally, to avoid this from happening again, we add a YAML test that asserts the correct exception behavior.
Since #122905 we were throwing NPEs (i.e. 5xxs) when a rollover request has an unknown/non-existent target. Before that, we returned a 400 - illegal argument exception. We now return a 404 which matches "missing target" better. Additionally, to avoid this from happening again, we add a YAML test that asserts the correct exception behavior.