This guide helps you resolve common issues when deploying Campus Bridge LMS with PlanetScale on Render.
Cause: Incorrect database configuration or missing environment variables.
Solutions:
- Verify all environment variables are set correctly in Render:
- MYSQL_HOST
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_DATABASE
- Check that you're using PlanetScale "connect" credentials, not internal ones
- Ensure you generated a password for your PlanetScale user
- Run database initialization:
npm run init-render-dbin Render shell
Cause: Incorrect connection details or network issues.
Solutions:
- Double-check your PlanetScale connection details:
- Go to PlanetScale dashboard
- Select your database
- Click "Connect"
- Use the "connect" credentials, not "internal"
- Verify your password is correct (passwords are only shown once)
- Check that your database region matches your expectations
- Ensure your PlanetScale database allows connections from Render
Cause: Incorrect username or password.
Solutions:
- Generate a new password in PlanetScale:
- Go to your database in PlanetScale
- Click "Connect"
- Click "New password"
- Copy the new password
- Update the MYSQL_PASSWORD variable in Render
- Verify your username is correct
- Make sure you're using the "connect" username, not the "internal" one
Cause: Incorrect Gmail configuration.
Solutions:
- Ensure you're using an App Password, not your regular Gmail password:
- Enable 2-factor authentication on your Google account
- Go to Google Account settings
- Security → 2-Step Verification → App passwords
- Generate a new app password for "Mail"
- Use this as your EMAIL_PASS
- Check that EMAIL_SERVICE is set to "Gmail"
- Verify EMAIL_FROM matches EMAIL_USER
Cause: Missing or incorrect environment variables.
Solutions:
- Check Render logs for specific error messages
- Verify all required environment variables are set:
- NODE_ENV
- MYSQL_HOST
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_DATABASE
- EMAIL_SERVICE
- EMAIL_USER
- EMAIL_PASS
- EMAIL_FROM
- APP_URL
- Ensure APP_URL matches your actual Render URL
Cause: Database initialization script not run.
Solutions:
- Run the initialization script in Render shell:
- Go to your Render service
- Click "Shell"
- Run:
npm run init-render-db
- Check the output for any error messages
- Verify your database connection details are correct
- Go to your Render dashboard
- Click on your "campus-bridge-lms" service
- Click "Logs" in the sidebar
- Look for error messages, especially:
- Database connection errors
- Environment variable issues
- Startup errors
- In Render, go to your service
- Click "Shell"
- Run this command:
curl http://localhost:3000/api/db/status
- You should see a response indicating database status
- In Render, go to your service
- Click "Shell"
- Run:
npm run init-render-db
- Check the output for success messages
Solution: This is already handled by our application code. No additional configuration needed.
Solution:
- This can happen during development if connections aren't properly closed
- Restart your Render service to clear connections
- Check the PlanetScale dashboard for connection metrics
Solution:
- Ensure you're connecting to the correct database branch (usually "main")
- Check your database name is correct
Solution:
- After changing environment variables in Render:
- Click "Save Changes"
- Click "Deploy" to restart the application
- Note that Render doesn't use .env files directly
Solutions:
- Check the build logs for specific error messages
- Ensure all dependencies are in package.json
- Verify the build command is correct:
npm install
Solutions:
- Check if your application is listening on the correct port:
- Should use
process.env.PORTor default to 3000
- Should use
- Ensure your start command is correct:
npm start
- Check the PlanetScale documentation: https://docs.planetscale.com
- Check the Render documentation: https://render.com/docs
- Review the specific guides:
- Contact support through the respective platforms