{"record":{"id":"6a97bc05d2757dac","repo":"RocketChat/Rocket.Chat","slug":"integration-result-is-empty","errorCode":null,"errorMessage":"Integration result is empty","messagePattern":"Integration result is empty","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"apps/meteor/server/lib/integrations/lib/triggerHandler.ts","lineNumber":630,"sourceCode":"\t\t}\n\n\t\tfetch(\n\t\t\topts.url,\n\t\t\t{\n\t\t\t\tmethod: opts.method,\n\t\t\t\theaders: opts.headers,\n\t\t\t\t...(opts.timeout && { timeout: opts.timeout }),\n\t\t\t\t...(opts.data && { body: opts.data }),\n\t\t\t\t// SECURITY: Integrations can only be configured by users with enough privileges. It's ok to disable this check here.\n\t\t\t\tignoreSsrfValidation: true,\n\t\t\t\tsize: 10 * 1024 * 1024,\n\t\t\t},\n\t\t\tsettings.get('Allow_Invalid_SelfSigned_Certs'),\n\t\t)\n\t\t\t.then(async (res) => {\n\t\t\t\tconst content = await res.text();\n\t\t\t\tif (!content) {\n\t\t\t\t\toutgoingLogger.warn({ msg: 'Integration result is empty', integrationName: trigger.name, url });\n\t\t\t\t} else {\n\t\t\t\t\toutgoingLogger.info({ msg: 'Integration HTTP status', integrationName: trigger.name, url, status: res.status });\n\t\t\t\t}\n\n\t\t\t\tconst data = (() => {\n\t\t\t\t\tconst contentType = (res.headers.get('content-type') || '').split(';')[0];\n\t\t\t\t\tif (!['application/json', 'text/javascript', 'application/javascript', 'application/x-javascript'].includes(contentType)) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn JSON.parse(content);\n\t\t\t\t\t} catch (_error) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t})();\n\n\t\t\t\tawait updateHistory({","sourceCodeStart":612,"sourceCodeEnd":648,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/integrations/lib/triggerHandler.ts#L612-L648","documentation":"The outgoing webhook endpoint answered with an empty body. The handler logs this warn and continues: no JSON is parsed (data stays null) and no reply message is sent, though processOutgoingResponse scripts still see the raw response. For fire-and-forget integrations an empty body is normal and harmless; if you expected the endpoint to return a bot reply, nothing will be posted.","triggerScenarios":"The endpoint returns 200/204 with an empty body: serverless handlers with no explicit return, a proxy stripping bodies, a handler that forgot res.send, or an intentionally silent acknowledgement during retry cycles.","commonSituations":"Lambda/Cloud Function defaults returning empty on success; nginx misconfigurations; endpoints acknowledging with 204 No Content; 'my integration never replies' investigations that turn out to be empty responses rather than failures.","solutions":["If the integration should reply, return a JSON body with 200 and application/json, e.g. {\"text\": \"...\"}","If fire-and-forget, ignore the warn - the delivery already succeeded and is recorded in History","Check the integration History entry: httpResult empty at 'after-http-call' confirms the endpoint sent nothing","Verify intermediate proxies are not rewriting responses to empty bodies"],"exampleFix":"// before (integration endpoint)\napp.post('/hook', (req, res) => {\n  handle(req.body); // no response body\n});\n\n// after (reply so Rocket.Chat posts a message back)\napp.post('/hook', (req, res) => {\n  handle(req.body);\n  res.status(200).json({ text: 'Received: ' + req.body.text });\n});","handlingStrategy":"fallback","validationCode":"// In the integration script: treat an empty response as an explicit no-op\n// processOutgoingResponse({ response, content }) {\n//   if (!content) return false; // nothing to parse, skip the reply\n//   return { text: JSON.parse(content).text };\n// }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always return a JSON body (even {}) from integration endpoints","Test endpoints with curl before wiring them into Rocket.Chat","Use the integration History to distinguish empty responses from failed deliveries"],"tags":["integrations","outgoing-webhook","http-response","empty-body"],"backgroundTag":"empty-webhook-response","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}