Proxmox Hosting

TASK ERROR: can't lock file - got timeout - Proxmox VE

When using Proxmox VE, you may try to stop, reset, or shutdown a VM from the console and you will observe that the VM keeps running and not responding to the command. You will observe in the task logs that you receive an "Error: can't lock file...".

The full error may look like this example:

trying to acquire lock...
TASK ERROR: can't lock file '/var/lock/qemu-server/lock-103.conf' - got timeout

Steps to Resolve

Login to your Proxmox VE node either by SSH or from the console.

Run the command:

ps aux | grep "/usr/bin/kvm -id 103"

Replace "103" with the ID of the VM that is unable to obtain a lock. For example, if the VM ID is 1000, replace 103 with 1000.

You will then receive a task list that matches the requested search. Typically you will receive two tasks back. One will be your search and the other will be the KVM process running the VM. The KVM process will have a lot of text. For example:

root     2033767  5.8  1.1 5589504 1529356 ?     Sl   Mar25 346:48 /usr/bin/kvm -id 103 -name example1,debug-threads=on -no-shutdown...[truncated]

Copy the number next to root. In this example, it is 2033767. This is the process ID. Run the following command:

kill -9 2033767

Replace 2033767 with your process ID that you found as it will be a different ID each time the process runs.

When you press enter or return, the KVM task will be forced to end and you should then observe in the Proxmox VE web interface that the VM is now powered off.

Article Information
  • Article ID: 337
  • Category: Proxmox
  • Viewed 720 times.
  • Rating:
    (2)
  • Was this article helpful?
  • Yes No
Did you find this article helpful?