Common Issues and Solutions

Integration Problems

Sentry Connection Issues

Problem: Sentry integration shows “connection failed” or no errors are being imported.

Solutions:

  1. Check OAuth Authorization: Ensure you’ve granted all required permissions during the OAuth flow
  2. Verify Project Mappings: Each Sentry project must be mapped to a GitHub repository
  3. Webhook Delivery: In Sentry, check Developer Settings → Webhooks for delivery status
  4. Error Frequency: Tembo only processes errors seen more than once (times_seen:>1)

PostgreSQL Connection Problems

Problem: Database connection fails or times out.

Solutions:

  1. Test Connection String: Verify your connection string works with psql:
    psql "postgresql://user:pass@host:port/db?sslmode=require"
  2. Check Firewall Rules: Ensure port 5432 (or your custom port) is accessible
  3. SSL Configuration: Match SSL settings between your database and connection string
  4. User Permissions: Verify the database user has required permissions:
    SELECT has_database_privilege('tembo_user', 'your_db', 'CONNECT');
    SELECT has_schema_privilege('tembo_user', 'public', 'USAGE');

GitHub Integration Issues

Problem: Pull requests are not being created or pushed to the wrong repository.

Solutions:

  1. Repository Access: Ensure Tembo has write access to the target repository
  2. Branch Protection: Check if branch protection rules are preventing PR creation
  3. Repository Mapping: Verify integration sources are mapped to correct repositories
  4. Personal Access Token: Ensure GitHub tokens haven’t expired (if using personal tokens)

Issue Detection Problems

No Issues Being Detected

Problem: Tembo shows no detected issues despite having performance problems.

Possible Causes & Solutions:

Missing pg_stat_statements:

-- Check if extension is installed
SELECT * FROM pg_extension WHERE extname = 'pg_stat_statements';

-- Install if missing (requires superuser)
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;

-- Check if it's tracking queries
SELECT count(*) FROM pg_stat_statements;

Query Thresholds Not Met:

  • Slow queries must have >5 calls and >100ms mean execution time
  • Check your query patterns: SELECT * FROM pg_stat_statements WHERE calls > 5 ORDER BY mean_exec_time DESC;

Insufficient Permissions:

-- Grant monitoring role
GRANT pg_monitor TO tembo_user;

-- Check current permissions
SELECT has_function_privilege('tembo_user', 'pg_stat_statements()', 'EXECUTE');

False Positive Issues

Problem: Tembo is flagging queries or code that shouldn’t be optimized.

Solutions:

  1. Use .temboignore: Create a .temboignore file in your repository root to exclude specific files or patterns:

    # Ignore generated files
    dist/
    build/
    *.generated.js
    
    # Ignore specific files
    legacy-code.sql
    temp-scripts/
  2. Mark Issues as False Positives: In the Tembo dashboard, mark issues as “Not a Problem” to help train the AI

  3. Review Query Context: Some slow queries might be intentional (like reporting queries that run infrequently)

Performance and Monitoring

Slow Issue Processing

Problem: Issues are taking a long time to be resolved or pull requests aren’t being created promptly.

Debugging Steps:

  1. Check Queue Status: Review the job queue in your dashboard for processing delays
  2. Review AI Solver Status: Ensure the AI solvers are responding correctly
  3. Examine Issue Complexity: Complex issues naturally take longer to resolve
  4. Credit Usage: Verify you haven’t hit your credit limits

Missing Monitoring Data

Problem: Dashboard shows incomplete or missing performance data.

Solutions:

  1. Database Statistics Collection: Ensure track_activities and track_counts are enabled:

    SHOW track_activities;  -- Should be 'on'
    SHOW track_counts;      -- Should be 'on'
    SHOW track_io_timing;   -- Should be 'on' for detailed I/O stats
  2. Statistics Reset: Check if statistics were recently reset:

    SELECT stats_reset FROM pg_stat_database WHERE datname = current_database();
  3. Connection Monitoring: Verify Tembo can maintain persistent connections to your database

Pull Request Issues

PRs Not Being Created

Problem: Tembo detects issues and generates solutions but doesn’t create pull requests.

Troubleshooting:

  1. Repository Permissions: Verify write access to the target repository
  2. Base Branch: Ensure the default branch exists and is accessible
  3. File Conflicts: Check if there are uncommitted changes that might cause conflicts
  4. Rate Limits: GitHub API rate limits might be affecting PR creation

Poor Quality Pull Requests

Problem: Generated pull requests don’t solve the issue or introduce new problems.

Improvement Steps:

  1. Provide Feedback: Use PR comments to guide the AI on what needs improvement
  2. Add Context: Ensure your repository has good documentation and clear code patterns
  3. Review Patterns: Look for patterns in poor solutions and provide feedback through the dashboard
  4. Custom Instructions: Consider adding a .tembo/instructions.md file with project-specific guidance

Best Practices for Troubleshooting

Enable Detailed Logging

For PostgreSQL monitoring:

-- Enable query logging for analysis
ALTER SYSTEM SET log_statement = 'all';
ALTER SYSTEM SET log_duration = on;
ALTER SYSTEM SET log_min_duration_statement = 100;  -- Log queries >100ms
SELECT pg_reload_conf();

Regular Health Checks

  1. Weekly Reviews: Check the Tembo dashboard weekly for any stuck issues or integration problems
  2. Monitor Integration Status: Verify all integrations show “Connected” status
  3. Review Recent PRs: Examine recent pull requests for quality and accuracy
  4. Check Credit Usage: Monitor your credit consumption to avoid service interruptions

Getting Help

If you continue experiencing issues:

  1. Check Status Page: Visit our status page for known issues or maintenance
  2. Review Documentation: Ensure you’re following the latest setup instructions
  3. Contact Support: Use the support chat in your Tembo dashboard with:
    • Specific error messages
    • Screenshots of the issue
    • Your organization ID
    • Steps to reproduce the problem

Performance Optimization Tips

Database Monitoring Efficiency

  • Use connection pooling for high-traffic databases
  • Configure appropriate shared_preload_libraries for monitoring extensions
  • Regularly update table statistics: ANALYZE;
  • Monitor pg_stat_statements for storage growth and reset when needed

Integration Optimization

  • Map only active repositories to reduce noise
  • Configure appropriate issue severity thresholds
  • Use .temboignore files to exclude irrelevant code
  • Regularly review and clean up outdated integrations