Impossibile creare un backup a causa dell'errore Repository is already locked

Non è possibile creare un backup con l'utilità OADP perché il repository è bloccato.

Sintomi

Nel file CPD-CLI*.log viene visualizzato il seguente messaggio di errore:

stderr=unable to create lock in backend: repository is already locked

Cause

Il secchio S3 è bloccato da un altro thread.

Risoluzione del problema

Per risolvere il problema, procedere come segue:

  1. Impostare le seguenti variabili di ambiente:
    OADP_OPERATOR_NS=<OADP_operator_project>
    NODE_AGENT_POD=$(oc get pods -l name=node-agent -o jsonpath='{.items[0].metadata.name}' -n ${OADP_OPERATOR_NS})
  2. Collegarsi al contenitore OADP :
    oc rsh -n ${OADP_OPERATOR_NS} ${NODE_AGENT_POD}
  3. Sbloccare il repository:
    restic unlock -r s3:https://<server>:<port>/<bucket>/<prefix>/restic/${PROJECT_CPD_INST_OPERANDS} --insecure-tls --remove-all
  4. Pulire i baccelli Restic:
    oc delete resticrepositories --all -n ${OADP_OPERATOR_NS}
    oc delete pods -l component=velero -n ${OADP_OPERATOR_NS}
    oc delete pods -l  app.kubernetes.io/name=velero -n ${OADP_OPERATOR_NS}
  5. Resettare l'utility OADP :
    cpd-cli oadp reset
  6. Se nei log del pod Velero viene visualizzato l'errore OOMKilled Kubernetes , aumentare la memoria di Restic e Velero nella configurazione DataProtectionApplication (DPA).
    1. Modificare la configurazione del DPA:
      oc edit dpa
    2. Aggiornare il limite di memoria nei seguenti punti:
      • spec.configuration.velero.podConfig.resourceAllocations.limits.memory
      • spec.configuration.nodeAgent.podConfig.resourceAllocations.limits.memory
      Ad esempio:
      spec:
        configuration:
          velero:
            customPlugins:
            - image: ${CPDBR_VELERO_PLUGIN_IMAGE_LOCATION}
              name: cpdbr-velero-plugin
            defaultPlugins:
            - aws
            - openshift
            - csi
            podConfig:
              resourceAllocations:
                limits:
                  cpu: "${VELERO_POD_CPU_LIMIT}"
                  memory: 4Gi
                requests:
                  cpu: 500m
                  memory: 256Mi
            resourceTimeout: 60m
          nodeAgent:
            enable: true
            uploaderType: restic
            timeout: 72h
            podConfig:
              resourceAllocations:
                limits:
                  cpu: "${NODE_AGENT_POD_CPU_LIMIT}"
                  memory: 32Gi
                requests:
                  cpu: 500m
                  memory: 256Mi
              tolerations:
              - key: icp4data
                operator: Exists
                effect: NoSchedule
Suggerimento: Per ulteriori informazioni su questo problema, vedere Sbloccare un repository bloccato usando lo strumento di backup restic.