langfuse/langfuse · warning
Error
Error message
Error
What it means
The feedback endpoint returns 400 when forwarding feedback to Slack does not come back with status 200 — i.e. Slack's webhook rejected or errored on the request. The Slack response object is logged via logger.error before responding.
Source
Thrown at web/src/features/feedback/server/feedbackHandler.ts:19
import { runFeedbackCorsMiddleware } from "@/src/features/feedback/server/corsMiddleware";
import { sendToSlack } from "@/src/features/slack/server/slack-webhook";
import { type NextApiRequest, type NextApiResponse } from "next";
import { logger } from "@langfuse/shared/src/server";
// Legacy endpoint used by older self-hosted Langfuse versions.
export default async function feedbackApiHandler(
req: NextApiRequest,
res: NextApiResponse,
) {
await runFeedbackCorsMiddleware(req, res);
try {
const slackResponse = await sendToSlack(req.body);
if (slackResponse.status === 200) {
res.status(200).json({ status: "OK" });
} else {
logger.error(slackResponse);
res.status(400).json({ status: "Error" });
}
} catch (error) {
logger.error(error);
res.status(500).json({ status: "Error" });
}
}
View on GitHub (pinned to 59d92c7cf3)
Solutions
- Check the web container logs — the full slackResponse (including Slack's error body) is logged
- Verify SLACK_WEBHOOK_URL is set and still valid (test with curl -X POST)
- Re-create the Slack incoming webhook if it was revoked and update the env var
- Retry if Slack reported a transient 429/5xx
Defensive patterns
Strategy: fallback
Validate before calling
const webhook = process.env.SLACK_WEBHOOK_URL;
if (!webhook || !webhook.startsWith('https://hooks.slack.com/')) {
// skip feedback send or queue locally
} Prevention
- Validate SLACK_WEBHOOK_URL at deploy time
- Treat feedback submission as best-effort; never block the user on it
When it happens
Trigger: POST /api/feedback with SLACK_WEBHOOK_URL unset/invalid (Slack returns 4xx), malformed payload for the hook, or Slack API downtime, causing sendToSlack's response status to differ from 200.
Common situations: Self-hosted deployments with a stale or revoked Slack incoming webhook URL, missing SLACK_WEBHOOK_URL env var, or Slack rate-limiting the hook.
Related errors
- protocol-not-allowed
- port-not-allowed
- [Stripe Webhook] NEXT_PUBLIC_LANGFUSE_CLOUD_REGION is not se
- [Stripe Webhook] Stripe client not found
- [Stripe Webhook] NEXT_PUBLIC_LANGFUSE_CLOUD_REGION is not se
AI-assisted analysis of langfuse/langfuse@59d92c7cf3 (2026-08-27).
Data as JSON: /api/errors/eb9219bcaaa74611.
Report an issue: GitHub.