-
Notifications
You must be signed in to change notification settings - Fork 554
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
Error message for failed importing is a bit missleading #3023
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
I'm keen to work on this issue |
this doesn't look like a bug but user error with the wrong ID?
|
thanks for your timely reply jacob, I just confirmed that it's because of the wrong list ID. |
in most cases, what is happening here is normal behaviour. the end user provides the |
Yeah it's very tricky I agree and an extra API call probably doesn't worth it. How about just make the error message provides a little bit more context? I only created this issue because the error message said that "This is generally a bug in the resource implementation for import. ... Please report this to the provider developers." Since this error is expected when a wrong identifier is provided, could this error message contains something like "This could be caused by a wrong resource id is provided." I could fix the import command in seconds if I knew it's the id problem from the error message. Just tried the error message for cloudflare_account_member importing is quite good
|
the terraform-provider-cloudflare/internal/sdkv2provider/resource_cloudflare_account_member.go Lines 137 to 140 in 7c5bbad
while this works, it basically makes you have an additional API call per import operation (which in some cases, is doubling the API calls made). |
I am wondering if maybe we encounter errors, we can turn on a debug mode somehow? I am encountering this issue with importing worker script and was very worried that something was wrong on provider side. |
terraform has the ability through logging to view the internals - https://developer.hashicorp.com/terraform/internals/debugging |
Confirmation
Terraform and Cloudflare provider version
terraform -v
Terraform v1.6.6
on darwin_amd64
Affected resource(s)
cloudflare_list
cloudflare_list_item
Terraform configuration files
Link to debug output
https://gist.github.com/ztNIE/ae5456c503b66e544becb7ee0ffb7c05
Panic output
No response
Expected output
It should import the resource successfully.
Actual output
╷
│ Error: The provider returned a resource missing an identifier during ImportResourceState. This is generally a bug in the resource implementation for import. Resource import code should not call d.SetId("") or create an empty ResourceData. If the resource is missing, instead return an error. Please report this to the provider developers.
│
│
╵
Steps to reproduce
Additional factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: