Troubleshooting
Common issues and how to resolve them.
Authentication Issues
"Invalid or expired token"
JWT token has expired or is malformed.
Solution:
- Check token expiration time
- Refresh the token
- Re-authenticate if refresh fails
try {
await client.organizations.list();
} catch (error) {
if (error.code === 'TOKEN_EXPIRED') {
await client.auth.refresh();
await client.organizations.list(); // Retry
}
} "API key not found"
Invalid or revoked API key.
Solution:
- Verify the API key is correct
- Check if the key was rotated
- Ensure the key is for the right organization
"Permission denied"
User lacks required permission.
Solution:
- Check user's role in IAM
- Verify the required permission
- Request role upgrade if needed
// Check required permission
const hasPermission = await client.checkPermission('webhook.endpoints.create');
if (!hasPermission) {
console.log('Contact your admin to request access');
} Organization Issues
Cannot Create Organization
You may have reached the organization limit for your plan.
Solution:
- Check your current plan's organization limit
- Upgrade your plan if needed
- Contact support for enterprise limits
Member Invitation Not Working
Invitation email not received or invitation fails.
Debugging Steps:
- Check if the email address is correct
- Check spam/junk folders
- Verify your plan allows more members
- Check if the user is already a member
Webhook Issues
Webhook Not Receiving Events
External system not receiving webhook events.
Debugging Steps:
- Verify the webhook is active in Webhooks settings
- Check the webhook URL is reachable (HTTPS required)
- Review delivery history for error responses
- Test with the ping endpoint
// Send a test ping
const result = await client.webhooks.test(webhookId);
console.log(result.status); // Check delivery status Webhook Signature Verification Failing
Incorrect secret or payload parsing.
Solution:
// Verify using the secret from webhook creation
const isValid = verifyWebhookSignature(
req.rawBody, // Use raw body, not parsed JSON
req.headers['x-puguh-signature'],
webhookSecret
); Performance Issues
Slow API Responses
API response time higher than expected.
Debugging:
1. Check Network Latency
- Use regional API endpoints
- Consider caching for repeated requests
Rate Limiting
429 errors.
Solution:
1. Check Usage
const metrics = await client.control.getMetricsTrends({ period: '7d' });
console.log(`Events: ${metrics.totalEvents}`); 2. Implement Retry Logic
const client = new PuguhClient({
retries: 3,
retryDelay: 1000,
}); 3. Batch Requests
// Instead of individual calls
const decisions = await client.decideBatch(requests); 4. Upgrade Plan - Higher plans have higher rate limits.
Data Issues
Missing Audit Entries
Expected events not appearing in audit trail.
Check:
1. Time Range - Expand date range in query. Check timezone settings.
2. Application Filter - Events might be in a different application. Check application scope.
3. Event Types - Verify you're filtering for the correct event type.
Audit Log Gaps
Missing entries in audit trail.
Causes:
- Retention Period - Free plan: 7 days. Check your plan's retention.
- Filter Settings - Remove filters to see all entries. Check action type filters.
- Export Archived Logs - Contact support for older logs (Enterprise).
Integration Issues
Webhook Not Firing
External system not receiving events.
Debugging:
1. Check Webhook Status - Go to Settings > Webhooks. Check webhook health status.
2. Verify Endpoint - Ensure URL is reachable. Check for HTTPS requirement.
3. Check Signature
// Your webhook handler
const isValid = verifyWebhookSignature(
req.body,
req.headers['x-puguh-signature'],
webhookSecret
); 4. Review Webhook Logs - Control > Events shows webhook delivery attempts. Check for error responses.
SDK Connection Issues
SDK calls timing out or failing.
Check:
1. Network Connectivity
curl https://api-puguh.arsaka.io/health 2. Firewall Rules - Ensure outbound HTTPS allowed. Check corporate proxy settings.
3. SDK Configuration
const client = new PuguhClient({
timeout: 30000, // Increase timeout
baseUrl: 'https://api-puguh.arsaka.io', // Correct URL
}); Getting Help
If you can't resolve an issue:
- Check Status Page: https://status.arsaka.io
- Review Docs: Search documentation
- Contact Support: support@arsaka.io
- Include Details:
- Organization ID
- Timestamp of issue
- Error messages
- Steps to reproduce