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

error: SchemaError(io.velero.v1.Restore.spec.hooks.resources.postHooks.init.initContainers): array should have exactly one sub-item #6382

Closed
mrchirumamilla1 opened this issue Jun 12, 2023 · 9 comments
Assignees
Labels
Needs info Waiting for information staled

Comments

@mrchirumamilla1
Copy link

mrchirumamilla1 commented Jun 12, 2023


name: [Bug report](error: SchemaError(io.velero.v1.Restore.spec.hooks.resources.postHooks.init.initContainers): array should have exactly one sub-item).
about: We have a k8s(version 1.18) cluster with magnum on openstack. As per the Velero documentation latest version of Velero is compatible with k8s version 1.18. I deployed Velero successfully with the helm charts (Chart version: velero-4.0.3 and App version: 1.11.0) with storage location as minio(chart version -8.0.10 and app version latest) and was able to back up the k8s resources. But the other applications' new deployment or upgrading Velero with new values and other applications is failing with the following error:

error: SchemaError(io.velero.v1.Restore.spec.hooks.resources.postHooks.init.initContainers): array should have exactly one sub-item
I am getting the same error even if i use velero-plugin-for-aws or velero-plugin-for-csi alone.
and folllowing is helm chart install command:

helm install velero \
    --namespace=velero \
    --create-namespace \
    --set-file credentials.secretContents.cloud=credentials-minio \
    --set configuration.backupStorageLocation[0].name=default \
    --set configuration.backupStorageLocation[0].provider=aws \
    --set configuration.backupStorageLocation[0].bucket=velero \
    --set configuration.backupStorageLocation[0].config.region=minio-default \
    --set configuration.backupStorageLocation[0].config.s3ForcePathStyle=true \
    --set configuration.backupStorageLocation[0].config.s3Url=http://minio:9000 \
    --set snapshotsEnabled=true \
    --set deployNodeAgent=true \
    --set configuration.features=EnableCSI \
    --set configuration.volumeSnapshotLocation[0].name=default \
    --set configuration.volumeSnapshotLocation[0].provider=aws \
    --set configuration.volumeSnapshotLocation[0].config.region=minio-default \
    --set initContainers[0].name=velero-plugin-for-aws \
    --set initContainers[0].image=velero/velero-plugin-for-aws:v1.7.0 \
    --set initContainers[0].volumeMounts[0].mountPath=/target \
    --set initContainers[0].volumeMounts[0].name=plugins \
    --set initContainers[1].name=velero-plugin-for-csi \
    --set initContainers[1].image=velero/velero-plugin-for-csi:v0.5.0 \
    --set initContainers[1].volumeMounts[0].mountPath=/target \
    --set initContainers[1].volumeMounts[0].name=plugins \
    vmware-tanzu/velero

installation of velero helm charts (Chart version: velero-4.0.3 and App version: 1.11.0) with minio(chart version -8.0.10 and app version latest) on docker-desktop k8s latest version works well.

@frost52
Copy link

frost52 commented Jun 12, 2023

The same issues in different env
k8s server: 1.16
k8s client: 1.27

Installed Velero using the following command

velero install --provider aws --plugins velero/velero-plugin-for-aws:v1.6.2,velero/velero-plugin-for-csi:v0.4.3 --bucket velero --prefix prefix-path --cacert ./cacrt --use-volume-snapshots=false --backup-location-config publicUrl=https://minio,region=minio,s3ForcePathStyle="true",s3Url=https://minio --secret-file ./secret --image velero/velero:v1.10.3

then I needed to update the deployment, but "edit deployment" got the same error message described above
fortunately, "patch" command worked

might be a "kubectl" issue

@ywk253100
Copy link
Contributor

Did you upgrade CRD before upgrading velero deployments?

@ywk253100 ywk253100 self-assigned this Jun 19, 2023
@ywk253100 ywk253100 added the Needs info Waiting for information label Jun 19, 2023
@alexvivanov
Copy link

alexvivanov commented Jun 20, 2023

Hello!
I have same problem.
Velero appVersion: v2.6.2
Legacy kub cluster v1.17.9
I have a fresh install for this cluster.

My workaround

  1. kubectl delete customresourcedefinitions.apiextensions.k8s.io restores.velero.io
  2. sync all except restores.velero.io CRD
  3. velero pod not started (CrashLoopBackOff)
    An error occurred: [custom resource Restore not found in Velero API group velero.io/v1, Velero custom resources not found - apply examples/common/00-prereqs.yaml to update the custom resource definitions]
  4. Sync only restores.velero.io CRD
  5. velero pod is going Ready

Next sync will fail again...

@joanyko
Copy link

joanyko commented Jul 4, 2023

I confirm the same problem with k8s v1.21.5 and helm 4.1.0

@printWSL
Copy link

printWSL commented Aug 16, 2023

I have same problem. k8s v1.25.0 and helm 4.4.1

@bmalynovytch
Copy link

bmalynovytch commented Sep 28, 2023

It's a Helm chart issue, not Velero itself.

@zgfh
Copy link

zgfh commented Oct 27, 2023

see: elastic/cloud-on-k8s#4737 (comment)

this work for me:

kubectl patch crd restores.velero.io --type json -p='[{"op": "remove", "path": "/spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/hooks/properties/resources/items/properties/postHooks/items/properties/init/properties/initContainers/x-kubernetes-preserve-unknown-fields"}]'

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. If a Velero team member has requested log or more information, please provide the output of the shared commands.

Copy link

This issue was closed because it has been stalled for 14 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs info Waiting for information staled
Projects
None yet
Development

No branches or pull requests

8 participants