Webhook Troubleshooting
Diagnose and resolve common webhook delivery and processing issues.
Checking Webhook Status
Delivery History
View recent deliveries:
- Go to Account → Webhooks
- Click on your webhook
- View Delivery History
Each entry shows:
- Event type
- Timestamp
- Status (success/failed)
- Response code
- Response time
Failed Deliveries
Click on a failed delivery to see:
- Request payload
- Response body
- Error message
- Retry count
Common Issues
Webhook Not Receiving Events
Symptoms:
- No requests hitting your server
- Empty delivery history
Causes & Solutions:
-
Webhook disabled
- Check webhook status in dashboard
- Toggle enabled if off
-
Wrong events selected
- Verify subscribed to correct events
- Edit webhook to add events
-
URL unreachable
- Test URL is accessible
- Check firewall rules
- Verify HTTPS certificate
-
Rate limited
- Check if exceeding limits
- Events may be queued
Signature Verification Failing
Symptoms:
- Receiving requests but verification fails
- 401 errors in your logs
Causes & Solutions:
-
Wrong secret
- Verify secret matches exactly
- Check for extra whitespace
- Regenerate if unsure
-
Body parsing issues
- Verify using raw body for signature
- Check JSON isn't being modified
-
Encoding issues
- Ensure UTF-8 encoding
- Check for character encoding problems
Debug snippet:
app.post('/webhook', (req, res) => {
console.log('Raw body:', req.rawBody);
console.log('Signature:', req.headers['x-tagd-signature']);
console.log('Expected:', computeSignature(req.rawBody));
// Compare and debug
});
Events Arriving Late
Symptoms:
- Events arrive minutes/hours after occurrence
- Inconsistent timing
Causes & Solutions:
-
Your endpoint is slow
- Improve response time
- Process asynchronously
- Respond immediately, process later
-
Previous failures causing retries
- Check delivery history for failures
- Fix underlying issues
-
High volume causing queuing
- Events processed in order
- Burst traffic may queue
Duplicate Events
Symptoms:
- Same event received multiple times
- Duplicate processing in your system
Causes & Solutions:
-
At-least-once delivery (by design)
- Implement idempotency
- Use event ID for deduplication
-
Slow response triggering retry
- Respond within 30 seconds
- Optimize processing time
Deduplication example:
const processed = new Set();
function handleEvent(event) {
if (processed.has(event.id)) {
console.log('Duplicate, skipping:', event.id);
return;
}
processed.add(event.id);
// Process event
}
Wrong Response Codes
Symptoms:
- tagd-ai shows failures
- Your server returns errors
Causes & Solutions:
-
Returning non-2xx codes
- Return 200-299 for success
- Any other code = failure = retry
-
Exceptions in handler
- Add error handling
- Return 200 even if processing fails async
Correct pattern:
app.post('/webhook', async (req, res) => {
// Respond immediately
res.sendStatus(200);
try {
// Process async
await processEvent(req.body);
} catch (error) {
// Log but don't fail the webhook
console.error('Processing error:', error);
}
});
Timeout Errors
Symptoms:
- Requests timing out
- Retries being triggered
Causes & Solutions:
-
Processing takes too long
- tagd-ai waits 30 seconds max
- Respond quickly, process async
-
External API calls in handler
- Don't make slow API calls synchronously
- Queue for background processing
-
Database operations
- Optimize queries
- Use connection pooling
- Consider async processing
Events Missing Data
Symptoms:
- Expected fields not present
- Null or undefined values
Causes & Solutions:
-
Event type different than expected
- Check
eventfield first - Different events have different data
- Check
-
Optional fields
- Some fields may not always be present
- Handle gracefully
-
Schema changes
- Check changelog for updates
- Handle unknown fields gracefully
Debugging Tools
Test Webhook Feature
Send test events from dashboard:
- Go to Webhooks → select webhook
- Click Send Test
- Choose event type
- View result
Request Inspection
Use services to inspect requests:
- webhook.site
- requestbin.com
- ngrok with inspection
Local Development
Tunnel to localhost:
# ngrok
ngrok http 3000
# Use the https URL as your webhook endpoint
Logging
Add comprehensive logging:
app.post('/webhook', (req, res) => {
console.log('=== Webhook Received ===');
console.log('Headers:', JSON.stringify(req.headers, null, 2));
console.log('Body:', JSON.stringify(req.body, null, 2));
console.log('========================');
// Process...
});
Retry Behavior
Retry Schedule
When delivery fails:
- Retry 1: 1 minute
- Retry 2: 5 minutes
- Retry 3: 30 minutes
- Retry 4: 2 hours
- Retry 5: 24 hours
Webhook Disabled
After 5 consecutive failures:
- Webhook is automatically disabled
- Email notification sent
- Re-enable manually after fixing
Manual Retry
Retry specific deliveries:
- Go to delivery history
- Find failed delivery
- Click Retry
- Monitor result
Getting Help
Information to Provide
When contacting support:
- Webhook ID
- Delivery IDs (from history)
- Event types affected
- Error messages
- Your server logs
- Steps to reproduce
Support Channels
- Email: [email protected]
- Include "Webhook Issue" in subject
- Provide all relevant details
Prevention Best Practices
Design for Reliability
- Idempotent handlers - Process same event multiple times safely
- Quick responses - Respond fast, process async
- Error handling - Catch all exceptions
- Monitoring - Alert on failures
Testing
- Use test events before production
- Test all subscribed event types
- Test error scenarios
- Test high-volume scenarios
Monitoring
- Log all webhook requests
- Track success/failure rates
- Alert on high failure rates
- Monitor processing time