Troubleshooting · By Rivtor · Updated
Fix missing environment variables during deployment
First identify whether a value is read at build time, application startup or in the browser. Updating the wrong environment cannot repair a value already embedded in a frontend bundle.
See the Rivtor deployment workflow →
Identify the reader
Search for the exact variable name and identify the service reading it. API_URL and NEXT_PUBLIC_API_URL are different names with different exposure. A setting available to a Python backend does not automatically become part of a separately built frontend. Inspect the source instead of guessing a variable name.
Keep private values private
Frontend public prefixes expose values to visitors. Database passwords, signing keys and provider tokens belong only in server configuration. Never print the entire environment to debug one key. Log whether a value is present, and mask it when a diagnostic genuinely requires a value.
Supply secrets through the supported workflow
Rivtor excludes secret .env files from uploaded source. Use documented environment commands or the deploy environment-file option to supply values. Consider shell history when entering secrets. Do not commit a real environment file simply to make a build succeed.
Choose restart or rebuild
A runtime server reads configuration after restart. A frontend value embedded during compilation generally requires a rebuild. Inspect the resulting request address and application behavior after updating configuration. A successful settings response proves the write succeeded, not that the app reads the key you changed.
Command reference
npx rivtor env ls
npx rivtor status
These commands illustrate the documented workflow. Replace example addresses and identifiers with your own. Deployment and migration commands affect the selected project; confirm the target before running them.
Map each variable to a reader and a stage
| Example | Reader | When to investigate |
|---|---|---|
| DATABASE_URL | API or server-side database client | Startup and database requests |
| NEXT_PUBLIC_API_URL | Frontend build and browser code | Build output and network requests |
| REDIS_URL | API producer or worker | Job submission and consumption |
Inspect whether a variable is absent, empty, malformed or pointing to the wrong environment. Logging its name and presence is usually enough to identify missing configuration; logging the complete value can expose credentials.
Choose a restart or rebuild from the failure
If a server reads configuration at startup, it needs a restarted process to observe a changed value. If a public value was embedded during a frontend build, it needs a new frontend bundle. Rivtor's CLI environment reference describes supported commands and whether they restart services.
Do not assume changing an API setting updates an independently built frontend. Check each affected service and inspect the actual outgoing browser request after the next release.
Verify with a bounded diagnostic
Use a disposable test value or a boolean presence check in private development logs. Remove temporary diagnostics before publication. Review the deployment plan for required variable names and supply real values through the documented secret workflow.
See Next.js and FastAPI CORS for address debugging and Next.js environment-variable documentation for build-time behavior.
Next steps
Read the Rivtor reference for supported configuration and limitations, and use the deployment quickstart when trying Rivtor for the first time. Validate workflows with synthetic data before connecting valuable production records.