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] mongodb cluster create panic: DCS initialize failed: KB_CLUSTER_NAME must be set #8748

Closed
JashBook opened this issue Jan 6, 2025 · 2 comments
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@JashBook
Copy link
Collaborator

JashBook commented Jan 6, 2025

Describe the bug

kbcli version
Kubernetes: v1.28.3-vke.17
KubeBlocks: 1.0.0-beta.21
kbcli: 1.0.0-beta.8

To Reproduce
Steps to reproduce the behavior:

  1. create cluster
apiVersion: apps.kubeblocks.io/v1
kind: Cluster
metadata:
  name: mongo-cluster
  namespace: default
  labels: 
    helm.sh/chart: mongodb-cluster-1.0.0-alpha.0
    app.kubernetes.io/version: "5.0.14"
    app.kubernetes.io/instance: mongo-cluster
  annotations:
    kubeblocks.io/host-network: mongodb
spec:
  terminationPolicy: Delete
  clusterDef: mongodb
  topology: replicaset
  componentSpecs:
    - name: mongodb
      serviceVersion: 6.0.16      
      replicas: 1
      serviceAccountName: kb-mongo-cluster      
      resources:
        limits:
          cpu: "0.5"
          memory: "0.5Gi"
        requests:
          cpu: "0.5"
          memory: "0.5Gi"      
      volumeClaimTemplates:
        - name: data # ref clusterDefinition components.containers.volumeMounts.name
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 20Gi
  1. Click on '....'
  2. Scroll down to '....'
  3. See error
➜  ~ kubectl get cluster mongo-cluster 
NAME            CLUSTER-DEFINITION   TERMINATION-POLICY   STATUS   AGE
mongo-cluster   mongodb              Delete               Failed   5m14s
➜  ~ kubectl get pod -l app.kubernetes.io/instance=mongo-cluster                                                               
NAME                      READY   STATUS             RESTARTS      AGE
mongo-cluster-mongodb-0   1/2     CrashLoopBackOff   4 (83s ago)   5m31s

logs pod

➜  ~ kubectl logs mongo-cluster-mongodb-0 --previous 
Defaulted container "mongodb" out of: mongodb, kbagent, init-syncer (init), kbagent-worker (init)
2025-01-06T05:31:18Z	DEBUG	Starting syncer	{"version": "63a1b2d644fed9116141acb54260394dd730909b"}
2025-01-06T05:31:18Z	INFO	Initialize DB manager
2025-01-06T05:31:18Z	DEBUG	KB_WORKLOAD_TYPE ENV not set
panic: DCS initialize failed: KB_CLUSTER_NAME must be set

goroutine 1 [running]:
main.main()
	/src/cmd/syncer/main.go:51 +0x2e5

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):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@JashBook JashBook added the kind/bug Something isn't working label Jan 6, 2025
@JashBook JashBook added this to the Release 1.0.0 milestone Jan 6, 2025
@JashBook
Copy link
Collaborator Author

JashBook commented Jan 6, 2025

apecloud-mysql error

apiVersion: apps.kubeblocks.io/v1
kind: Cluster
metadata:
  name: apemysql-cluster
  namespace: default
  labels:

    helm.sh/chart: apecloud-mysql-cluster-1.0.0-alpha.0
    app.kubernetes.io/version: "8.0.30"
    app.kubernetes.io/instance: apemysql-cluster
spec:
  terminationPolicy: Delete
  clusterDef: apecloud-mysql # ref clusterdefinition.name
  topology: apecloud-mysql
  componentSpecs:
    - name: mysql
      serviceVersion: 8.0.30
      disableExporter: true
      schedulingPolicy:
        affinity:
          podAntiAffinity:
            preferredDuringSchedulingIgnoredDuringExecution:
            - podAffinityTerm:
                labelSelector:
                  matchLabels:
                    app.kubernetes.io/instance: apemysql-cluster
                    apps.kubeblocks.io/component-name: mysql
                topologyKey: kubernetes.io/hostname
              weight: 100
            requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchLabels:
                  app.kubernetes.io/instance: apemysql-cluster
                  apps.kubeblocks.io/component-name: mysql
              topologyKey: kubernetes.io/hostname
      replicas: 1
      resources:
        limits:
          cpu: "0.5"
          memory: "0.5Gi"
        requests:
          cpu: "0.5"
          memory: "0.5Gi"
      volumeClaimTemplates:
        - name: data # ref clusterDefinition components.containers.volumeMounts.name
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 20Gi

see error

➜  ~ kubectl get cluster apemysql-cluster
NAME               CLUSTER-DEFINITION   TERMINATION-POLICY   STATUS   AGE
apemysql-cluster   apecloud-mysql       Delete               Failed   2m
➜  ~ 
➜  ~ kubectl get pod -l app.kubernetes.io/instance=apemysql-cluster
NAME                       READY   STATUS   RESTARTS      AGE
apemysql-cluster-mysql-0   3/4     Error    3 (28s ago)   2m9s

logs error pod

➜  ~ kubectl logs apemysql-cluster-mysql-0 --previous 
Defaulted container "mysql" out of: mysql, vtablet, kbagent, config-manager, init-data (init), init-syncer (init), init-dbctl (init), init-kbagent (init), kbagent-worker (init)
2025-01-06T05:36:52Z	DEBUG	Starting syncer	{"version": "63a1b2d644fed9116141acb54260394dd730909b"}
2025-01-06T05:36:52Z	INFO	Initialize DB manager
2025-01-06T05:36:52Z	DEBUG	KB_WORKLOAD_TYPE ENV not set
panic: DCS initialize failed: KB_CLUSTER_NAME must be set

goroutine 1 [running]:
main.main()
	/src/cmd/syncer/main.go:51 +0x2e5

@xuriwuyun
Copy link
Contributor

the addon is outdated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants