You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try creating an index and pass in an invalid index.codec setting, the error returns:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "unknown value for [index.codec] must be one of [default, lz4, best_compression, zlib] but was: zstd_no_dic"
}
],
"type": "illegal_argument_exception",
"reason": "unknown value for [index.codec] must be one of [default, lz4, best_compression, zlib] but was: zstd_no_dic"
},
"status": 400
}
I tried creating an index using index.codec = lz4 and zlib and they worked, even though the documentation does not state they are valid values. Regardless, I think the error message should be updated to match the documentation.
Related component
Indexing
To Reproduce
PUT test
{
"settings": {
"index.codec": "invalid_codec"
}
}
Expected behavior
Return error with valid index.codec options:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "unknown value for [index.codec] must be one of [default, best_compression, zstd, zstd_no_dict, qat_lz4, qat_deflate] but was: invalid_codec"
}
],
"type": "illegal_argument_exception",
"reason": "unknown value for [index.codec] must be one of [default, best_compression, zstd, zstd_no_dict, qat_lz4, qat_deflate] but was: invalid_codec"
},
"status": 400
}
Additional Details
Host/Environment (please complete the following information):
OS: macos Docker
Version 2.19
same behavior on Fedora 39, version 2.17.1
Additional context
I can submit a PR, but I'm just following the contributing guide which says I should file an issue first. Thanks!
The text was updated successfully, but these errors were encountered:
peterskim12
changed the title
[BUG] Error returned when bad index.codec setting is provided gives inaccurate and incomplete list of valid values
[BUG] Error gives inaccurate and incomplete list of valid values when bad index.codec setting is provided
Mar 10, 2025
Interesting. The error message is hardcoded but clearly is incomplete as it should include "lucene_default" as well as everything in Codec.availableCodecs().
Describe the bug
When I try creating an index and pass in an invalid index.codec setting, the error returns:
According to the documentation, this is not the list of valid values accepted by the API in the latest version. https://opensearch.org/docs/2.17/install-and-configure/configuring-opensearch/index-settings/#static-index-level-index-settings
It should be:
I tried creating an index using index.codec = lz4 and zlib and they worked, even though the documentation does not state they are valid values. Regardless, I think the error message should be updated to match the documentation.
Related component
Indexing
To Reproduce
Expected behavior
Return error with valid index.codec options:
Additional Details
Host/Environment (please complete the following information):
same behavior on Fedora 39, version 2.17.1
Additional context
I can submit a PR, but I'm just following the contributing guide which says I should file an issue first. Thanks!
The text was updated successfully, but these errors were encountered: