Troubleshooting Guide¶
This guide helps you resolve common issues with ALwrity. If you don't find your issue here, please check our GitHub Issues or create a new one.
Common Issues¶
Backend Issues¶
Server Won't Start¶
Symptoms: Backend server fails to start or crashes immediately
Solutions: 1. Check Python Version:
-
Verify Dependencies:
-
Check Port Availability:
-
Environment Variables:
Database Connection Errors¶
Symptoms: Database connection failures or SQL errors
Solutions: 1. Check Database File:
-
Reset Database:
-
Check Permissions:
API Key Issues¶
Symptoms: 401/403 errors, "Invalid API key" messages
Solutions: 1. Verify API Keys:
-
Test API Keys:
-
Check Key Format:
- Gemini: Should start with
AIza... - OpenAI: Should start with
sk-... - Anthropic: Should start with
sk-ant-...
Frontend Issues¶
Build Failures¶
Symptoms: npm start fails or build errors
Solutions: 1. Clear Cache:
-
Check Node Version:
-
Environment Variables:
Connection Issues¶
Symptoms: Frontend can't connect to backend, CORS errors
Solutions: 1. Check Backend Status:
-
Verify CORS Settings:
-
Check Firewall:
Content Generation Issues¶
SEO Analysis Not Working¶
Symptoms: SEO analysis fails or returns 422 errors
Solutions: 1. Check API Endpoints:
# Test SEO endpoint
curl -X POST http://localhost:8000/api/blog-writer/seo/analyze \
-H "Content-Type: application/json" \
-d '{"content": "test content"}'
-
Verify Request Format:
-
Check Backend Logs:
Content Generation Failures¶
Symptoms: AI content generation fails or returns errors
Solutions: 1. Check API Quotas: - Verify API key has sufficient credits - Check rate limits and usage
-
Test API Connectivity:
-
Check Request Size:
- Ensure content isn't too long
- Break large requests into smaller chunks
Authentication Issues¶
Clerk Authentication Problems¶
Symptoms: Login failures, authentication errors
Solutions: 1. Verify Clerk Keys:
- Check Clerk Dashboard:
- Verify domain configuration
- Check user permissions
-
Review authentication settings
-
Clear Browser Cache:
Performance Issues¶
Slow Content Generation¶
Symptoms: Long response times, timeouts
Solutions: 1. Check API Response Times:
# Monitor API performance
curl -w "@curl-format.txt" -o /dev/null -s http://localhost:8000/api/blog-writer
- Optimize Request Size:
- Reduce content length
- Use streaming for large responses
-
Implement caching
-
Check System Resources:
Database Performance¶
Symptoms: Slow database queries, high response times
Solutions: 1. Optimize Queries:
- Check Database Size:
Debugging Tools¶
Backend Debugging¶
# Enable debug logging
import logging
logging.basicConfig(level=logging.DEBUG)
# Add debug prints
print(f"Debug: {variable_name}")
Frontend Debugging¶
// Enable React DevTools
// Add console.log statements
console.log('Debug:', data);
// Use React Developer Tools
// Check Network tab for API calls
API Testing¶
# Test API endpoints
curl -X GET http://localhost:8000/health
curl -X POST http://localhost:8000/api/blog-writer \
-H "Content-Type: application/json" \
-d '{"topic": "test"}'
Log Analysis¶
Backend Logs¶
Frontend Logs¶
Database Logs¶
Getting Help¶
Self-Service Resources¶
- Documentation: Check relevant guides
- GitHub Issues: Search existing issues
- Community: Join discussions
- FAQ: Common questions and answers
Reporting Issues¶
When reporting issues, include: 1. Error Messages: Complete error text 2. Steps to Reproduce: Detailed steps 3. Environment: OS, Python version, Node version 4. Logs: Relevant log entries 5. Screenshots: Visual error evidence
Contact Information¶
- GitHub Issues: Create an issue
- Documentation: Browse guides and API reference
- Community: Join developer discussions
Prevention Tips¶
Regular Maintenance¶
- Update Dependencies: Keep packages current
- Monitor Performance: Regular performance checks
- Backup Data: Regular database backups
- Security Updates: Keep system secure
Best Practices¶
- Environment Management: Use virtual environments
- Configuration Management: Proper .env files
- Error Handling: Implement proper error handling
- Monitoring: Set up performance monitoring
Still having issues? Check our GitHub Issues or create a new one with detailed information about your problem.