Troubleshooting

This document lists common production issues and how to investigate them.

Frontend Is Blank

Possible causes:

Check:

Login Works Locally but Not in Cloud

Check:

Google Sign-In Shows origin_mismatch

In Google Cloud Console, add the frontend URL to authorized JavaScript origins.

Examples:

https://orthoflow-frontend.onrender.com
http://localhost:5173

Then redeploy/restart frontend if VITE_GOOGLE_CLIENT_ID changed.

Email Sending Fails

Common errors:

For SMTP2GO:

For Brevo:

R2 Upload Fails with AccessDenied

Check:

Uploaded File Does Not Download

If the log says the file is missing from src/uploads, it may have been uploaded before R2 was enabled or while local storage was still configured.

Check:

Dental Chart PDF Has Only Text or Missing Graphics

Use Docker for the backend deployment. The backend Dockerfile uses a Playwright image with Chromium dependencies.

Check:

Aiven MySQL SSL Errors

Check:

DB_SSL=true
DB_SSL_REJECT_UNAUTHORIZED=true
DB_SSL_CA=-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----

The CA certificate must be copied fully, including begin/end certificate lines.

Reports Fail with MySQL Syntax Errors

Check Render logs for the exact SQL error.

If the issue appears after a deployment:

  1. Confirm backend deployed from the latest commit.
  2. Confirm Aiven schema startup completed successfully.
  3. Check whether the failing query is already fixed in the latest branch.

Render Shows SIGTERM

SIGTERM received. Shutting down gracefully... is normal during redeploys or restarts. It only indicates Render is stopping the old container.

If the service repeatedly restarts, check logs immediately before the SIGTERM.

Render Free Service Is Slow After Inactivity

Free Render web services can spin down after inactivity. The first request after sleep can take a long time.

For production, use a paid backend instance such as Render Starter or higher.

Audit Log Timezone Looks Wrong

The frontend displays audit log timestamps in Sri Lanka time. If timestamps look wrong:

Build Warning: Large Frontend Chunk

Vite may warn that a JavaScript chunk is larger than 500 kB.

This is a performance warning, not a deployment failure. The site can still work. It can be optimized later with route-based code splitting or Rollup manual chunks.