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] xtrabackup error: Job.batch is invalid: spec.template.spec.containers[0].env[4].valueFrom.secretKeyRef.key: Required value #5378

Closed
JashBook opened this issue Oct 11, 2023 · 1 comment · Fixed by #5342
Assignees
Labels
bug kind/bug Something isn't working
Milestone

Comments

@JashBook
Copy link
Collaborator

Describe the bug
xtrabackup error:
Creating backup failed, error: Job.batch "dp-backup-backup-default-mysql-opuiou-20231011101333-efe30e16" is invalid: [spec.template.spec.containers[0].env[4].valueFrom.secretKeyRef.key: Required value, spec.template.spec.containers[0].env[5].valueFrom.secretKeyRef.key: Required value, spec.template.spec.containers[1].env[4].valueFrom.secretKeyRef.key: Required value, spec.template.spec.containers[1].env[5].valueFrom.secretKeyRef.key: Required value]

kbcli version
Kubernetes: v1.26.3
KubeBlocks: 0.7.0-beta.0
kbcli: 0.7.0-beta.0

To Reproduce
Steps to reproduce the behavior:

  1. create cluster
  2. do xtrabackup
  3. See error
kubectl get backup
NAME                                         POLICY                             METHOD       REPO                    STATUS   TOTAL-SIZE   DURATION   CREATION-TIME          COMPLETION-TIME   EXPIRATION-TIME
backup-default-mysql-opuiou-20231011101333   mysql-opuiou-mysql-backup-policy   xtrabackup   backuprepo-kbcli-test   Failed                           2023-10-11T02:13:33Z                     2023-10-18T02:13:33Z

describe backup

kubectl describe backup backup-default-mysql-opuiou-20231011101333
Name:         backup-default-mysql-opuiou-20231011101333
Namespace:    default
Labels:       app.kubernetes.io/instance=mysql-opuiou
              app.kubernetes.io/managed-by=kubeblocks
              apps.kubeblocks.io/component-name=mysql
              dataprotection.kubeblocks.io/backup-repo-name=backuprepo-kbcli-test
              dataprotection.kubeblocks.io/backup-type=Full
              dataprotection.kubeblocks.io/cluster-uid=bc6a8b30-42fc-4d94-8916-fdd0e4f2ca32
              kubeblocks.io/backup-protection=retain
Annotations:  dataprotection.kubeblocks.io/target-pod-name: mysql-opuiou-mysql-0
              kubeblocks.io/cluster-snapshot:
                {"metadata":{"name":"mysql-opuiou","namespace":"default","creationTimestamp":null},"spec":{"clusterDefinitionRef":"apecloud-mysql","cluste...
API Version:  dataprotection.kubeblocks.io/v1alpha1
Kind:         Backup
Metadata:
  Creation Timestamp:  2023-10-11T02:13:33Z
  Finalizers:
    dataprotection.kubeblocks.io/finalizer
  Generation:        1
  Resource Version:  729635
  UID:               efe30e16-8085-46f6-b318-cdf014622a55
Spec:
  Backup Method:       xtrabackup
  Backup Policy Name:  mysql-opuiou-mysql-backup-policy
  Deletion Policy:     Delete
  Retention Period:    7d
Status:
  Actions:
    Action Type:  Job
    Name:         dp-backup
    Phase:        New
  Backup Method:
    Action Set Name:   xtrabackup-for-apecloud-mysql
    Name:              xtrabackup
    Snapshot Volumes:  false
    Target Volumes:
      Volume Mounts:
        Mount Path:              /data/mysql
        Name:                    data
  Backup Repo Name:              backuprepo-kbcli-test
  Expiration:                    2023-10-18T02:13:33Z
  Failure Reason:                Job.batch "dp-backup-backup-default-mysql-opuiou-20231011101333-efe30e16" is invalid: [spec.template.spec.containers[0].env[4].valueFrom.secretKeyRef.key: Required value, spec.template.spec.containers[0].env[5].valueFrom.secretKeyRef.key: Required value, spec.template.spec.containers[1].env[4].valueFrom.secretKeyRef.key: Required value, spec.template.spec.containers[1].env[5].valueFrom.secretKeyRef.key: Required value]
  Format Version:                0.1.0
  Path:                          /default/mysql-opuiou-bc6a8b30-42fc-4d94-8916-fdd0e4f2ca32/mysql/backup-default-mysql-opuiou-20231011101333
  Persistent Volume Claim Name:  pvc-backuprepo-kbcli-test-sfn6wv
  Phase:                         Failed
  Start Timestamp:               2023-10-11T02:13:33Z
  Target:
    Connection Credential:
      Host Key:      host
      Password Key:  
      Port Key:      port
      Secret Name:   mysql-opuiou-conn-credential
      Username Key:  
    Pod Selector:
      Match Labels:
        app.kubernetes.io/instance:         mysql-opuiou
        app.kubernetes.io/managed-by:       kubeblocks
        apps.kubeblocks.io/component-name:  mysql
        kubeblocks.io/role:                 follower
      Strategy:                             Any
    Service Account Name:                   kb-mysql-opuiou
Events:
  Type     Reason               Age    From               Message
  ----     ------               ----   ----               -------
  Normal   CreatingJob          8m14s  backup-controller  creating job default/dp-backup-backup-default-mysql-opuiou-20231011101333-efe30e16
  Warning  FailedCreatedBackup  8m14s  backup-controller  Creating backup failed, error: Job.batch "dp-backup-backup-default-mysql-opuiou-20231011101333-efe30e16" is invalid: [spec.template.spec.containers[0].env[4].valueFrom.secretKeyRef.key: Required value, spec.template.spec.containers[0].env[5].valueFrom.secretKeyRef.key: Required value, spec.template.spec.containers[1].env[4].valueFrom.secretKeyRef.key: Required value, spec.template.spec.containers[1].env[5].valueFrom.secretKeyRef.key: Required value]

Expected behavior
xtrabackup successs.

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 Oct 11, 2023
@JashBook JashBook added this to the Release 0.7.0 milestone Oct 11, 2023
@JashBook JashBook linked a pull request Oct 11, 2023 that will close this issue
@JashBook
Copy link
Collaborator Author

fix via #5342

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

Successfully merging a pull request may close this issue.

3 participants