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] Rancher 2.7 gives error Error: Setting cluster V2 legacy data: Malformed version after provisioning cluster #1423

Open
markusewalker opened this issue Oct 14, 2024 · 1 comment
Labels
kind/bug team/area2 Belongs to Team 2.

Comments

@markusewalker
Copy link
Contributor

Rancher Server Setup

  • Rancher version: v2.7.16-alpha5
  • Installation option (Docker install/Helm Chart): Helm
    • If Helm Chart, Kubernetes Cluster and version (RKE1, RKE2, k3s, EKS, etc): RKE2
  • Proxy/Cert Details:

Information about the Cluster

  • Kubernetes version: v1.26.15+k3s1
  • Cluster Type (Local/Downstream): Downstream
    • If downstream, what type of cluster? (Custom/Imported or specify provider for Hosted/Infrastructure Provider): Linode

User Information

  • What is the role of the user logged in? (Admin/Cluster Owner/Cluster Member/Project Owner/Project Member/Custom) Cluster Owner
    • If custom, define the set of permissions:

Provider Information

  • What is the version of the Rancher v2 Terraform Provider in use? 3.0.0
  • What is the version of Terraform in use? v1.9.5

Describe the bug

When performing release testing with v2.7.16-alpha5, QA automation picked up the following issue after a cluster finishes provisioning:

Error:      	Received unexpected error:
        	            	FatalError{Underlying: error while running command: exit status 1; 
        	            	Error: Setting cluster V2 legacy data: Malformed version: 
        	            	
        	            	  with rancher2_cluster_v2.rancher2_cluster_v2,
        	            	  on main.tf line 45, in resource "rancher2_cluster_v2" "rancher2_cluster_v2":
        	            	  45: resource "rancher2_cluster_v2" "rancher2_cluster_v2" {
        	            	}

Utilizing the same main.tf, 2.8 and 2.9 are working as expected, using Rancher2 4.x.x and 5.x.x, respectively. Here is the main.tf:

terraform {
  required_providers {
    rancher2 = {
      source  = "rancher/rancher2"
      version = "3.0.0"
    }
  }
}

provider "rancher2" {
  api_url   = "https://..."
  token_key = "<removed>"
  insecure  = true
}

resource "rancher2_user" "rancher2_user" {
  name     = "auto-testuser-ofcvi"
  username = "auto-testuser-ofcvi"
  password = "<removed>"
  enabled  = true
}

resource "rancher2_global_role_binding" "rancher2_global_role_binding" {
  name           = "auto-testuser-ofcvi"
  global_role_id = "user"
  user_id        = rancher2_user.rancher2_user.id
}

resource "rancher2_cloud_credential" "rancher2_cloud_credential" {
  name = "mew-tf-creds"
  linode_credential_config {
    token = "<removed>"
  }
}

resource "rancher2_machine_config_v2" "rancher2_machine_config_v2" {
  generate_name = "mew-tf"
  linode_config {
    image     = "linode/ubuntu22.04"
    region    = "us-east"
    root_pass = "<removed>"
  }
}

resource "rancher2_cluster_v2" "rancher2_cluster_v2" {
  name                                     = "auto-tfp-snljv"
  kubernetes_version                       = "v1.27.16+k3s1"
  enable_network_policy                    = false
  default_cluster_role_for_project_members = "true"
  rke_config {
    machine_pools {
      name                         = "auto-tfp-ieqzk0"
      cloud_credential_secret_name = rancher2_cloud_credential.rancher2_cloud_credential.id
      control_plane_role           = false
      etcd_role                    = true
      worker_role                  = false
      quantity                     = 1
      machine_config {
        kind = rancher2_machine_config_v2.rancher2_machine_config_v2.kind
        name = rancher2_machine_config_v2.rancher2_machine_config_v2.name
      }
    }
    machine_pools {
      name                         = "auto-tfp-ieqzk1"
      cloud_credential_secret_name = rancher2_cloud_credential.rancher2_cloud_credential.id
      control_plane_role           = true
      etcd_role                    = false
      worker_role                  = false
      quantity                     = 1
      machine_config {
        kind = rancher2_machine_config_v2.rancher2_machine_config_v2.kind
        name = rancher2_machine_config_v2.rancher2_machine_config_v2.name
      }
    }
    machine_pools {
      name                         = "auto-tfp-ieqzk2"
      cloud_credential_secret_name = rancher2_cloud_credential.rancher2_cloud_credential.id
      control_plane_role           = false
      etcd_role                    = false
      worker_role                  = true
      quantity                     = 1
      machine_config {
        kind = rancher2_machine_config_v2.rancher2_machine_config_v2.kind
        name = rancher2_machine_config_v2.rancher2_machine_config_v2.name
      }
    }
    upgrade_strategy {
      control_plane_concurrency = "10%"
      worker_concurrency        = "10%"
    }
  }
}

To Reproduce

  1. Setup Rancher v2.7.16-alpha5.
  2. Provision a downstream K3s cluster (RKE1 or RKE2 yields the same result).
  3. Note that you receive error Setting cluster V2 legacy data: Malformed version after cluster is provisioned.

Actual Result

Cluster should provision without any issue.

Expected Result

Cluster returns an error after provisioning is done.

@markusewalker markusewalker added kind/bug team/area2 Belongs to Team 2. labels Oct 14, 2024
@markusewalker markusewalker added this to the December Release 2024 milestone Oct 14, 2024
@markusewalker
Copy link
Contributor Author

FYI that I reproduced this using vanilla Terraform with the above main.tf. So this is not just specific to QA automation.

@snasovich snasovich removed this from the December Release 2024 milestone Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug team/area2 Belongs to Team 2.
Projects
None yet
Development

No branches or pull requests

2 participants