Bug #2888

puppetd doesn't always cleanup lockfile properly

Added by Peter Meier about 2 years ago. Updated 3 months ago.

Status:Accepted Start date:12/04/2009
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:plumbing
Target version:-
Affected Puppet version:0.25.1 Branch:
Keywords:
Votes: 4

Description

ok I had the patch #2661 now running for some weeks and I had nearly no problems anymore. However from time to time (maybe once,twice a week) a random client doesn’t remove its lockfile (@/var/lib/puppet/state/puppetdlock@), hence future runs fail. I assume this might still happen due to a uncatched exception (as in #2261), however the problem is a) hard or nearly impossible to reproduce and b) it occurs really by random. The only thing I can see in the logs:

Nov 30 19:27:41 foobar puppetd[26228]: Finished catalog run in 98.79 seconds
Nov 30 20:00:02 foobar puppetd[3000]: Could not retrieve catalog from remote server: Error 502 on SERVER: ^M 502 Bad Gateway^M ^M 

502 Bad Gateway

^M
nginx/0.6.39
^M ^M ^M Nov 30 20:00:03 foobar puppetd[3000]: Using cached catalog Nov 30 20:00:03 foobar puppetd[3000]: Could not retrieve catalog; skipping run Nov 30 20:00:04 foobar puppetd[12169]: Run of Puppet configuration client already in progress; skipping Nov 30 20:30:04 foobar puppetd[21230]: Run of Puppet configuration client already in progress; skipping

as I run puppetd by cron twice an hour with —splay I assume that the run between 19:30 and 20:00 got delayed till 20:00. At this time (20:00) a puppetmaster restart happens and due to that the 502 occured. This was the run of pid 3000, the next run (pid 12169) failed, this could either be as pid 3000 was still running or because there was already no puppetd anymore running and the lock file haven’t been removed. However every future run failed as well as the lockfile wasn’t removed.

So somehow puppet doesn’t remove lockfiles properly under certain conditions.

PS: If you think it’s better to reopen the old bugreport, close this one and duplicate and re-open #2261


Related issues

related to Puppet - Bug #5139: puppetdlock file can be empty Accepted 10/28/2010
related to Puppet - Bug #10418: Puppet agent hangs when listen is true and reading from /... Closed 11/01/2011

History

Updated by James Turnbull about 2 years ago

  • Category set to executables
  • Status changed from Unreviewed to Investigating
  • Assignee set to Markus Roberts

Updated by Markus Roberts about 2 years ago

  • Assignee changed from Markus Roberts to Jesse Wolfe
  • Target version set to 0.25.3

This may be related to the test isolation ticket.

Updated by Markus Roberts about 2 years ago

  • Target version changed from 0.25.3 to 0.25.4

Updated by James Turnbull about 2 years ago

  • Target version changed from 0.25.4 to 0.25.5

Updated by James Turnbull almost 2 years ago

  • Target version changed from 0.25.5 to 49

Updated by eric sorenson over 1 year ago

I see this a fair bit, but my hosts crash more than most I think.

Ideally both the $statedir/puppetdlock and $rundir/puppetd.pid test-and-exit conditions would add a sanity check to see if there actually are any other puppetd pids running, and, if not, conclude they died unnatural deaths and ought to be overriden by the current instance.

Updated by Jesse Wolfe over 1 year ago

  • Category changed from executables to plumbing
  • Status changed from Investigating to Accepted
  • Assignee deleted (Jesse Wolfe)
  • Target version changed from 49 to 52

Updated by James Turnbull 11 months ago

  • Target version deleted (52)

Also available in: Atom PDF