Debugging & Troubleshooting
This guide covers common issues and their solutions when deploying and running the Zynomi platform.
Common Issues
Authentication Issues
Problem: Users cannot log in
Symptoms:
- Login fails with "Invalid credentials"
- Session expires immediately
Solutions:
- Verify Supabase configuration:
# Check environment variables
echo $NEXT_PUBLIC_SUPABASE_URL
echo $NEXT_PUBLIC_SUPABASE_ANON_KEY
-
Check Supabase dashboard for authentication logs
-
Verify RLS policies are correctly configured
Problem: JWT token expired
Solution:
- Ensure refresh token flow is implemented
- Check token expiration settings in Supabase
Database Connection Issues
Problem: Cannot connect to database
Symptoms:
- "Connection refused" errors
- Timeout on database queries
Solutions:
- Verify database URL format:
postgresql://user:password@host:port/database
-
Check network/firewall settings
-
Verify Supabase project is active
API Gateway Issues
Problem: KrakenD returns 502 Bad Gateway
Solutions:
- Check backend service health:
curl https://your-site.frappe.cloud/api/method/ping
- Verify KrakenD configuration:
krakend check -c krakend.json
- Review KrakenD logs:
fly logs -a your-krakend-app
Deployment Issues
Problem: Vercel deployment fails
Solutions:
-
Check build logs in Vercel dashboard
-
Verify all environment variables are set
-
Test build locally:
npm run build
Problem: Docker container won't start
Solutions:
- Check container logs:
docker logs container-name
-
Verify Dockerfile syntax
-
Ensure all dependencies are installed
Deploying KrakenD
This guide walks through deploying KrakenD on Fly.io.
Prerequisites
- A Fly.io account
- Flyctl command-line tool installed
- KrakenD configuration files ready
Steps
1. Prepare KrakenD Configuration
Ensure your KrakenD configuration is ready and the necessary files are in the configs directory.
2. Navigate to KrakenD Directory
cd krakend
3. Initialize Fly.io Application
flyctl auth login
flyctl launch
4. Destroy Previous Instance (If needed)
fly apps destroy krakend
5. Deploy the New Image
flyctl deploy
Logging and Monitoring
Enable Debug Logging
Add to your environment:
DEBUG=true
LOG_LEVEL=debug
View Logs
Vercel:
vercel logs your-app --follow
Fly.io:
fly logs -a your-app
Docker:
docker logs -f container-name
Health Checks
API Health Check
curl https://api.your-domain.com/__health
Database Health Check
curl https://your-project.supabase.co/rest/v1/ \
-H "apikey: YOUR_ANON_KEY"
Frappe Health Check
curl https://your-site.frappe.cloud/api/method/ping
Getting Help
If you're still experiencing issues:
- Check the GitHub Issues
- Review the API Reference documentation
- Contact support at support@zynomi.com