-
Notifications
You must be signed in to change notification settings - Fork 125
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] createPit
client method is throwing ResponseError: parse_exception: [parse_exception] Reason: request body is required
#746
Comments
I don't get that error and could create a PIT just fine: cd .ci/opensearch
export OPENSEARCH_VERSION=2.11.0
docker compose up -d const { Client } = require('@opensearch-project/opensearch');
const client = new Client({node: 'http://localhost:9200'});
const start = async () => {
const movies = 'movies';
await client.indices.create({ index: movies });
console.log(await client.createPit({ index: movies, keep_alive: '10m' })); {
body: {
pit_id: 's4GCQQEGbW92aWVzFjFXeHIwZklXVDktNTRxN3pHajA3YkEAFl9rVFRKTWlvUkFxSUxHQnpWYUdwWEEAAAAAAAAAAAIWT3dscTBuN09SazItMm84TEJ4NXNvdwEWMVd4cjBmSVdUOS01NHE3ekdqMDdiQQAA',
_shards: { total: 1, successful: 1, skipped: 0, failed: 0 },
creation_time: 1712796391467
},
statusCode: 200,
headers: {
'content-type': 'application/json; charset=UTF-8',
'content-length': '259'
},
meta: {
context: null,
request: { params: [Object], options: {}, id: 7 },
name: 'opensearch-js',
connection: {
url: 'http://localhost:9200/',
id: 'http://localhost:9200/',
headers: {},
deadCount: 0,
resurrectTimeout: 0,
_openRequests: 0,
status: 'alive',
roles: [Object]
},
attempts: 0,
aborted: false
}
} |
closing this issue, I managed to resolve the issue |
@toyaokeke What was your issue (for the next person)? |
it seems like I may have been using an incorrect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the bug?
the
createPit
method is throwing different errors, even though I am following the expected specifications from the opensearch user guideI've also looked the source code for this method
ResponseError: parse_exception: [parse_exception] Reason: request body is required
ifbody
is not passed as an inputResponseError: illegal_argument_exception: [illegal_argument_exception] Reason: request [/tests_func/_search/point_in_time] contains unrecognized parameters: [expand_wildcards], [keep_alive]
whenbody
,keep_alive
andexpand_wilcards
are passedConfigurationError: Missing required parameter: keep_alive
ifkeep_alive
parameter is removedHow can one reproduce the bug?
sample TS file
What is the expected behavior?
expect the
createPit
method to create a PIT using my input paramsWhat is your host/environment?
OS: macOs Sonoma 14.2.1
Running a containerized application (see the
Dockerfile
in the additional context)Docker version 20.10.22
Opensearch image 2.11.1 from AWS Public ECR
Do you have any screenshots?
If I remove
body
which is not a param in the SDK, I get this errorif I remove
keep_alive
which is required I get this errorIf I add
keep_alive
andbody
(andexpand_wilcards
, which is also a valid parameter), I get this errorDo you have any additional context?
Dockerfile
package.json (simplified)
The text was updated successfully, but these errors were encountered: