trying to aquire lock...TASK ERROR: can't lock file '/var/lock/qemu-server/...

  • Thread starter Thread starter jtasipit
  • Start date Start date
J

jtasipit

Guest
Please help. I am trying to stop a VM using command line on the node it was hosted. The reason I did it because we have a problem on the Node Web GUI and we badly needed to stop the VM. I used command #qm stop <vmid>. This seems to work but when I start it using command #qm start <vmid>, this is the error message:

"trying to aquire lock...TASK ERROR: can't lock file '/var/lock/qemu-server/lock-109.conf' - got timeout"

Thanks in advance.
 
I'm in the same situation, but before I delete the lock file manually, I want to make sure, that it is safe to do so.
Which process is using these lock files? What do I have to care about, to be on the safe side?

Btw: The lock file is more than a week old and I rebooted the VM several time since then.

Cheers,
luphi
 
Same problem here but let me ask on why the file gets locked? under what circumstances does proxmox lock files and why such locking?
 
Hi,
Same problem here but let me ask on why the file gets locked? under what circumstances does proxmox lock files and why such locking?
see here. You can use lsof /var/lock/qemu-server/lock-<ID>.conf to see if there's still a process accessing the lock file.
 
Thanks - that is what I was looking for as well.

But the output

Code:
task\x20U 1867226 root    6wW  REG   0,27        0 471129 /run/lock/qemu-server/lock-136.conf

is not all that clear to me.

Is there a way to find out what this process does, whether it still is healthy, where it is at?

Background: I wanted to move a VM disk to another storage. A window opened, nothing much happened. I closed the window, thinking I could later open the status of this process to check back on it (like I do with backups, restores, etc.). However, no running task is shown in the tasks pane. So I don't know if this is still going on, or has stalled or...
 
  • Like
Reactions: Rossi
Hi, it's strange that you don't see an active task in the UI. To find out more about the process, you could try ps aux | grep PID (PID being 1867226 in your case).
It may give an output like
Code:
root        ...  Ss   09:58   0:00 task UPID:pve...:root@pam:
from which you can read off the task's UPID and try to find the log file of the task:
Code:
find /var/log/pve/tasks -name UPID:pve...:root@pam:
 
Thank you.

For some other reason, everything is working really slowly (if at all) in my cluster. The task did appear (much later). But your tip is much appreciated anyway. I love learning a new trick!
 
I just hat the same issue.

Reason was: I started bulk migrate from pve-node-a to pve-node-b (ha-enabled 3-node-cluster) and then everything was stuck and I can't unlock the vms.

Seems so the migration process had started, the vm's were started at the other node for the migration, but the process did not continue. So I restarted the OTHER node - with no vms running on so far - and the lock was released automatically.
 
Hi,

This thread is google's first link for "proxmox can't lock file shutdown stop"

And this issue is still happenning very easily

I bang my head on it every time I haven't used proxmox in a couple months, trying to shutdown a VM and it won't so I just pull the server's power cord !

I think it's something about using shutdown not stop, or stop not shutdown
2023-09-19 00_42_51-srv4 - Proxmox Virtual Environment — Mozilla Firefox.png
It's the sort of thing that every proxmox users and devs don't even think about or realize is soooooo frustrating

OK

First double click on that running broken task and hit stop
2023-09-19 00_47_56-srv4 - Proxmox Virtual Environment — Mozilla Firefox.png
Now you can hit stop, NOT shutdown
2023-09-19 00_49_49-srv4 - Proxmox Virtual Environment — Mozilla Firefox.png

And this could be made much easier, by changing proxmox's behaviour

If the user clicks STOP, stop previous still running shutdown tasks (as I've done manually here) and then execute the stop command

The problem is that the STOP command is getting queued behind the shutdown command which will never end.

Voila !
 
Hi,

This thread is google's first link for "proxmox can't lock file shutdown stop"

And this issue is still happenning very easily

I bang my head on it every time I haven't used proxmox in a couple months, trying to shutdown a VM and it won't so I just pull the server's power cord !

I think it's something about using shutdown not stop, or stop not shutdown
View attachment 55561
It's the sort of thing that every proxmox users and devs don't even think about or realize is soooooo frustrating

OK

First double click on that running broken task and hit stop
View attachment 55562
Now you can hit stop, NOT shutdown
View attachment 55563

And this could be made much easier, by changing proxmox's behaviour

If the user clicks STOP, stop previous still running shutdown tasks (as I've done manually here) and then execute the stop command

The problem is that the STOP command is getting queued behind the shutdown command which will never end.

Voila !
Thank you very much. That worked for me.
 
Hi,

This thread is google's first link for "proxmox can't lock file shutdown stop"

And this issue is still happenning very easily

I bang my head on it every time I haven't used proxmox in a couple months, trying to shutdown a VM and it won't so I just pull the server's power cord !

I think it's something about using shutdown not stop, or stop not shutdown
View attachment 55561
It's the sort of thing that every proxmox users and devs don't even think about or realize is soooooo frustrating

OK

First double click on that running broken task and hit stop
View attachment 55562
Now you can hit stop, NOT shutdown
View attachment 55563

And this could be made much easier, by changing proxmox's behaviour

If the user clicks STOP, stop previous still running shutdown tasks (as I've done manually here) and then execute the stop command

The problem is that the STOP command is getting queued behind the shutdown command which will never end.

Voila !

You are the best! Thanks!
 
This one is new. You can check the checkbox "Overrule active shutdown tasks" if you have a shutdown task running. If checked it will kill the running shutdown task.
1719211011635.png
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!