PQM

pqm --run always dies with lock file "pqm.lock" OSError

Bug #493872 reported by Colin D Bennett
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PQM
Incomplete
Undecided
Unassigned

Bug Description

I am trying to set up PQM for the first time. I have Postfix+Procmail set up to pipe mail to the PQM user through ‘pqm --read’. This is working to place ‘patch.NNNNN’ files in the queue directory. However, whenever I try to run ‘pqm --run’, I always get this error at the end after it appears to have read the request file: OSError: [Errno 2] No such file or directory: '/home/bzrservertest/Queue/pqm/pqm.lock'

Here's the full output I get:

-----------------------------------------------------------------------------
bzrservertest@italia:~$ pqm --run -v -d
pqm [-1217083712] INFO: found groups {'MyProject_software_team': []}
pqm [-1217083712] INFO: group MyProject_software_team has members ['<email address hidden>', '<email address hidden>']
pqm [-1217083712] INFO: managing branch(s): file:///bzr/MyProject/
pqm [-1217083712] INFO: creating lockfile
pqm [-1217083712] INFO: trying script /home/bzrservertest/Queue/patch.1260236269
pqm [-1217083712] INFO: recieved email from cdb@italia (Colin D Bennett)
pqm [-1217083712] INFO: sender: cdb@italia (Colin D Bennett)
pqm [-1217083712] INFO: subject: Test 3
pqm [-1217083712] INFO: parsing commands
pqm [-1217083712] INFO: cleaning working directory
Traceback (most recent call last):
  File "/home/bzrservertest/Programs/pqm/bin/pqm", line 245, in <module>
    manager.run(script_queue)
  File "/home/bzrservertest/Programs/pqm/pqm/core.py", line 109, in run
    lockfile.release()
  File "/home/bzrservertest/Programs/pqm/pqm/lockfile.py", line 81, in release
    os.unlink(self.filename)
OSError: [Errno 2] No such file or directory: '/home/bzrservertest/Queue/pqm/pqm.lock'
-----------------------------------------------------------------------------

Let me also validate my understanding of incoming requests through mail. It seems to be a 2-step process:
(1) pqm --read is called by procmail, and it just stores to request directly in the queue directory, doing no real work.
(2) pqm --run must be called (via cron, or perhaps by the procmail trigger after pqm --read? It seems silly to keep polling with cron, which introduces unneeded delays) which actually processes the request.
Is this a correct understanding of how PQM works?

Revision history for this message
Colin D Bennett (colinb) wrote :

I'm attaching the ~/.pqm.conf file I'm trying to use for testing.

There is a bzr shared repository in /bzr/MyProject that is created and has no branches in it yet.

Revision history for this message
Robert Collins (lifeless) wrote :

You should have a cron job. You could also use fetchmail to trigger a run to reduce latency - the locking should make that ok.

The reason to use cron is that you want to ensure that you don't get a dropped merge request (imagine a triggered run that finds the lock held, so does nothing, and the previous run was releasing the lock concurrently)

Anyhow, the lock failure is odd - is something removing the lock under pqm ? The method in question does:
    def run(self, script_queue):
        lockfile = LockFile(
            os.path.join(self.control_dir, 'pqm.lock'), self.logger,
            self.options.no_act, self.options.cron_mode)
        lockfile.acquire()
        try:
            self.do_run_mode(script_queue)
        finally:
            lockfile.release()

Changed in pqm:
status: New → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.