apecloud / kubeblocks

KubeBlocks is an open-source control plane software that runs and manages databases, message queues and other stateful applications on K8s.
https://kubeblocks.io
GNU Affero General Public License v3.0
2.08k stars 170 forks source link

[BUG] kubeblocks upgrade form 0.9.0-beta.29 to 0.9.0-beta.30 error: "kafka-cc" is invalid: spec.fileFormatConfig: Required value #7503

Closed JashBook closed 3 months ago

JashBook commented 4 months ago

Describe the bug

kbcli version
Kubernetes: v1.26.3
KubeBlocks: 0.9.0-beta.29
kbcli: 0.9.0-beta.24

To Reproduce Steps to reproduce the behavior:

  1. install kubeblocks
    
    kbcli kubeblocks install --version 0.9.0-beta.29                                     
    KubeBlocks will be installed to namespace "kb-system"
    Kubernetes version 1.26.3
    kbcli version 0.9.0-beta.24
    Collecting data from cluster                       OK
    Kubernetes cluster preflight                       OK
    Warn
    - This application requires at least 3 nodes
    - The default storage class was not found. You can use option --set storageClass=<storageClassName> when creating cluster
    Create CRDs                                        OK
    Add and update repo kubeblocks                     OK
    Install KubeBlocks 0.9.0-beta.29                   OK
    Wait for addons to be enabled
    apecloud-mysql                                   OK
    kafka                                            OK
    mongodb                                          OK
    postgresql                                       OK
    pulsar                                           OK
    redis                                            OK
    snapshot-controller                              OK

KubeBlocks 0.9.0-beta.29 installed to namespace kb-system SUCCESSFULLY!

-> Basic commands for cluster: kbcli cluster create -h # help information about creating a database cluster kbcli cluster list # list all database clusters kbcli cluster describe # get cluster information

-> Uninstall KubeBlocks: kbcli kubeblocks uninstall

2. upgrade kubeblocks

kbcli kubeblocks upgrade --auto-approve --set upgradeAddons=true --version 0.9.0-beta.30 Current KubeBlocks version 0.9.0-beta.29. Kubernetes version 1.26.3 kbcli version 0.9.0-beta.24 Add and update repo kubeblocks OK Keep addons OK Stop KubeBlocks 0.9.0-beta.29 OK Stop DataProtection OK Conversion old version[0.9.0-beta.29] CRs to new version[0.9.0-beta.30] OK Upgrade CRDs OK update new version CRs OK Upgrading KubeBlocks to 0.9.0-beta.30 FAIL error: pre-upgrade hooks failed: 1 error occurred:

3. See error

kubectl get pod -n kb-system NAME READY STATUS RESTARTS AGE kb-addon-snapshot-controller-66f5569c9d-xbds9 1/1 Running 0 4m5s kubeblocks-upgrade-hook-job-8rwwz 0/1 CrashLoopBackOff 4 (79s ago) 3m4s ➜ ~ ➜ ~ kubectl logs -n kb-system kubeblocks-upgrade-hook-job-8rwwz addon[alertmanager-webhook-adaptor] is not installed and pass addon[apecloud-otel-collector] is not installed and pass addon[aws-load-balancer-controller] is not installed and pass addon[csi-driver-nfs] is not installed and pass addon[csi-hostpath-driver] is not installed and pass addon[csi-s3] is not installed and pass addon[external-dns] is not installed and pass addon[fault-chaos-mesh] is not installed and pass addon[grafana] is not installed and pass addon[kubebench] is not installed and pass addon[kubeblocks-csi-driver] is not installed and pass addon[llm] is not installed and pass addon[loki] is not installed and pass addon[migration] is not installed and pass addon[minio] is not installed and pass addon[mysql] is not installed and pass addon[nvidia-gpu-exporter] is not installed and pass addon[nyancat] is not installed and pass addon[prometheus] is not installed and pass addon[pyroscope-server] is not installed and pass addon[qdrant] is not installed and pass addon[victoria-metrics-agent] is not installed and pass reading CRDs from path: /kubeblocks/crd read CRDs from file: apps.kubeblocks.io_backuppolicytemplates.yaml read CRDs from file: apps.kubeblocks.io_clusterdefinitions.yaml read CRDs from file: apps.kubeblocks.io_clusters.yaml read CRDs from file: apps.kubeblocks.io_clusterversions.yaml read CRDs from file: apps.kubeblocks.io_componentclassdefinitions.yaml read CRDs from file: apps.kubeblocks.io_componentdefinitions.yaml read CRDs from file: apps.kubeblocks.io_componentresourceconstraints.yaml read CRDs from file: apps.kubeblocks.io_components.yaml read CRDs from file: apps.kubeblocks.io_componentversions.yaml read CRDs from file: apps.kubeblocks.io_configconstraints.yaml read CRDs from file: apps.kubeblocks.io_configurations.yaml read CRDs from file: apps.kubeblocks.io_opsdefinitions.yaml read CRDs from file: apps.kubeblocks.io_opsrequests.yaml read CRDs from file: apps.kubeblocks.io_servicedescriptors.yaml read CRDs from file: dataprotection.kubeblocks.io_actionsets.yaml read CRDs from file: dataprotection.kubeblocks.io_backuppolicies.yaml read CRDs from file: dataprotection.kubeblocks.io_backuprepos.yaml read CRDs from file: dataprotection.kubeblocks.io_backups.yaml read CRDs from file: dataprotection.kubeblocks.io_backupschedules.yaml read CRDs from file: dataprotection.kubeblocks.io_restores.yaml read CRDs from file: dataprotection.kubeblocks.io_storageproviders.yaml read CRDs from file: experimental.kubeblocks.io_nodecountscalers.yaml read CRDs from file: extensions.kubeblocks.io_addons.yaml read CRDs from file: storage.kubeblocks.io_storageproviders.yaml read CRDs from file: workloads.kubeblocks.io_instancesets.yaml create/update CRD: backuppolicytemplates.apps.kubeblocks.io create/update CRD: clusterdefinitions.apps.kubeblocks.io create/update CRD: clusters.apps.kubeblocks.io create/update CRD: clusterversions.apps.kubeblocks.io create/update CRD: componentclassdefinitions.apps.kubeblocks.io create/update CRD: componentdefinitions.apps.kubeblocks.io create/update CRD: componentresourceconstraints.apps.kubeblocks.io create/update CRD: components.apps.kubeblocks.io create/update CRD: componentversions.apps.kubeblocks.io create/update CRD: configconstraints.apps.kubeblocks.io create/update CRD: configurations.apps.kubeblocks.io create/update CRD: opsdefinitions.apps.kubeblocks.io create/update CRD: opsrequests.apps.kubeblocks.io create/update CRD: servicedescriptors.apps.kubeblocks.io create/update CRD: actionsets.dataprotection.kubeblocks.io create/update CRD: backuppolicies.dataprotection.kubeblocks.io create/update CRD: backuprepos.dataprotection.kubeblocks.io create/update CRD: backups.dataprotection.kubeblocks.io create/update CRD: backupschedules.dataprotection.kubeblocks.io create/update CRD: restores.dataprotection.kubeblocks.io create/update CRD: storageproviders.dataprotection.kubeblocks.io create/update CRD: nodecountscalers.experimental.kubeblocks.io create/update CRD: addons.extensions.kubeblocks.io create/update CRD: storageproviders.storage.kubeblocks.io create/update CRD: instancesets.workloads.kubeblocks.io update GVR resource: apps.kubeblocks.io/v1beta1, Resource=configconstraints update resource: kafka-cc panic: ConfigConstraint.apps.kubeblocks.io "kafka-cc" is invalid: spec.fileFormatConfig: Required value

goroutine 1 [running]: github.com/apecloud/kubeblocks/cmd/helmhook/hook.CheckErr(...) /src/cmd/helmhook/hook/utils.go:38 main.main() /src/cmd/helmhook/main.go:73 +0x5c0

get kafka cc yaml

k get cc kafka-cc -oyaml apiVersion: apps.kubeblocks.io/v1beta1 kind: ConfigConstraint metadata: annotations: meta.helm.sh/release-name: kb-addon-kafka meta.helm.sh/release-namespace: default creationTimestamp: "2024-06-06T03:35:28Z" finalizers:

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

shanshanying commented 3 months ago

there are some API renaming in kbv9 beta versions. Please test upgrade from previous minor version (from 0.8) to 0.9 beta 30 and after.

sophon-zt commented 3 months ago

there are some API renaming in kbv9 beta versions. Please test upgrade from previous minor version (from 0.8) to 0.9 beta 30 and after.

Yes, beta version upgrades are not supported.

ahjing99 commented 3 months ago

upgrade from 0.9.0-beta.37 to 0.9.0-beta.38 failed for the same reason

➜  ~ kbcli kubeblocks upgrade --version 0.9.0-beta.38
Current KubeBlocks version 0.9.0-beta.37.
Kubernetes version 1.29.4
Kubernetes provider GKE
kbcli version 0.9.0-beta.27
Upgrade KubeBlocks from 0.9.0-beta.37 to 0.9.0-beta.38
Please type 'Yes/yes' to confirm your operation: yes
Add and update repo kubeblocks                     OK
Keep addons                                        OK
Stop KubeBlocks 0.9.0-beta.37                      OK
Stop DataProtection                                OK
Conversion old version[0.9.0-beta.37] CRs to new version[0.9.0-beta.38] OK
Upgrade CRDs                                       OK
update new version CRs                             OK
Upgrading KubeBlocks to 0.9.0-beta.38              FAIL
error: pre-upgrade hooks failed: 1 error occurred:
    * timed out waiting for the condition

➜  ~ k get pod -n kb-system
NAME                                            READY   STATUS             RESTARTS      AGE
kb-addon-minio-866cfbc8b5-jzswc                 1/1     Running            0             14h
kb-addon-snapshot-controller-66b659ccf4-fwp2z   1/1     Running            0             14h
kubeblocks-upgrade-hook-job-7jjf4               0/1     CrashLoopBackOff   5 (87s ago)   5m15s
➜  ~ k logs kubeblocks-upgrade-hook-job-7jjf4  -n kb-system
addon[alertmanager-webhook-adaptor] is not installed and pass
addon[apecloud-otel-collector] is not installed and pass
addon[aws-load-balancer-controller] is not installed and pass
addon[csi-driver-nfs] is not installed and pass
addon[csi-hostpath-driver] is not installed and pass
addon[csi-s3] is not installed and pass
addon[external-dns] is not installed and pass
addon[fault-chaos-mesh] is not installed and pass
addon[grafana] is not installed and pass
addon[kubebench] is not installed and pass
addon[kubeblocks-csi-driver] is not installed and pass
addon[llm] is not installed and pass
addon[loki] is not installed and pass
addon[migration] is not installed and pass
addon[nvidia-gpu-exporter] is not installed and pass
addon[nyancat] is not installed and pass
addon[prometheus] is not installed and pass
addon[pyroscope-server] is not installed and pass
addon[qdrant] is not installed and pass
addon[victoria-metrics-agent] is not installed and pass
reading CRDs from path: /kubeblocks/crd
read CRDs from file: apps.kubeblocks.io_backuppolicytemplates.yaml
read CRDs from file: apps.kubeblocks.io_clusterdefinitions.yaml
read CRDs from file: apps.kubeblocks.io_clusters.yaml
read CRDs from file: apps.kubeblocks.io_clusterversions.yaml
read CRDs from file: apps.kubeblocks.io_componentclassdefinitions.yaml
read CRDs from file: apps.kubeblocks.io_componentdefinitions.yaml
read CRDs from file: apps.kubeblocks.io_componentresourceconstraints.yaml
read CRDs from file: apps.kubeblocks.io_components.yaml
read CRDs from file: apps.kubeblocks.io_componentversions.yaml
read CRDs from file: apps.kubeblocks.io_configconstraints.yaml
read CRDs from file: apps.kubeblocks.io_configurations.yaml
read CRDs from file: apps.kubeblocks.io_opsdefinitions.yaml
read CRDs from file: apps.kubeblocks.io_opsrequests.yaml
read CRDs from file: apps.kubeblocks.io_servicedescriptors.yaml
read CRDs from file: dataprotection.kubeblocks.io_actionsets.yaml
read CRDs from file: dataprotection.kubeblocks.io_backuppolicies.yaml
read CRDs from file: dataprotection.kubeblocks.io_backuprepos.yaml
read CRDs from file: dataprotection.kubeblocks.io_backups.yaml
read CRDs from file: dataprotection.kubeblocks.io_backupschedules.yaml
read CRDs from file: dataprotection.kubeblocks.io_restores.yaml
read CRDs from file: dataprotection.kubeblocks.io_storageproviders.yaml
read CRDs from file: experimental.kubeblocks.io_nodecountscalers.yaml
read CRDs from file: extensions.kubeblocks.io_addons.yaml
read CRDs from file: storage.kubeblocks.io_storageproviders.yaml
read CRDs from file: workloads.kubeblocks.io_instancesets.yaml
create/update CRD: backuppolicytemplates.apps.kubeblocks.io
create/update CRD: clusterdefinitions.apps.kubeblocks.io
create/update CRD: clusters.apps.kubeblocks.io
create/update CRD: clusterversions.apps.kubeblocks.io
create/update CRD: componentclassdefinitions.apps.kubeblocks.io
create/update CRD: componentdefinitions.apps.kubeblocks.io
create/update CRD: componentresourceconstraints.apps.kubeblocks.io
create/update CRD: components.apps.kubeblocks.io
create/update CRD: componentversions.apps.kubeblocks.io
create/update CRD: configconstraints.apps.kubeblocks.io
create/update CRD: configurations.apps.kubeblocks.io
create/update CRD: opsdefinitions.apps.kubeblocks.io
create/update CRD: opsrequests.apps.kubeblocks.io
create/update CRD: servicedescriptors.apps.kubeblocks.io
create/update CRD: actionsets.dataprotection.kubeblocks.io
create/update CRD: backuppolicies.dataprotection.kubeblocks.io
create/update CRD: backuprepos.dataprotection.kubeblocks.io
create/update CRD: backups.dataprotection.kubeblocks.io
create/update CRD: backupschedules.dataprotection.kubeblocks.io
create/update CRD: restores.dataprotection.kubeblocks.io
create/update CRD: storageproviders.dataprotection.kubeblocks.io
create/update CRD: nodecountscalers.experimental.kubeblocks.io
create/update CRD: addons.extensions.kubeblocks.io
create/update CRD: storageproviders.storage.kubeblocks.io
create/update CRD: instancesets.workloads.kubeblocks.io
update GVR resource: apps.kubeblocks.io/v1beta1, Resource=configconstraints
update resource: elasticsearch-config-constraint
panic: ConfigConstraint.apps.kubeblocks.io "elasticsearch-config-constraint" is invalid: spec.fileFormatConfig: Required value

goroutine 1 [running]:
github.com/apecloud/kubeblocks/cmd/helmhook/hook.CheckErr(...)
    /src/cmd/helmhook/hook/utils.go:38
main.main()
    /src/cmd/helmhook/main.go:73 +0x66b
➜  ~
ahjing99 commented 3 months ago

reopen the issue, since 0.9.0-beta.37 was newly installed, and es can be run successfully on beta.37, please check whether there is a way to fix this