{"record":{"id":"8c8307601e568613","repo":"ToolJet/ToolJet","slug":"summarisation-operation-failed","errorCode":null,"errorMessage":"Summarisation operation failed","messagePattern":"Summarisation operation failed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"marketplace/plugins/hugging_face/lib/query_operation.ts","lineNumber":28,"sourceCode":"  });\n  if (!response.ok) {\n    throw new Error('Text generation operation failed');\n  }\n  return await response.json();\n}\n\nexport async function summarisation_operation(api_url, queryOptions, headers) {\n  const { model_summarisation, input_summarisation, operation_parameters_summarisation } = queryOptions;\n  const response = await fetch(`${api_url}${model_summarisation}`, {\n    method: 'POST',\n    headers,\n    body: JSON.stringify({\n      inputs: input_summarisation,\n      ...(operation_parameters_summarisation ? { parameters: JSON.parse(operation_parameters_summarisation) } : {}),\n    }),\n  });\n  if (!response.ok) {\n    throw new Error('Summarisation operation failed');\n  }\n  return await response.json();\n}\n","sourceCodeStart":10,"sourceCodeEnd":32,"githubUrl":"https://github.com/ToolJet/ToolJet/blob/20602a8e101f2e59686c9afde0d1402aac2c8871/marketplace/plugins/hugging_face/lib/query_operation.ts#L10-L32","documentation":"query_operation.ts's summarisation_operation() POSTs to `${api_url}${model_summarisation}` and throws this plain Error when response.ok is false. Identical in shape and shortcomings to error 155: the HTTP status and HF's structured error body are discarded. Surfaces to callers as error 152 (run()'s catch wraps it again) so the description ends up being just 'Summarisation operation failed'.","triggerScenarios":"Summarisation model is loading (503) and wait_for_model is false; gated model without license acceptance (401/403); model_summarisation id typo or non-summarisation model (some models reject the inference route); oversized input_summarisation (413); rate limit (429); malformed operation_parameters_summarisation.","commonSituations":"Using a text-generation model id in the summarisation field (model mismatch); cold-start without x-wait-for-model; community summarisation model that has been deprecated; long input that exceeds model context window.","solutions":["Patch the throw to include status + body (same pattern as error 155's fix).","Use a model that actually exposes a summarisation route (e.g. 'facebook/bart-large-cnn') — not all models do.","For 503, set sourceOptions.wait_for_model=true or retry after estimated_time.","For oversized input, truncate or chunk input_summarisation to the model's max token length.","Validate operation_parameters_summarisation is valid JSON before sending."],"exampleFix":"// before\nif (!response.ok) {\n  throw new Error('Summarisation operation failed');\n}\n\n// after\nif (!response.ok) {\n  const body = await response.text();\n  const err = new Error(`Summarisation failed (${response.status}): ${body}`);\n  (err as any).status = response.status;\n  (err as any).body = body;\n  throw err;\n}","handlingStrategy":"retry","validationCode":"function validateSummarisationQuery(qo) {\n  if (!qo?.model_summarisation) throw new Error('model_summarisation is required');\n  if (typeof qo.input_summarisation !== 'string') throw new Error('input_summarisation must be a string');\n  if (qo.operation_parameters_summarisation !== undefined) {\n    try { JSON.parse(qo.operation_parameters_summarisation); }\n    catch (e) { throw new Error(`operation_parameters_summarisation invalid JSON: ${e.message}`); }\n  }\n}\nvalidateSummarisationQuery(queryOptions);","typeGuard":"function isSummarisationQuery(qo): qo is { model_summarisation: string; input_summarisation: string } {\n  return typeof qo?.model_summarisation === 'string' && typeof qo?.input_summarisation === 'string';\n}","tryCatchPattern":"async function summariseWithRetry(fn, retries = 2) {\n  for (let i = 0; i <= retries; i++) {\n    try { return await fn(); }\n    catch (e) {\n      if (/Summarisation operation failed/.test(e.message) && i < retries) {\n        await new Promise(r => setTimeout(r, 500 * 2 ** i));\n        continue;\n      }\n      throw e;\n    }\n  }\n}","preventionTips":["Patch summarisation_operation to throw with status + body for actionable retries.","Use a model that exposes a summarisation route (e.g. facebook/bart-large-cnn).","Set wait_for_model=true for cold-start-prone models.","Truncate input_summarisation to the model's context window."],"tags":["hugging-face","http","error-wrapping","ml-inference","diagnostics","tooljet"],"backgroundTag":null,"analyzedSha":"20602a8e101f2e59686c9afde0d1402aac2c8871","analyzedAt":"2026-08-13T05:58:54.221Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}