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] Saved object import error messages are not displayed #795

Open
wandergeek opened this issue Sep 25, 2024 · 0 comments
Open

[Bug] Saved object import error messages are not displayed #795

wandergeek opened this issue Sep 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@wandergeek
Copy link
Contributor

Describe the bug

Saved object import error messages are not displayed even though they are available in the API response.

To Reproduce

  1. Apply the following savedsearch.tf file.
  2. The error from the provider is
Error: failed to import saved objects

  with module.test__cluster-mgmt-a.elasticstack_kibana_import_saved_objects.settings,
  on ../../modules/test/savedsearch.tf line 1, in resource "elasticstack_kibana_import_saved_objects" "settings":
   1: resource "elasticstack_kibana_import_saved_objects" "settings" {

422 Unprocessable Entity

Expected behavior
When you apply this via the UI, you get extra information:

Sorry, there was an error

The file could not be processed due to error: "Unprocessable Entity: Document "140f79f5-810b-4df9-be40-8370c4272ef1" belongs to a more recent version of Kibana [10.3.0] when the last known version is [7.9.3]."

And indeed, you can see this being returned by the import API when inspecting the request in devtools.

Debug output

2024-09-25T10:14:30.225+1000 [TRACE] provider.terraform-provider-elasticstack_v0.11.7: Received downstream response: @caller=github.com/hashicorp/[email protected]/tfprotov6/internal/tf6serverlogging/downstream_request.go:42 diagnostic_warning_count=0 tf_req_duration_ms=111 tf_req_id=2b8d690f-5b25-3d1a-8015-387b5c83b51e @module=sdk.proto diagnostic_error_count=1 tf_proto_version=6.6 tf_provider_addr=registry.terraform.io/elastic/elasticstack tf_resource_type=elasticstack_kibana_import_saved_objects tf_rpc=ApplyResourceChange timestamp="2024-09-25T10:14:30.225+1000"
2024-09-25T10:14:30.225+1000 [ERROR] provider.terraform-provider-elasticstack_v0.11.7: Response contains error diagnostic: diagnostic_summary="failed to import saved objects" tf_provider_addr=registry.terraform.io/elastic/elasticstack tf_resource_type=elasticstack_kibana_import_saved_objects @caller=github.com/hashicorp/[email protected]/tfprotov6/internal/diag/diagnostics.go:58 @module=sdk.proto diagnostic_detail="422 Unprocessable Entity" diagnostic_severity=ERROR tf_proto_version=6.6 tf_req_id=2b8d690f-5b25-3d1a-8015-387b5c83b51e tf_rpc=ApplyResourceChange timestamp="2024-09-25T10:14:30.225+1000"
2024-09-25T10:14:30.225+1000 [TRACE] provider.terraform-provider-elasticstack_v0.11.7: Served request: @caller=github.com/hashicorp/[email protected]/tfprotov6/tf6server/server.go:878 @module=sdk.proto tf_req_id=2b8d690f-5b25-3d1a-8015-387b5c83b51e tf_proto_version=6.6 tf_provider_addr=registry.terraform.io/elastic/elasticstack tf_resource_type=elasticstack_kibana_import_saved_objects tf_rpc=ApplyResourceChange timestamp="2024-09-25T10:14:30.225+1000"
2024-09-25T10:14:30.225+1000 [TRACE] maybeTainted: module.test__cluster-mgmt-a.elasticstack_kibana_import_saved_objects.settings encountered an error during creation, so it is now marked as tainted

Versions (please complete the following information):

  • Provider version v0.11.7

Additional context
Add any other context about the problem here.

@wandergeek wandergeek added the bug Something isn't working label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant