## TL;DR
Exit code 2 from vzdump is its generic task failure, so the real cause is a line earlier in the task log: open the full task output in the Proxmox GUI or the log file, find the first error line, commonly a full backup storage, a VM lock left by a previous job, or a snapshot-mode failure, and fix that named cause. The task log is the diagnostic; the exit code merely says the task failed.

```text
Proxmox backup failed "TASK ERROR: command vzdump backup failed: exit code 2"
```

## Use this when
- The job or restore fails with this symptom: Proxmox backup failed with TASK ERROR: command vzdump backup failed: exit code 2.
- You are working on a Proxmox backup job failing with vzdump exit code 2 and the failure repeats on the same target or schedule.
- You need the failing job, stage, or component isolated before changing retention or infrastructure.

## Not for this skill when
- A failure caused by the backup storage's filesystem rather than the VM, where the task log's first error names the storage.
- The error text names a different product, stage, or root cause. Match the verbatim error first and use that skill.

## Steps
1. Open the complete task log for the failed job from the tasks view or the node's log directory. Verify: the full log is in hand
2. Read upward from the end to the first error or warning line that is not a consequence of a later one. Verify: the originating error line is identified
3. Classify it: storage space, VM lock, snapshot or suspend issue, or an agent timeout inside the guest. Verify: the failure class is named
4. Fix that cause, unlock the VM or free the storage as the case requires, and rerun the job for the one VM. Verify: the single-VM backup completes

## Variant phrasings
### proxmox vzdump backup failed exit code 2 task error
The verbatim phrasing.
### vzdump exit code 2 read task log first error fix
The task-log phrasing.
### proxmox backup job failed exit code 2 vm lock storage
The common-causes phrasing.

Compatibility: Proxmox VE vzdump backups and job logs

## Why it happens
vzdump orchestrates several stages, snapshot, data transfer, and archive finalising, and compresses every stage failure into the same exit code for the scheduler. All of the specific information is in the task log the code points away from, which is why log-first is the whole method here.

## Edge cases / pitfalls
- A VM left locked by a crashed earlier job fails every later job identically; the lock line in the log is easy to scroll past.
- Hook scripts that exit non-zero fail the task after a successful archive; check for hook errors when the archive itself looks complete.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_jatoFNVjcPySn14lzzxMJg
