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

No way to migrate coralogix_tco_policy_logs to coralogix_tco_policies_logs blocks upgrade #299

Open
pkoltermann opened this issue Dec 10, 2024 · 3 comments

Comments

@pkoltermann
Copy link

Affected Resource(s)

  • coralogix_tco_policies_logs

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

provider version >= 1.18.0

Debug Output

For version >= 1.18.0 && < 1.18.2:

╷
│ Error: Failed to load plugin schemas
│ 
│ Error while loading schemas for plugin components: Failed to obtain
│ provider schema: Could not load the schema for provider
│ registry.terraform.io/coralogix/coralogix: failed to instantiate provider
│ "registry.terraform.io/coralogix/coralogix" to obtain schema: Unrecognized
│ remote plugin message: 
│ Failed to read any lines from plugin's stdout
│ This usually means
│   the plugin was not compiled for this architecture,
│   the plugin is missing dynamic-link libraries necessary to run,
│   the plugin is not executable by this process due to file permissions, or
│   the plugin failed to negotiate the initial go-plugin protocol handshake
│ 
│ Additional notes about plugin:
│   Path: .terraform/providers/registry.terraform.io/coralogix/coralogix/1.18.0/linux_amd64/terraform-provider-coralogix_1.18.0
│   Mode: -rwxr-xr-x
│   Owner: 1001 [] (current: 1001 [])
│   Group: 1001 [] (current: 1001 [])
│   ELF architecture: EM_X86_64 (current architecture: amd64)
│ ..
╵

Stack trace from the terraform-provider-coralogix_1.18.0 plugin:

panic: proto: extension number 5001 is already registered on message google.protobuf.MethodOptions
        previously from: "terraform-provider-coralogix/coralogix/clientset/grpc/integrations"
        currently from:  "terraform-provider-coralogix/coralogix/clientset/grpc/rules-groups/v1"
See https://protobuf.dev/reference/go/faq#namespace-conflict


goroutine 1 [running]:
google.golang.org/protobuf/reflect/protoregistry.glob..func1({0x1383d00?, 0xc0002dc7e0?}, {0x1383d00?, 0xc0002dc820})
        google.golang.org/[email protected]/reflect/protoregistry/registry.go:56 +0x1ee
google.golang.org/protobuf/reflect/protoregistry.(*Types).RegisterExtension(0xc000124240, {0x1397320, 0x1be7680})
        google.golang.org/[email protected]/reflect/protoregistry/registry.go:554 +0x2ef
google.golang.org/protobuf/internal/filetype.Builder.Build({{{0xf92c1a, 0x45}, {0x1b69c40, 0xb90, 0xb90}, 0x0, 0xb, 0x1, 0x1, {0x0, ...}, ...}, ...})
        google.golang.org/[email protected]/internal/filetype/build.go:236 +0x659
terraform-provider-coralogix/coralogix/clientset/grpc/rules-groups/v1.file_com_coralogix_rules_v1_rule_groups_service_proto_init()
        terraform-provider-coralogix/coralogix/clientset/grpc/rules-groups/v1/rule_groups_service.pb.go:1094 +0x218
terraform-provider-coralogix/coralogix/clientset/grpc/rules-groups/v1.init.2()
        terraform-provider-coralogix/coralogix/clientset/grpc/rules-groups/v1/rule_groups_service.pb.go:934 +0x17

Error: The terraform-provider-coralogix_1.18.0 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

ERRO[0018] 1 error occurred:
        * exit status 1

For version >= 1.18.2

│ Error: no schema available for module.coralogix-tco-policies.coralogix_tco_policy_traces.this[0] while reading state; this is a bug in Terraform and should be reported

Expected Behavior

I understand that with the version coralogix_tco_policy_logs got replaced by coralogix_tco_policies_logs but i would expect any kind instruction on how to migrate the state. We have a lot of tco rules and we need to migrate it to the new format to be able to upgrade the provider.

Actual Behavior

No instructions just an information to use new object type. We are not able to import the rules (no instructions on what id to use for the import in the documentations nor a way to get the rule id in the ui, nor migrate the state).

Steps to Reproduce

  1. terraform init -upgrade && terraform plan

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@calvin-chau-coralogix
Copy link

Hello,

Thank you for creating this detailed issue, our team is actively working on this and should have an update to the SDK soon to unblock you.

Appreciate your continued patience in the interim.

Best,
Calvin

@ivancoralsupp
Copy link

Hello, our RnD worked and provided this a solution: https://github.com/coralogix/coralogix-management-sdk/tree/master/tools/terraform-importer.

@celaus
Copy link
Collaborator

celaus commented Jan 7, 2025

@pkoltermann did this solve your issue? Let us know if we can help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants