Skip to content
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]: Error: no value given for required property projectId #657

Open
ctang10x opened this issue Apr 26, 2024 · 14 comments
Open

[Bug]: Error: no value given for required property projectId #657

ctang10x opened this issue Apr 26, 2024 · 14 comments
Labels
area/resources/fabric Issues related to Fabric and ECX APIs bug Something isn't working

Comments

@ctang10x
Copy link

Terraform Version

Terraform v1.5.7 on darwin_amd64

Equinix Provider Version

version = ">= 1.25.1"

Effected Terraform Resources

I was importing a resource for the AWS provider. When Terraform planned, I get this error for:

Error: no value given for required property projectId
with module.equinix-aws-connection-eqx1dx1.data.equinix_fabric_ports.aside_port
on .terraform/modules/equinix-aws-connection-eqx1dx1/modules/port-connection/main.tf line 1, in data "equinix_fabric_ports" "aside_port":
data "equinix_fabric_ports" "aside_port" {

I haven't changed anything ever since this AWS DX connection was implemented 2 months ago. Why all of a sudden I get this error?

Terraform Config Files

module "equinix-aws-connection-eqx1dx1" {
source = "equinix/fabric/equinix//modules/port-connection"

connection_name = var.connection_name_eqx1dx1
connection_type = var.connection_type
notifications_type = var.notifications_type
notifications_emails = ["infrastructure@10xgenomics.com"]
bandwidth = var.bandwidth
purchase_order_number = var.purchase_order_number
additional_info = local.additional_info

A-side

aside_port_name = var.aside_port_name_eqx1dx1
aside_vlan_tag = var.aside_vlan_tag_eqxdx1
#aside_vlan_inner_tag = var.aside_vlan_inner_tag

Z-side

zside_ap_type = var.zside_ap_type
zside_ap_authentication_key = var.zside_ap_authentication_key
zside_ap_profile_type = var.zside_ap_profile_type
zside_location = var.zside_location
zside_seller_region = var.zside_seller_region
zside_sp_name = var.zside_sp_name
}

Debug Output

No response

Panic Output

No response

Expected Behavior

Why does planning a AWS change give me an error for Equinix module?

Actual Behavior

Errored out on Equinix module

Steps to Reproduce

Make any change to Terraform code for AWS provider, Equinix module errors out during Terraform plan.

@ctang10x ctang10x added the bug Something isn't working label Apr 26, 2024
@srushti-patl srushti-patl added the area/resources/fabric Issues related to Fabric and ECX APIs label Apr 26, 2024
@thogarty
Copy link
Contributor

Hi @ctang10x , we're still in progress on this issue. Would you be able to provide us with the terraform log output API response from the port data source by re-running your terraform configuration with the TF_LOG env variable set to debug?

Run export TF_LOG=debug then terraform apply. Find the response to the Port GET request and share it in this github issue.

Currently the thought is that the API response is failing to return projectId when it's a required response from the API and we need verification that the project property is being returned without it including projectId.

@ctang10x
Copy link
Author

We use TF cloud. I am not sure how to get those logs on TF cloud.

@thogarty
Copy link
Contributor

@ctang10x , would you mind trying this guide to set the ENV variable for TF Cloud? https://support.hashicorp.com/hc/en-us/articles/360001113727-Enabling-trace-level-logs-in-Terraform-CLI-Cloud-or-Enterprise

@ctang10x
Copy link
Author

ctang10x commented Apr 29, 2024

The TF plan failed, but the logs were showing up.

@thogarty
Copy link
Contributor

Thank you, @ctang10x! Our theory has been confirmed. I'm implementing the fix now.

You can see the Port API response is returning project without any contents and that's causing the failure. This is in line 30995.

@ctang10x
Copy link
Author

When will the fix be applied? We have a bunch of PR's for branches to merge.

@thogarty
Copy link
Contributor

@ctang10x, we are actively working to attempt to get the bug fixed by EOD today. I will ping you with the fixed release version once it is available.

Thank you for your patience!

@thogarty
Copy link
Contributor

@ctang10x, the fix is in code review: #660. I've requested for it to be expedited on review/approval/merge/release. Will update with the version number when it's available.

@ocobles
Copy link
Contributor

ocobles commented Apr 30, 2024

The TF plan failed, but the logs were showing up.

@ctang10x - removing shared file from your comment. These logs may contain credentials used for the different cloud providers which should have been removed before publishing. You should review it and renew credentials if necessary

@thogarty
Copy link
Contributor

Hi @ctang10x, version 1.36.1 of the provider was released this morning. It should resolve your issue. Please try again with it and let us know.

@ctang10x
Copy link
Author

Still getting error, this time:

Error: no value given for required property projectId
with module.equinix-aws-connection-eqx1dx2.equinix_fabric_connection.primary_port_connection
on .terraform/modules/equinix-aws-connection-eqx1dx2/modules/port-connection/main.tf line 30, in resource "equinix_fabric_connection" "primary_port_connection":
resource "equinix_fabric_connection" "primary_port_connection" {

@thogarty
Copy link
Contributor

thogarty commented May 1, 2024

Issue still in progress. The projectId property is not being returned by APIs beyond the ports as well. This is causing the same error wherever the API is returning project without projectId included. Patching sdk with a spec patch and following up later.

For now, the customer is unblocked by using Terraform Provider version <= 1.35.0

thogarty added a commit to equinix/equinix-sdk-go that referenced this issue May 7, 2024
* Removed required field for `projectId` from project model to resolve
customer issue with Terraform Provider
  * equinix/terraform-provider-equinix#657
* Error is caused by Equinix Fabric API returning an empty project
`project: {}` in the JSON response for PDS user accounts
* Adding temporary patch until Equinix Fabric API teams remove the empty
project from the API response
* Does affect request models as well, but the API will return the error
that project is required for those requests. Will revert as soon as we
can
thogarty added a commit that referenced this issue May 8, 2024
* Equinix PDS users have different API responses that led to the
following error:
#657
* This adds tests and upgrades the version of equinix-sdk-go to account
for the missing `projectId` property on `project` responses from the API
@thogarty
Copy link
Contributor

Hi @ctang10x , v1.36.4 has been released. You should be able to upgrade to that version without experiencing the same issue for your account. Please verify and I'll close this issue after receiving your response.

@ctang10x
Copy link
Author

@thogarty v1.36.4 has been updated. No issue seen. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/resources/fabric Issues related to Fabric and ECX APIs bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants