// Module included in the following assemblies:
//
// * backup_and_restore/application_backup_and_restore/troubleshooting.adoc

:_content-type: REFERENCE
[id="oadp-debugging-oc-cli_{context}"]
= Debugging Velero resources with the OpenShift CLI tool

You can debug a failed backup or restore by checking Velero custom resources (CRs) and the `Velero` pod log with the OpenShift CLI tool.

[discrete]
[id="oc-velero-cr_{context}"]
== Velero CRs

Use the `oc describe` command to retrieve a summary of warnings and errors associated with a `Backup` or `Restore` CR:

[source,terminal]
----
$ oc describe <velero_cr> <cr_name>
----

[discrete]
[id="oc-velero-pod-logs_{context}"]
== Velero pod logs

Use the `oc logs` command to retrieve the `Velero` pod logs:

[source,terminal]
----
$ oc logs pod/<velero>
----

[discrete]
[id="oc-velero-debug-logs_{context}"]
== Velero pod debug logs

Use the `oc edit` command to set the `Velero` pod logs to debug level:

. Edit the `Velero` deployment:
+
[source,terminalsubs="attributes+"]
----
$ oc edit deployment/velero -n {namespace}
----

. Add `--log-level` and `debug` to the `spec.template.spec.containers.velero.args` array:
+
[source,yaml]
----
apiVersion: apps/v1
kind: Deployment
...
spec:
  template:
    spec:
      containers:
      - name: velero
        image: velero/velero:latest
        command:
          - /velero
        args:
          - server
          - --log-level
          - debug
...
----
