This plugin is part of the Kuzzle Enterprise Plan. If you are interested, please contact us.

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 #

ArgumentTypeDescription
jobIdstringJob identifier. Default: the current or last job
fromintegerPosition of the first document, ≥ 0, default 0. from + size ≤ 10,000
sizeintegerDocuments per page, 0 to 1000, default 100
afterstringCursor: 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
}
PropertyTypeDescription
jobIdstringThe job listed
hitsobject[]Failed documents: documentId, reason (Elasticsearch's, or why a rename could not apply), failedAt
totalnumberFailed documents of the job
nextstringCursor 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 idStatusWhen
plugin.mapping-migration.invalid_paging400A negative from, a size out of 0–1000, from + size over 10,000, or from with after
plugin.mapping-migration.forbidden403Missing document:search on the job's collection
plugin.mapping-migration.unknown_job404No 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_engine412Kuzzle does not run on Elasticsearch 8