Back

Error creating a variable for a function

  • 0
  • Self Hosted
  • Functions
Vincent Berthoumieux
20 Dec, 2024, 10:39

I'm trying to create a var but i get the error 'Variable with the same ID already exists in this project.' But this function id has no vars defined and the project has 3 vars but with different ids. what am I missing ?

TypeScript
➜  dev git:(main) ✗ appwrite functions create-variable --key useLocalEndpoint --value false --function-id xnotes-cancel-schedule

Info: For detailed error pass the --verbose or --report flag
Error: Variable with the same ID already exists in this project. Try again with a different ID.
➜  dev git:(main) ✗ appwrite functions list-variables --function-id  xnotes-cancel-schedule                                     

total : 0
variables
[]

➜  dev git:(main) ✗ aw project list-variables
total : 3
variables
                                                                                                                                                      
->> xClientSecret, xRedirectUri, xRedirectUri
TL;DR
Issue: Getting 'Variable with the same ID already exists in this project' error when trying to create a variable for a function, even though the function ID has no variables defined and the project has 3 variables with different IDs. Solution: Check the function and project variables to ensure there are no duplicates IDs present, and try creating the variable again with a unique ID that does not already exist in the project.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more