Rendering Engine
Troubleshooting

Troubleshooting

Common issues and solutions when using the Canvelete (opens in a new tab) rendering API.

Authentication Errors

"Invalid API key" (401)

Causes:

  • API key is incorrect or expired
  • Missing Bearer prefix in Authorization header
  • Key was revoked

Solutions:

  1. Verify your key at Settings → API Keys (opens in a new tab)
  2. Ensure header format: Authorization: Bearer YOUR_KEY
  3. Generate a new key if needed
# Correct format
curl -H "Authorization: Bearer cvt_your_api_key" ...
 
# ❌ Wrong: Missing Bearer
curl -H "Authorization: cvt_your_api_key" ...

"Forbidden" (403)

Causes:

  • API key lacks required permissions
  • Accessing another user's resources
  • Feature not available on your plan

Solutions:

  1. Check key permissions in dashboard
  2. Verify you own the design/template
  3. Review your subscription plan (opens in a new tab)

Rendering Errors

"Design not found" (404)

Causes:

  • Incorrect design ID
  • Design was deleted
  • Design is in another account

Solutions:

  1. Verify design ID in your dashboard (opens in a new tab)
  2. Check the URL when editing: /editor/design_xxx
  3. Ensure design is saved (not just a draft)

"Render timeout"

Causes:

  • Design is too complex
  • Large images in design
  • Server overload

Solutions:

  1. Reduce element count
  2. Compress/resize images
  3. Lower output quality
  4. Use async rendering with webhooks
# Use async for complex designs
result = client.render.create(
    design_id="complex_design",
    async_mode=True,
    webhook="https://your-app.com/webhook"
)

"Invalid dynamic data"

Causes:

  • Variable name mismatch
  • Wrong data type
  • Missing required variables

Solutions:

  1. Check variable names match design placeholders
  2. Verify data types (string, number, URL)
  3. Test in the editor's preview mode first
# ❌ Wrong: Variable name mismatch
dynamic_data = {"userName": "John"}  # Design uses {{name}}
 
# ✅ Correct: Match design variables
dynamic_data = {"name": "John"}

"Image URL not accessible"

Causes:

  • URL is private/requires auth
  • URL is blocked by CORS
  • URL is invalid or broken

Solutions:

  1. Use publicly accessible URLs
  2. Upload images to Canvelete asset library
  3. Use CDN URLs for external images
# ✅ Use Canvelete assets
asset = client.assets.upload("image.png")
dynamic_data = {"image": asset["url"]}
 
# ✅ Or use public CDN URLs
dynamic_data = {"image": "https://cdn.example.com/image.png"}

Rate Limiting

"Too many requests" (429)

Causes:

  • Exceeded requests per minute
  • Exceeded daily/monthly limits

Solutions:

  1. Implement exponential backoff
  2. Use batch API for multiple renders
  3. Upgrade your plan for higher limits
import time
from canvelete.exceptions import RateLimitError
 
def render_with_retry(config, max_retries=3):
    for attempt in range(max_retries):
        try:
            return client.render.create(**config)
        except RateLimitError as e:
            if attempt < max_retries - 1:
                time.sleep(e.retry_after or 2 ** attempt)
            else:
                raise

Output Quality Issues

Blurry or pixelated output

Causes:

  • Low quality setting
  • Small source images
  • Wrong scale factor

Solutions:

  1. Increase quality (80-95 recommended)
  2. Use higher resolution source images
  3. Adjust scale factor
result = client.render.create(
    design_id="design_123",
    format="png",
    quality=95,  # Higher quality
    scale=2.0    # 2x resolution
)

Colors look different

Causes:

  • Color space conversion
  • JPEG compression
  • Monitor calibration

Solutions:

  1. Use PNG for accurate colors
  2. Increase JPEG quality
  3. Use hex colors consistently

Fonts not rendering correctly

Causes:

  • Font not available
  • Font weight mismatch
  • Special characters not supported

Solutions:

  1. Use fonts from the available fonts list
  2. Upload custom fonts to asset library
  3. Test with preview before rendering

Webhook Issues

Webhooks not received

Causes:

  • Endpoint not accessible
  • Firewall blocking requests
  • Endpoint returning errors

Solutions:

  1. Verify endpoint is publicly accessible
  2. Check firewall/security rules
  3. Ensure endpoint returns 200 status
  4. Test with webhook testing tools (opens in a new tab)

Invalid webhook signature

Causes:

  • Wrong signing secret
  • Payload modified
  • Encoding issues

Solutions:

  1. Verify signing secret from dashboard
  2. Use raw request body for verification
  3. Check encoding (UTF-8)
import hmac
import hashlib
 
def verify_webhook(payload: bytes, signature: str, secret: str) -> bool:
    expected = hmac.new(
        secret.encode(),
        payload,  # Use raw bytes
        hashlib.sha256
    ).hexdigest()
    return f"sha256={expected}" == signature

Debug Mode

Enable debug mode for detailed error information:

client = CanveleteClient(
    api_key="YOUR_KEY",
    debug=True  # Enable debug logging
)

Or in API requests:

{
  "format": "png",
  "debug": true,
  "dynamicData": { ... }
}

Getting Help

If issues persist:

  1. Check status: status.canvelete.com (opens in a new tab)
  2. Search docs: Use the search bar above
  3. Community: Discord (opens in a new tab)
  4. Support: support@canvelete.com

When contacting support, include:

  • Request ID (from error response)
  • Design ID
  • API request/response
  • Expected vs actual behavior