The Puppet Labs Issue Tracker has Moved:

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using See the following page for information on filing tickets with JIRA:

Bug #15026

Puppet has problems deleting large files

Added by Alex Jurkiewicz almost 4 years ago. Updated over 3 years ago.

Status:RejectedStart date:06/13/2012
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Affected Puppet version:2.7.1 Branch:

We've Moved!

Ticket tracking is now hosted in JIRA:


I have this snippet in our Puppet code:

    file { '/var/lib/mlocate/mlocate.db': ensure  => absent }

When mlocate.db is very large, Puppet uses a lot of memory deleting the file, and if the file is too large it crashes.

Test system:
    # free -mt               
    total       used       free     shared    buffers     cached
    Mem:          3961        739       3221          0          6         45
    -/+ buffers/cache:        687       3274
    Swap:         1906          0       1906
    Total:        5868        739       5128

Results (dd if=/dev/zero bs=1024K > mlocate.db)
100mb: works fine
3000mb: hits vsz 3150 rsz 3000mb, successfully deletes the file but all exec & service definitions fail with "Cannot allocate memory - fork(2)"
9000mb: unknown memory usage (didn't check), fails to delete the file with error "err: /Stage[main]/Soe/File[/var/lib/mlocate/mlocate.db]: Could not evaluate: Puppet::Util::Log requires a message". 

All other Puppet code works fine.

Then I added backup => false to the file definition and all the problems went away! It could delete 9gb file just fine.


#1 Updated by James Turnbull over 3 years ago

  • Description updated (diff)

#2 Updated by James Turnbull over 3 years ago

  • Status changed from Unreviewed to Rejected

The issue here is file-bucketing I suspect. Puppet is trying to backup the file before deleting it. I’m rejecting the ticket as the work-around specified is acceptable.

Also available in: Atom PDF