Troubleshooting
Common issues and solutions to help you resolve problems with CosmosCost.
Quick Diagnostics
Before diving into specific issues, try these quick diagnostic steps:
Health Check
Visit /api/health to check if the API is responding.
Authentication Issues
Cannot Log In
Symptoms: Login page shows errors, credentials rejected
Solutions:
- Verify you're using the correct environment mode (local vs production)
- In local development, any password works for test users
- Check browser console for JavaScript errors
- Clear browser cookies and cache
- Try GitHub OAuth as an alternative (production only)
Session Expires Quickly
Symptoms: Logged out frequently, need to re-authenticate
Solutions:
- Check NEXTAUTH_SECRET is properly configured
- Verify environment variables are loaded correctly
- Check browser settings for cookie restrictions
- Ensure system clock is accurate
OAuth Not Working
Symptoms: GitHub login button missing or not working
Solutions:
- OAuth is only available in production mode
- Set NEXT_PUBLIC_USE_LOCAL_AUTH=false for production
- Verify GitHub OAuth app configuration
- Check redirect URLs in GitHub app settings
Customer Access Issues
Access Denied to Customer
Symptoms: Error message about customer access
Solutions:
- Verify you're a member of the customer organization
- Check the customer slug in the URL is correct
- Contact the customer admin to verify your membership
- Ensure you have the appropriate role (admin/member)
Cannot Create Organization
Symptoms: Onboarding fails, organization creation errors
Solutions:
- Check database connection is working
- Verify user is properly authenticated
- Ensure organization name doesn't already exist
- Check browser console for JavaScript errors
API Issues
401 Unauthorized Errors
Symptoms: API calls return 401 status
Solutions:
- Verify JWT token is included in Authorization header
- Check token format:
Bearer YOUR_TOKEN - Ensure token hasn't expired
- Try refreshing your authentication token
403 Forbidden Errors
Symptoms: API calls return 403 status
Solutions:
- Verify you have access to the customer organization
- Check your role has sufficient permissions
- Ensure customer_id parameter is correct
- Contact customer admin to verify your access level
Rate Limiting (429 Errors)
Symptoms: API calls return 429 status
Solutions:
- Wait for the rate limit window to reset
- Implement exponential backoff in your code
- Reduce the frequency of API calls
- Consider caching responses where appropriate
Cloud Account Issues
Cannot Connect Cloud Account
Symptoms: Cloud account connection fails
Solutions:
- Verify cloud provider credentials are correct
- Check IAM permissions in your cloud account
- Ensure Cost and Usage Reports are enabled (AWS)
- Contact support for credential storage issues
Data Sync Failures
Symptoms: Cost data not updating, sync errors
Solutions:
- Check cloud account status in dashboard
- Verify billing export configurations
- Ensure data is available in cloud provider
- Contact support if issues persist
Subscription & Billing Issues
Plan Features Not Working
Symptoms: Premium features show upgrade prompts
Solutions:
- Verify your subscription status is active
- Check trial period hasn't expired
- Refresh your browser session
- Contact billing support for payment issues
Payment Processing Errors
Symptoms: Credit card declined, payment failures
Solutions:
- Verify card details are correct
- Check card has sufficient funds
- Contact your bank about international payments
- Try a different payment method
Development Issues
Docker Services Won't Start
Symptoms: Docker containers fail to start
Solutions:
- Ensure Docker is running on your system
- Check port 5432 (PostgreSQL) isn't in use
- Run
docker system prune -fto clean up - Restart Docker service
- Check Docker logs for specific errors
Database Migration Errors
Symptoms: Migration commands fail
Solutions:
- Ensure PostgreSQL container is running
- Check database connection settings
- Run
npm run db:resetto start fresh - Verify SQL files exist in migrations directory
Build or Start Errors
Symptoms: npm run dev or build fails
Solutions:
- Delete
node_modulesand runnpm install - Clear Next.js cache:
rm -rf .next - Check Node.js version (requires 18+)
- Verify environment variables are set
- Check for TypeScript compilation errors
Theme and UI Issues
Theme Not Changing
Symptoms: Theme toggle doesn't work
Solutions:
- Check browser localStorage for theme preference
- Refresh the page after theme change
- Clear browser cache and cookies
- Verify JavaScript is enabled
UI Components Not Loading
Symptoms: Missing styles, broken layout
Solutions:
- Check browser console for CSS/JavaScript errors
- Verify Tailwind CSS is compiled properly
- Clear browser cache
- Check for conflicting browser extensions
Getting Additional Help
Debug Information to Collect
When reporting issues, please include:
- •Steps to reproduce the problem
- •Expected vs actual behavior
- •Browser and operating system information
- •Screenshots or error messages
- •Browser console logs (F12 → Console)
- •Network requests (F12 → Network tab)
Support Channels
- Documentation: Search this documentation first
- FAQ: Check the frequently asked questions
- Community: Join our Discord community
- Support: Contact us through the support page
Emergency Issues
For critical production issues:
- •Business+ customers: Contact your dedicated account manager
- •Business customers: Use priority support channel
- •Free users: Use community support for non-critical issues
Still Need Help?
Don't see your issue here? Contact our support team - we're here to help!
This troubleshooting guide is regularly updated. If you find a solution to an issue not listed here, please let us know so we can help other users.