Installation Issues
npm install fails with EACCES permission error
Cause: npm doesn't have permission to write to the global directory.
Solution:
# Fix npm permissions
sudo chown -R $(whoami) ~/.npm
sudo chown -R $(whoami) /usr/local/lib/node_modules
# Or use a Node version manager (recommended)
# Install nvm: https://github.com/nvm-sh/nvm
nvm install 20
nvm use 20
npm run build fails with memory error
Cause: Node.js runs out of memory during the build process (common on servers with limited RAM).
Solution:
# Increase Node.js memory limit
NODE_OPTIONS="--max-old-space-size=4096" npm run build
# For permanent fix, add to .bashrc or .profile
export NODE_OPTIONS="--max-old-space-size=4096"
Error: Cannot find module 'xyz'
Cause: Dependencies not installed or corrupted.
Solution:
# Remove node_modules and reinstall
rm -rf node_modules
rm -f package-lock.json
npm install
Port already in use (EADDRINUSE)
Cause: Another process is using port 6008.
Solution:
# Find process using the port
sudo lsof -i :6008
# Kill the process
sudo kill -9 <PID>
# Or change port in .env
PORT=3000
Database Issues
MongoDB connection failed
Cause: MongoDB server is unreachable or credentials are wrong.
Solutions:
- Check if MongoDB is running:
sudo systemctl status mongod - Verify the
MONGODB_URIin your.envfile - For MongoDB Atlas, ensure your server IP is whitelisted in Network Access
- Test connection manually:
mongosh "your_connection_string"
Database creation fails with "not authorized"
Cause: The MongoDB user in your connection string doesn't have sufficient privileges.
Solution: Grant the necessary roles to your MongoDB user:
# Connect to MongoDB as admin
mongosh "mongodb://admin:password@host:port/admin"
# Grant required roles
db.grantRolesToUser("your_user", [
{ role: "dbAdminAnyDatabase", db: "admin" },
{ role: "userAdminAnyDatabase", db: "admin" },
{ role: "readWriteAnyDatabase", db: "admin" }
])
Database shows 0 collections / documents
Cause: The application might be connecting to a different database than expected.
Solutions:
- Verify the database name matches what's in the metadata
- Check if the company uses prefixed names (e.g.,
X7Y8Z9_mydbvsmydb) - Ensure the
MONGODB_URIpoints to the correct cluster
Storage limit exceeded error
Cause: Company has exceeded their package's storage limit.
Solutions:
- Upgrade to a higher package with more storage
- Delete unused databases or collections
- Remove unnecessary documents or demo data
- SaaS Admin can manually restore access:
POST /company/admin/storage/companies/:id/restore
Authentication Issues
Cannot login with default credentials
Cause: Default admin user might not be seeded, or password was changed.
Solutions:
- Check that the database has been seeded with initial data
- Verify you're using the correct panel (SaaS Admin at
/saas, Company Admin at/) - Reset password via the "Forgot Password" link (requires email configuration)
JWT token expired / 401 Unauthorized
Cause: Access token has expired (24 hours) or is invalid.
Solutions:
- Log out and log in again to get a fresh token
- If using the API directly, use the refresh token endpoint:
POST /auth/company/refresh - Ensure
JWT_SECRETin .env hasn't changed (changing it invalidates all tokens)
Account locked after too many attempts
Cause: Exceeded maximum login attempts (default: 5).
Solutions:
- Wait for the lockout duration (default: 30 minutes)
- SaaS Admin can adjust lockout settings in Settings → Security
"Account suspended" or "Subscription expired" error
Cause: Company status is not active or trial.
Solutions:
- Contact the SaaS Admin to reactivate your account
- If expired, subscribe to a new package to restore access
- SaaS Admin: Change company status in Companies → [Company] → Change Status
Payment Issues
Payment gateway not showing
Cause: Gateway is disabled or not configured.
Solution: SaaS Admin should enable the gateway in Settings → Payment Gateways and enter valid API credentials.
Payment fails in test mode
Cause: Using live credentials in test mode or vice versa.
Solution:
- Ensure the gateway mode matches the credentials (test keys for test mode)
- For Razorpay test: Use test card
4111 1111 1111 1111 - Check the gateway's dashboard for error logs
Subscription not activated after payment
Cause: Payment verification webhook might have failed.
Solutions:
- Check backend logs for payment verification errors
- Verify webhook URL is correctly configured in the gateway dashboard
- SaaS Admin can manually upgrade: Payments → Manual Upgrade
Email Issues
Test email not sending
Cause: SMTP credentials are incorrect or provider is blocking.
Solutions:
- Verify SMTP host, port, username, and password
- For Gmail: Use an App Password (not your regular password)
- Check if your email provider requires 2FA app passwords
- Try port 587 with TLS or port 465 with SSL
Emails going to spam
Solutions:
- Set up SPF, DKIM, and DMARC records for your domain
- Use a dedicated email service (SendGrid, Mailgun, AWS SES)
- Avoid spammy subject lines and excessive HTML
- Use a custom domain email instead of free email services
Password reset email not received
Solutions:
- Check spam/junk folder
- Verify email configuration is working (send test email first)
- Confirm the email address matches a registered account
- Check backend logs for email sending errors
Performance Issues
Slow page loading
Solutions:
- Ensure you're running the production build (
npm run buildthennpm start) - Use Nginx as a reverse proxy for static file caching
- Check MongoDB connection latency (use a closer region if using Atlas)
- Monitor server resources:
htoporpm2 monit
High memory usage
Solutions:
- Increase server RAM (recommended: 2GB+)
- Set Node.js memory limit:
NODE_OPTIONS="--max-old-space-size=2048" - Use PM2 with cluster mode:
pm2 start npm --name "app" -i max -- start - Check for memory leaks in backend logs
API requests timing out
Solutions:
- Check MongoDB connection health
- Increase Nginx proxy timeout:
proxy_read_timeout 300s; - Optimize large queries with pagination and indexing
- Monitor PM2 logs for error patterns:
pm2 logs
Deployment Issues
CORS errors in browser
Cause: Frontend and backend are on different origins.
Solutions:
- Update
COMPANY_ADMIN_URLandSAAS_ADMIN_URLin backend.env - Ensure both panels use the same domain (unified deployment)
- Check Nginx proxy configuration for proper header forwarding
404 errors on page refresh (SPA routing)
Cause: Server doesn't handle client-side routing.
Solution: This is handled automatically by Next.js. If using Nginx, ensure the reverse proxy is configured correctly to forward all routes to the Node.js server.
SSL/HTTPS not working
Solutions:
- Verify SSL certificate is valid:
sudo certbot certificates - Ensure Nginx SSL configuration is correct
- Check that port 443 is open in firewall:
sudo ufw allow 443 - Test SSL: SSL Labs Test
WebSocket connection fails
Cause: Nginx or proxy not configured for WebSocket upgrade.
Solution: Add WebSocket support to Nginx config:
location /socket.io/ {
proxy_pass http://127.0.0.1:6008;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
PM2 process keeps restarting
Solutions:
- Check error logs:
pm2 logs mongo-my-admin --err --lines 50 - Verify all environment variables are set correctly
- Check MongoDB connection string
- Ensure the build was successful:
npm run build - Check for port conflicts
Upgrade Issues
Before Upgrading
Always backup your database and .env file before upgrading to a new version.
# Backup database
mongodump --uri="your_mongodb_uri" --out=./backup
# Backup .env
cp .env .env.backup
Upgrade breaks existing features
Solutions:
- Compare your
.envwith the new.env.examplefor new required variables - Run
npm installto install new dependencies - Rebuild the application:
npm run build - Clear browser cache and cookies
- Restart the server:
pm2 restart all
Frequently Asked Questions
Can I use MongoDB Atlas instead of a self-hosted server?
Yes! You can use MongoDB Atlas as your database server. Simply use the Atlas connection string as your MONGODB_URI. Make sure your MongoDB Atlas user has the required roles (dbAdminAnyDatabase, userAdminAnyDatabase, readWriteAnyDatabase).
How do I add a custom domain?
Point your domain's A record to your server's IP address. Configure Nginx with the domain name and set up SSL using Certbot. Update the COMPANY_ADMIN_URL, SAAS_ADMIN_URL, and API_BASE_URL in your .env file.
Can I run multiple instances for high availability?
Yes, you can use PM2 cluster mode (pm2 start npm -i max -- start) to run multiple instances on a single server. For multi-server setups, use a load balancer (Nginx upstream or AWS ALB) with a shared MongoDB instance.
How do I backup my data?
Use mongodump for database backup:
# Full backup
mongodump --uri="your_mongodb_uri" --out=./backup/$(date +%Y%m%d)
# Restore from backup
mongorestore --uri="your_mongodb_uri" ./backup/20240115
What happens when a company exceeds its storage limit?
Write operations (create, update, insert) are automatically blocked. Read operations continue to work. The company sees a storage limit page with options to upgrade or delete data. Storage is checked every 6 hours and after data deletion.
Can I customize the landing page without code?
Yes! Use the Website Editor in the SaaS Admin panel (Settings → Website Editor) to customize all sections: branding, hero, features, pricing, footer, SEO, and more.
How do I switch from test to live payment mode?
Go to Settings → Payment Gateways in the SaaS Admin panel. For each gateway, enter your live credentials and switch the mode from "Test" to "Live".
Is the application secure?
Yes. The platform includes JWT authentication, password hashing (bcrypt), rate limiting, brute-force protection, IP whitelisting, RBAC permissions, encrypted secrets, audit logging, and Helmet security headers. Always keep your dependencies updated and follow security best practices.
Getting Support
Contact Support
If you encounter issues not covered in this documentation:
- Check the troubleshooting sections above
- Review the server logs:
pm2 logs mongo-my-admin - Contact support through CodeCanyon with:
- Your purchase code
- Server environment details (OS, Node.js version, MongoDB version)
- Error messages and screenshots
- Steps to reproduce the issue
Useful Diagnostic Commands
# Check Node.js version
node --version
# Check npm version
npm --version
# Check MongoDB version
mongosh --version
# Check PM2 status
pm2 status
# View application logs
pm2 logs mongo-my-admin --lines 100
# Check system resources
df -h # Disk space
free -m # Memory
htop # CPU and memory usage
# Test MongoDB connection
mongosh "your_connection_string" --eval "db.serverStatus().version"
# Test API health
curl http://localhost:6008/api/v1/health