I think it might using my first deployment even though I redeploy.
How much I wait for? Or is it a bug?
Summary
Developers are experiencing issues with Appwrite Functions not recognizing new environment variables after redeployment. One solution is to check all environment variables using `os.Environ()` in the code. In some cases, creating a new function from scratch resolves the problem. Additionally, there may be a caching issue with CDN. If the environment variables are not updated after redeployment, it could indicate the function is still using the initial deployment. Consider waiting for some time or report it as a possible bug.
Chirag Aggarwal
Jul 17, 2025, 08:47
if you update an environment variable, on going to your Function > Deployments screen you should see this modal
Chirag Aggarwal
Jul 17, 2025, 08:47
if its not there, it means that the function is using the latest values
Venom
Rank 3: Container
Jul 17, 2025, 08:48
But, it doesn't recognize my new env key
Venom
Rank 3: Container
Jul 17, 2025, 08:48
I've already checked that modal and redeployed
Chirag Aggarwal
Jul 17, 2025, 08:49
can you share the code? and the values?
many things can be wrong like difference in casing, typo etc.
Venom
Rank 3: Container
Jul 17, 2025, 08:49
Venom
Rank 3: Container
Jul 17, 2025, 08:49
Venom
Rank 3: Container
Jul 17, 2025, 08:49
Venom
Rank 3: Container
Jul 17, 2025, 08:50
Venom
Rank 3: Container
Jul 17, 2025, 08:52
When I create a new function freshly, then it works.
Venom
Rank 3: Container
Jul 17, 2025, 08:52
I think it rather be a CDN caching problem or so what
Chirag Aggarwal
Jul 17, 2025, 08:52
can you try using
Go
// os.Environ() returns a slice of strings in the format "key=value"
envVars := os.Environ()
to see all the env values being set in the environment
Venom
Rank 3: Container
Jul 17, 2025, 09:00
Venom
Rank 3: Container
Jul 17, 2025, 09:00
Venom
Rank 3: Container
Jul 17, 2025, 09:01
@Chirag Aggarwal Even though I redeployed, actually it might be using old one