Closed toyaokeke closed 5 months ago
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 Dockerfile
in my application. The Dockerfile
iI shared was using Opensearch 2.11, but in my local tests I seemed to have been mistakenly using Elasticsearch 7.9, which does not support point in time
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 ECRDo 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)