msanieM
Convex Community6mo ago
2 replies
msanie

Environment Variables Not Syncing to Backend Deployment

Hello Convex Support Team,
I am experiencing a critical issue where environment variables set in my project's dashboard are not being loaded into my backend functions.
The Problem:
My application requires a STRIPE_SECRET_KEY to process payments. I have set this variable correctly in the Convex dashboard under Settings -> Environment Variables. However, when my backend action (checkout:createCheckoutSession) runs, the key is not present in process.env.
Evidence from Logs:
We have added logging to the backend function to print all available environment variable keys. The STRIPE_SECRET_KEY is consistently missing from this list. Here is a snippet from the server logs:
'Available environment variable keys:' [
'PATH',
'PWD',
'LANG',
'NODE_PATH',
'TZ',
'AUTUMN_SECRET_KEY',
'CONVEX_CLOUD_URL',
'CONVEX_SITE_URL',
'JWKS',
'JWT_PRIVATE_KEY',
'RESEND_API_KEY',
'SITE_URL',
'VLY_APP_NAME'
]

As you can see, the Stripe key is not included. This results in a "Stripe not configured" error, which stops our checkout process.
Troubleshooting Steps Taken:
1. Verified the variable name is spelled correctly (STRIPE_SECRET_KEY).
2. Deleted and re-entered the key multiple times.
3. Confirmed we are using the correct Stripe Test Key (sk_test_...).
4. Added a new, temporary environment variable (FORCE_REFRESH) to try and force a full environment sync, but this new variable also did not appear in the logs.
This strongly indicates a platform-level synchronization issue between the dashboard settings and the running backend environment.
Could you please investigate the environment variable synchronization for my project and ensure that the variables I set in the dashboard are correctly loaded into the backend?
Thank you for your help.
Was this page helpful?