rancher / terraform-provider-rancher2

Terraform Rancher2 provider
https://www.terraform.io/docs/providers/rancher2/
Mozilla Public License 2.0
263 stars 228 forks source link

[BUG] [ERROR] waiting for cluster (c-cgq6f) to be updated: unexpected state 'error' while upgrading a RKE cluster from 1.23.10 to 1.24+ #1172

Open Turb0Fly opened 1 year ago

Turb0Fly commented 1 year ago

Rancher Server Setup

Information about the Cluster

User Information

Provider Information

Describe the bug

When upgrading a custom RKE cluster and going from dockershim to cri_dockerd Terraform errors out :

rancher2_cluster.cluster: Modifying... [id=c-8nkxk]
rancher2_cluster.cluster: Still modifying... [id=c-8nkxk, 10s elapsed]
rancher2_cluster.cluster: Still modifying... [id=c-8nkxk, 20s elapsed]
rancher2_cluster.cluster: Still modifying... [id=c-8nkxk, 30s elapsed]
rancher2_cluster.cluster: Still modifying... [id=c-8nkxk, 40s elapsed]
╷
│ Error: [ERROR] waiting for cluster (c-8nkxk) to be updated: unexpected state 'error', wanted target 'active, provisioning, pending'. last error: %!s(<nil>)     
│
│   with rancher2_cluster.cluster,
│   on rancher.tf line 13, in resource "rancher2_cluster" "cluster":
│   13: resource "rancher2_cluster" "cluster" { 

To Reproduce

  ~ resource "rancher2_cluster" "cluster" {  
        id                         = "c-8nkxk"\
        name                       = "conpl-1439-test-001"\
        # (15 unchanged attributes hidden) \

      ~ rke_config {
          ~ enable_cri_dockerd    = false -> true
          ~ kubernetes_version    = "v1.23.10-rancher1-1" -> "v1.25.9-rancher2-1"
            # (4 unchanged attributes hidden)
rancher2_cluster.cluster: Modifying... [id=c-8nkxk]
rancher2_cluster.cluster: Still modifying... [id=c-8nkxk, 10s elapsed]
rancher2_cluster.cluster: Still modifying... [id=c-8nkxk, 20s elapsed]
rancher2_cluster.cluster: Still modifying... [id=c-8nkxk, 30s elapsed]
rancher2_cluster.cluster: Still modifying... [id=c-8nkxk, 40s elapsed]
rancher2_cluster.cluster: Still modifying... [id=c-8nkxk, 50s elapsed]
rancher2_cluster.cluster: Still modifying... [id=c-8nkxk, 1m0s elapsed]
rancher2_cluster.cluster: Still modifying... [id=c-8nkxk, 1m10s elapsed]
rancher2_cluster.cluster: Still modifying... [id=c-8nkxk, 1m20s elapsed]
╷
│ Warning: Experimental feature "module_variable_optional_attrs" is active
│
│   on main.tf line 2, in terraform:
│    2:   experiments = [module_variable_optional_attrs]
│
│ Experimental features are subject to breaking changes in future minor or
│ patch releases, based on feedback.
│
│ If you have feedback on the design of this feature, please open a GitHub
│ issue to discuss it.
╵
╷
│ Error: [ERROR] waiting for cluster (c-8nkxk) to be updated: unexpected state 'error', wanted target 'active, provisioning, pending'. last error: %!s(<nil>)     
│
│   with rancher2_cluster.cluster,
│   on rancher.tf line 13, in resource "rancher2_cluster" "cluster":
│   13: resource "rancher2_cluster" "cluster" {
│
╵
Releasing state lock. This may take a few moments...
time=2023-07-18T15:34:27-04:00 level=error msg=1 error occurred:
        * exit status 1

Actual Result

Expected Result

Upgrading from 1.23 to 1.24 or later should not error out while using the rancher2 Terraform provider.

Screenshots

Additional context

I suspect it has to do with going from dockershim to cri_dockerd through the Rancher2 provider. Just enabling cri_dockerd through Terraform gives out the same error.

iTaybb commented 10 months ago

This seem to still happen when upgarding from 1.25 to 1.26 (rancher 2.7.9)

gorantornqvist-sr commented 7 months ago

Same with kubernetes_version = "v1.26.11-rancher2-1" -> "v1.27.11-rancher1-1"