Common Deployment Issues
Connection Issues
Database connection timeouts, authentication failures, and network issues
Build & Runtime Errors
Environment configuration and application startup problems
Authentication Problems
Supabase integration and user login issues
Performance Issues
Slow queries, memory leaks, and optimization tips
Database Connection Issues
Connection Timeout
Symptoms
Symptoms
- Connection test fails with timeout error
- Query execution hangs indefinitely
- Error: “Connection timeout” or “ETIMEDOUT”
Possible Causes & Solutions
Possible Causes & Solutions
1. IP Address Not WhitelistedMost cloud database providers require explicit IP whitelisting. Verify that your deployment IP address is added to your database’s firewall rules.2. Firewall/Network Configuration
Add the IP to your database provider’s allowed list (see Database Connections)
- Check that your database port (default: PostgreSQL 5432, MySQL 3306) is open
- Verify VPC/network security groups allow outbound connections
- Ensure no corporate firewall is blocking database ports
- Confirm your database instance is running
- Check database provider’s status page for outages
- Verify connection string hostname resolves correctly:
nslookup your-db-host.com
Authentication Failed
Symptoms
Symptoms
- Error: “password authentication failed”
- Error: “Access denied for user”
- Connection test fails immediately with auth error
Possible Causes & Solutions
Possible Causes & Solutions
1. Incorrect Credentials3. Host/SSL Requirements
- Double-check username and password (watch for trailing spaces)
- Verify credentials work with a database client (psql, MySQL Workbench)
- Check if password contains special characters that need URL encoding
SELECTprivileges on all tables you want to queryCONNECTprivilege to the database- Access to
information_schemafor metadata queries
- Some providers require SSL connections (Azure, AWS RDS with force_ssl)
- Add
?sslmode=requireto PostgreSQL connection strings - Add
?ssl=trueor?ssl={"rejectUnauthorized":false}to MySQL connection strings
SSL/TLS Issues
Symptoms
Symptoms
- Error: “SSL connection required”
- Error: “self signed certificate”
- Connection works locally but fails in production
Solutions
Solutions
For PostgreSQL:For MySQL:Self-signed certificates:
Database Not Found
Symptoms
Symptoms
- Error: “database does not exist”
- Error: “Unknown database”
Solutions
Solutions
- Verify the database name is spelled correctly (case-sensitive on some systems)
- Ensure the database has been created on the server
- Check that the user has access to the specific database
- For PostgreSQL, verify you’re connecting to the correct database (not ‘postgres’ default)
Build & Runtime Errors
Missing Environment Variables
Symptoms
Symptoms
- Error: “NEXT_PUBLIC_ENCRYPTION_KEY environment variable is required” (~/workspace/source/components/stores/utils/encrypted_store.ts:9)
- Application fails to start
- Build process exits with error
Solutions
Solutions
Verify all required environment variables are set in your deployment platform:Critical Variables:Deployment Platform Setup:
The
NEXT_PUBLIC_ENCRYPTION_KEY must be exactly 32 characters (256 bits) for AES-256-GCM encryption. Generate a secure key with: openssl rand -base64 32- Vercel
- Docker
- Kubernetes
- Go to Project Settings > Environment Variables
- Add each variable with appropriate scope (Production/Preview/Development)
- Redeploy to apply changes
Build Fails with TypeScript Errors
Solutions
Solutions
- Ensure Node.js version >= 18.17.0
- Verify pnpm version is 10.10.0 or compatible
- Check for TypeScript version conflicts in
package.json
Runtime: Application Crashes on Startup
Symptoms
Symptoms
- Container/process exits immediately
- Error: “Cannot find module”
- Next.js fails to initialize
Solutions
Solutions
1. Check MongoDB Connection2. Verify Supabase Configuration
- Ensure Supabase project is active and not paused
- Verify API keys match your project
- Check Supabase service status: https://status.supabase.com
Authentication Problems
Supabase Authentication Fails
Symptoms
Symptoms
- Users cannot log in
- Redirect loops after authentication
- Error: “Invalid authentication credentials”
Solutions
Solutions
1. Verify Supabase ConfigurationIn your Supabase project dashboard:
- Go to Authentication > URL Configuration
- Add your deployment URL to “Site URL”
- Add your deployment URL to “Redirect URLs” (e.g.,
https://your-app.com/auth/callback)
NEXT_PUBLIC_APP_URLenvironment variable is set correctly- Cookie settings allow your domain
- Verify cookies are enabled in browser
- Check cookie domain settings in Supabase match your deployment domain
- For localhost development, ensure using
http://localhost:3000not127.0.0.1
Session Expires Immediately
Solutions
Solutions
- Check Supabase JWT expiration settings (Authentication > Settings)
- Verify system clock is synchronized (JWT validation is time-sensitive)
- Ensure
SUPABASE_SERVICE_ROLE_KEYis correct and not expired
Query Execution Issues
Query Execution Timeout
Symptoms
Symptoms
- Long-running queries never complete
- Browser shows loading indefinitely
- Error: “Query timeout exceeded”
Solutions
Solutions
1. Optimize Query Performance
- Add appropriate indexes to queried columns
- Use
LIMITclauses for large result sets - Avoid
SELECT *on tables with many columns - Check query execution plan:
EXPLAIN ANALYZE your_query;
- Break complex queries into smaller parts
- Use materialized views for frequently accessed aggregations
- Consider caching results for expensive queries
Encryption/Decryption Errors
Symptoms
Symptoms
- Error: “Decryption failed” in console (~/workspace/source/components/stores/utils/encrypted_store.ts:46)
- Cannot retrieve saved database connections
- Browser localStorage appears corrupted
Solutions
Solutions
Root Cause: The
NEXT_PUBLIC_ENCRYPTION_KEY was changed after data was encrypted.Recovery Options:- If you have the old key: Temporarily restore it, export connections, update key, re-import
- If key is lost: Users must re-enter all database connections
- Store encryption key in secure vault (HashiCorp Vault, AWS Secrets Manager)
- Document key rotation procedures before deploying to production
- Use the same key across all environments for consistency
Performance Issues
Slow Dashboard Loading
Solutions
Solutions
- Reduce number of charts on single dashboard
- Implement query result caching
- Optimize database queries (add indexes, use query limits)
- Consider using connection pooling for high-traffic deployments
- Enable CDN for static assets
High Memory Usage
Solutions
Solutions
- Limit result set size (max 10,000 rows recommended)
- Increase container/instance memory allocation
- Monitor MongoDB connection pool size
- Check for memory leaks in custom queries
Getting Additional Help
Debug Mode: Set
NODE_ENV=development to enable verbose logging. Review logs for detailed error messages and stack traces.- Check Application Logs: Most errors include specific details about what went wrong
- Review Environment Variables: Ensure all required variables are set correctly
- Test Database Connection: Use a database client to verify credentials work independently
- Check Service Status: Verify Supabase, MongoDB, and other dependencies are operational
- GitHub Issues: Search existing issues or create a new one with:
- Error messages and stack traces
- Environment details (Node version, deployment platform)
- Steps to reproduce the issue
