failures #
Lists the documents a job failed to copy, sorted by documentId, by pages, until the job is purged. Each comes with Elasticsearch's reason, which shows the refused value.
Pages with from and size up to 10,000 documents (Elasticsearch's result window); past that, with after, the next cursor of the previous page. The cursor works from the first page on, so a client can always page with it.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/_/mapping-migration/migration/failures[?jobId=<jobId>][&from=0][&size=100][&after=<cursor>]
Method: GET
Other protocols #
{
"controller": "mapping-migration/migration",
"action": "failures",
"jobId": "<jobId>", // optional
"from": 0, // optional
"size": 100, // optional
"after": "<next>" // optional, not with from
}
Kourou #
kourou mapping-migration/migration:failures -a jobId=<jobId> -a size=1000
Arguments #
| Argument | Type | Description |
|---|
jobId | string | Job identifier. Default: the current or last job |
from | integer | Position of the first document, ≥ 0, default 0. from + size ≤ 10,000 |
size | integer | Documents per page, 0 to 1000, default 100 |
after | string | Cursor: the next of the previous page; the page starts after that documentId. Not with a from above 0 |
Response #
{
"jobId": "…",
"hits": [
{
"documentId": "sensor-3",
"reason": "failed to parse field [code] of type [long] in document with id 'sensor-3'. Preview of field's value: 'abc'",
"failedAt": 1764000003000
}
],
"total": 2,
"next": null
}
| Property | Type | Description |
|---|
jobId | string | The job listed |
hits | object[] | Failed documents: documentId, reason (Elasticsearch's, or why a rename could not apply), failedAt |
total | number | Failed documents of the job |
next | string | Cursor of the following page, to pass as after; null once a page is not full |
let after;
do {
const { result } = await sdk.query({
controller: "mapping-migration/migration",
action: "failures",
jobId,
size: 1000,
...(after && { after }),
});
// result.hits...
after = result.next;
} while (after);
Possible errors #
| Error id | Status | When |
|---|
plugin.mapping-migration.invalid_paging | 400 | A negative from, a size out of 0–1000, from + size over 10,000, or from with after |
plugin.mapping-migration.forbidden | 403 | Missing document:search on the job's collection |
plugin.mapping-migration.unknown_job | 404 | No job at all, or a job that is not the current one and has neither an archive nor failed documents (purged, or never existed) |
plugin.mapping-migration.unsupported_engine | 412 | Kuzzle does not run on Elasticsearch 8 |