print_bug_page.php?bug_id=743.html Long ago Feb 15, 2017 You uploaded an item HTML print_bug_page.php?bug_id=743.html 0000743: search_size => irange fail on large files - CFEngine Bug Tracker
CFEngine Bug Tracker - CFEngine 3 Community Edition
Viewing Issue Advanced Details
743 Promise type: files medium always 2011-08-19 15:31 2012-01-05 13:00
pupu  
 
normal  
new 3.1.5  
open  
none    
none  
0000743: search_size => irange fail on large files
body file_select select_samhain_log
{
leaf_name => { "samhain_log" };
search_size => irange("50000000","inf");
file_result => "size.leaf_name";
}

This code catches files ~400MB, but fails on file ~1.8GB.

cfengine-community-3.1.5-1.el4
[root@n2rhps53 var]# cat /etc/redhat-release
Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
[root@n2rhps53 var]# uname -a
Linux n2rhps53.apl.mzem.net 2.6.9-89.ELsmp #1 SMP Mon Apr 20 10:34:33 EDT 2009 i686 i686 i386 GNU/Linux
Issue History
2011-08-19 15:31 pupu New Issue
2011-12-08 13:15 mikhail_gusarov Note Added: 0001960
2011-12-08 13:15 mikhail_gusarov Status new => feedback
2011-12-21 11:19 pupu Note Added: 0002002
2011-12-21 11:19 mikhail_gusarov Status feedback => new
2012-01-05 13:00 pupu Note Added: 0002009

Notes
(0001960)
mikhail_gusarov   
2011-12-08 13:15   
Could you please try to reproduce it on 3.2.3 or trunk? There were massive changes in meantime regarding LFS.
(0002002)
pupu   
2011-12-21 11:19   
No luck.

cf3> .........................................................
cf3> Promise handle:
cf3> Promise made by: /var/log2/.*
cf3> .........................................................
cf3>
cf3> -> Using regex pathtype for /var/log2/.* (see pathtype)
cf3> -> Using expanded file base path /var/log2/samhain_log2
cf3> -> Using expanded file base path /var/log2/samhain_log
cf3>
cf3> .........................................................

[root@n2rhpvb9 cfengine]# ls -l /var/log2/
total 2702648
-rw-r--r-- 1 root root 1843200000 Dec 20 14:58 samhain_log
-rw-r--r-- 1 root root 921600000 Dec 20 14:43 samhain_log2

body file_select select_samhain_log
{
leaf_name => { "samhain_log" };
search_size => irange("50000000","inf");
file_result => "size.leaf_name";
}

...

    # remove samhain logs
    "/var/log2/.*"
      file_select => select_samhain_log,
      delete => safe_tidy;

[root@n2rhpvb9 cfengine]# uname -a
Linux n2rhpvb9 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
[root@n2rhpvb9 cfengine]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.1 (Santiago)
[root@n2rhpvb9 cfengine]# cf-agent -V

   @@@
   @@@ cf-agent
            
 @ @@@ @ CFEngine Core 3.2.3
 @ @@@ @
 @ @@@ @
 @ @
   @@@
   @ @
   @ @
   @ @

Copyright (C) CFEngine AS 2008-2011
See Licensing at http://cfengine.com/3rdpartylicenses [^]
(0002009)
pupu   
2012-01-05 13:00   
I've tried to run cf-agent with '-d 3' and found this:

IsCf3VarString(50000000,999999999) - syntax verify
Found 0 variables in (50000000,999999999)
CopyRvalItem(s)
DeleteRvalItem(s)50000000,999999999
   Appending Constraint: search_size => 50000000,999999999
EvaluateFinalRval -- type s
ExpandPrivateRval(scope=this,type=s)

It should be the result of 'search_size => irange("50000000","inf");'. It seems like 'infinity' in 'search_size' means approximately 1GB. Well, that's not that much nowadays ;-)