gitlabEdit

๐Ÿ”งTroubleshooting Recipe

Comprehensive guide to debugging and resolving common issues across all Docs-Dispatcher services.

Overview

This troubleshooting recipe helps you:

  1. Diagnose common problems quickly

  2. Understand error messages and codes

  3. Debug template rendering issues

  4. Fix provider connection problems

  5. Resolve authentication failures

  6. Handle rate limiting and timeouts

  7. Analyze logs effectively

Quick Diagnostic Checklist

Start here when something goes wrong:

โ–ก Is my Basic Auth credentials valid and not expired?
โ–ก Did I validate the request first?
โ–ก Is the provider configured correctly?
โ–ก Does the template exist and is it accessible?
โ–ก Are all required fields present?
โ–ก Is the data in the correct format?
โ–ก Did I check the error response for details?
โ–ก Have I reviewed recent API changes?

Common Issues by Category

Authentication Issues

Issue 1: "Invalid or expired Basic Auth credentials"

Symptoms:

  • 401 Unauthorized response

  • Message: "Invalid or expired Basic Auth credentials"

  • All API calls failing with auth error

Causes:

  • Token expired (120 minute lifetime)

  • Token malformed or corrupted

  • Wrong token used

  • System clock skew

Solutions:

Prevention:

  • Store token expiration time

  • Refresh tokens proactively (10 min before expiry)

  • Implement automatic retry with fresh token

  • Use token management library

Issue 2: "Authentication failed"

Symptoms:

  • 401 Unauthorized response

  • Invalid credentials message

  • Basic Auth header rejected

Solutions:

  1. Verify credentials:

  1. Check for special characters in password:

  1. Verify account status:

  • Account active?

  • Email verified?

  • Correct company/environment?

Template Issues

Issue 3: "Template not found"

Symptoms:

  • 404 error

  • Message: "Template with ID XXX not found"

Debugging steps:

Solutions:

  • Use correct template ID

  • Ensure template not deleted

  • Check user permissions

  • Verify company context

Issue 4: "Template rendering failed"

Symptoms:

  • Template data errors

  • Missing variables

  • Syntax errors in template

Common causes:

  1. Missing required fields:

Solution:

  1. Wrong data types:

  1. Template syntax errors:

Check template syntax:

Debug template rendering:

Provider Issues

Issue 5: "Provider not configured"

Symptoms:

  • Error: "Provider configuration missing"

  • Can't dispatch to provider

Solutions:

  1. Check provider configuration:

  1. Verify provider credentials:

  • API keys valid?

  • Provider account active?

  • Correct environment (sandbox vs production)?

  1. Create configuration:

Issue 6: "Provider API error"

Symptoms:

  • 422 Unprocessable Entity

  • Provider-specific error codes

  • External API failures

Common provider errors:

Qonto - Duplicate invoice:

Solution:

PennyLane - Missing SIRET:

Solution:

Validation Issues

Issue 7: "Validation failed"

Symptoms:

  • 400 Bad Request

  • Validation errors array in response

Debug validation errors:

Rate Limiting

Issue 8: "Rate limit exceeded"

Symptoms:

  • 429 Too Many Requests

  • Message: "Rate limit exceeded"

  • Retry-After header present

Solutions:

Timeout Issues

Issue 9: "Request timeout"

Symptoms:

  • 504 Gateway Timeout

  • Operation took > 120 seconds

  • No response received

Solutions:

  1. Use async mode:

  1. Reduce document complexity:

  1. Optimize template:

  • Reduce template size

  • Minimize complex calculations

  • Optimize images

  • Reduce page count

Network Issues

Issue 10: "Network error"

Symptoms:

  • Connection refused

  • DNS lookup failed

  • SSL/TLS errors

Debugging:

Solutions:

  • Check firewall rules

  • Verify DNS settings

  • Update SSL certificates

  • Check proxy configuration

Data Issues

Issue 11: "Calculation mismatch"

Symptoms:

  • Total doesn't match sum

  • Tax calculation errors

  • Rounding issues

Solutions:

Debug Checklist

Use this systematic approach:

1. Enable Verbose Logging

2. Capture Full Error Context

3. Test in Isolation

Getting Help

Before Contacting Support

Gather this information:

Contact Support

Email: [email protected]

Include:

  • Debug information (from above)

  • Steps to reproduce

  • Expected vs actual behavior

  • Request/response examples

  • Timestamps

Summary

Common issues:

  • โœ… Token expiration - Refresh proactively

  • โœ… Template errors - Validate data schema

  • โœ… Provider errors - Check configuration

  • โœ… Validation failures - Debug field by field

  • โœ… Rate limiting - Implement backoff

  • โœ… Timeouts - Use async mode

  • โœ… Calculation errors - Use decimal math

Best practices:

  • Always validate before dispatch

  • Enable verbose logging in development

  • Test components in isolation

  • Implement proper error handling

  • Use async mode for production

  • Monitor rate limits

  • Keep tokens fresh

When stuck:

  • Review this troubleshooting guide

  • Check recent API updates

  • Test with minimal request

  • Enable debug logging

  • Contact support with full context

Happy debugging!

Last updated