2 months ago
Hello, I'm facing a persistent issue where one of my environment variables (ELEVENLABS_API_KEY) is causing a 401 Unauthorized error when my Node.js application tries to use it.
I have 100% confirmed that:
The API key value is correct (it works perfectly in a local test script on my machine).
The application code correctly reads the variable using
process.env.ELEVENLABS_API_KEY.I have tried deleting the variable, redeploying, re-adding the variable, and redeploying again, but the issue persists.
It seems like the old/invalid value is cached somewhere on the platform and is not being updated for my deployment.
Can you please help me check if there's a caching issue on your end for my project's environment variables?
10 Replies
2 months ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
Railway
Hey there! We've found the following might help you get unblocked faster: - [📚 Railway vs. VPS Hosting](https://docs.railway.com/maturity/compare-to-vps) - [🧵 Env Vars and index.ts Not Updating After Deploy](https://station.railway.com/questions/env-vars-and-index-ts-not-updating-after-7e437b63) - [🧵 Python script can't load env variables from Railway](https://station.railway.com/questions/python-script-can-t-load-env-variables-f-659ea989) If you find the answer from one of these, please let us know by solving the thread!
2 months ago
I've tried the second solution (
Env Vars and index.ts Not Updating After Deploy ) and it unfortunately doesn't work.
2 months ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open brody • 2 months ago
2 months ago
Silly question but this happens more often than you might think, did you deploy the changes after changing the variable and or redeploy the downstream services if this is a shared variable
dev
Silly question but this happens more often than you might think, did you deploy the changes after changing the variable and or redeploy the downstream services if this is a shared variable
2 months ago
Hey, yep I've already did it multiple times, and even as I'm writing this down, I did it 5min ago.
2 months ago
Hey there! In the part of your script that references this variable, are you able to print that to your logs and validate that this matches your working value?
Unsure if you have already checked this but would like to validate that its actually a value desync.
noahd
Hey there! In the part of your script that references this variable, are you able to print that to your logs and validate that this matches your working value? Unsure if you have already checked this but would like to validate that its actually a value desync.
2 months ago
2 months ago
Are you using ElevenLabs HTTP API or some sort of SDK? Can you show us where you read and then use the variable? Maybe it'll give us some hints as to what is going on
dev
Are you using ElevenLabs HTTP API or some sort of SDK? Can you show us where you read and then use the variable? Maybe it'll give us some hints as to what is going on
2 months ago
2 months ago
do you have any ip restriction in elevenlabs?
2 months ago
Hey everyone, I've just found out the solution : my problem was that the variable for the Voice ID wasn't correct lmao so it just kept putting an error everytime the API key was being sent.
I'm sorry for losing everyone time on such small problems.
Status changed to Solved chandrika • 2 months ago