-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: requests to create environment variables for custom environments are created with the wrong target #255
Comments
Hi @qlimenoque, thanks for raising this. It looks like this isn't trying to create an env var with a target, but it's incorrectly detecting that it conflicts with an existing environment variable. I've reached out to the team that maintain custom environments, and we are looking into the cause together. Ideally, we'll try to get this fixed without any need to update the TF provider, as it's most likely a bug in the API regardless of version. I will keep you posted. 🙏 |
Hi @dglsparsons! Thanks for such a rapid answer Also, is it possible to make upsert request? As I can see, the documentation has optional parameters, that include upsert by default. I'd like to update the environment variable instead of having ENV_CONFLICT response |
Hi @qlimenoque, we've released a fix to our API for this. Can you give it another go and let me know if you still experience the same issue? Thanks 🙏 |
Thanks for the update! It works well now |
Thank you for the fast fixes and responses to our issues—we greatly appreciate it. |
@dglsparsons |
That's a good catch. i'll have a look at the PR as soon as I am able. Thanks for raising it! ❤ |
Please take a look at https://github.com/vercel/terraform-provider-vercel/blob/main/client/environment_variable.go#L98-L109. I believe it should display the environment ID in case of failure to make it easier to import resources into the Terraform state when they are not present (e.g., added via the Web UI but later managed with Terraform). Currently, it does not support Custom Environments. If an Environment Variable is added only to a Custom Environment, the response returns a 403 error code with |
Hi, I'm running into an error when I'm trying to create an Environment Variable resource for Custom Environment
tldr
Expected behavior:
The API should create an environment variable only for the Custom Environment with the corresponding ID
How it works now:
The API tries to create an environment variable with a target that was not specified anywhere.
Details
This is an example of the resource I am trying to create
But I get the following error
Could not create project environment variable, unexpected error: ENV_ALREADY_EXISTS - Another Environment Variable with the same Name and Environment exists in your project. Remove it or choose a different Name or Environment: unable to list environment variables to detect conflict: %!s(<nil>)
First of all, I noticed that the latest version of the API for
/projects/
is v10, but the provider makes requests to v9.After updating the version of the API used locally, I continued debugging POST requests and found out that the Vercel API was trying to create an environment variable with an incorrect target that was not even specified in the request (below is an example of a cURL request that I caught)
Request
Response:
The text was updated successfully, but these errors were encountered: