Hi, How big a template file can be? When I tested with a kind of large file (about 23KB, 570 lines), puppetmasterd ended up with a segmentation fault. Then I made the file shorter than original (about 6KB, 145 lines), the file was created but it is shorter than it should be. What I have is just 3994 bytes and 80 lines. Replacing the string is done correctly. I would like to know the limit of the size if you have. I am now using 0.22.4 puppetmasterd. Thank you, Yoshi --- Yoshihiro Tsuchiya
On Tue, Nov 06, 2007 at 05:36:09PM +0900, Tsuchiya Yoshihiro wrote:> How big a template file can be? > > When I tested with a kind of large file (about 23KB, 570 lines), > puppetmasterd ended up with a segmentation fault.That''s just Ruby crapping itself[1].> Then I made the file shorter than original (about 6KB, 145 lines), > the file was created but it is shorter than it should be. > What I have is just 3994 bytes and 80 lines.There should be no limit to the size of a template file. I''m pretty sure I''ve got some pretty big templates floating around. It is a bug in something if your templates are getting truncated.> I am now using 0.22.4 puppetmasterd.?$B!!Try upgrading. There have been bugfixes in templating, and I think they were in 0.23.something. - Matt [1] See http://reductivelabs.com/trac/puppet/wiki/FrequentlyAskedQuestions#what-s-with-these-damned-segfaults
Matt Palmer wrote:> On Tue, Nov 06, 2007 at 05:36:09PM +0900, Tsuchiya Yoshihiro wrote: > >> How big a template file can be? >> >> When I tested with a kind of large file (about 23KB, 570 lines), >> puppetmasterd ended up with a segmentation fault. >> > > That''s just Ruby crapping itself[1]. > > >> Then I made the file shorter than original (about 6KB, 145 lines), >> the file was created but it is shorter than it should be. >> What I have is just 3994 bytes and 80 lines. >> > > There should be no limit to the size of a template file. I''m pretty sure > I''ve got some pretty big templates floating around. It is a bug in > something if your templates are getting truncated. > > >> I am now using 0.22.4 puppetmasterd.?$B!! >> > > Try upgrading. There have been bugfixes in templating, and I think they > were in 0.23.something. > > - Matt > >Now I have 0.23.2 rpm for my RedHat enterprise 4U4 and I see almost the same behavior. For a large file, puppetmasterd aborts, saying: ------ /usr/lib/ruby/1.8/yaml/rubytypes.rb:315: [BUG] Segmentation fault ruby 1.8.1 (2003-12-25) [i386-linux-gnu] Aborted ----- This is a kind of new to me, because 0.22.4 just said "Segmentation fault", and not about rubytypes.rb. For relatively short templates, I have truncated files. I haven''t tried with upgrading of ruby. Yoshi
On Wed, Nov 07, 2007 at 03:40:11PM +0900, Tsuchiya Yoshihiro wrote:> Matt Palmer wrote: > > On Tue, Nov 06, 2007 at 05:36:09PM +0900, Tsuchiya Yoshihiro wrote: > > > >> How big a template file can be? > >> > >> When I tested with a kind of large file (about 23KB, 570 lines), > >> puppetmasterd ended up with a segmentation fault. > > > > That''s just Ruby crapping itself[1]. > > > >> Then I made the file shorter than original (about 6KB, 145 lines), > >> the file was created but it is shorter than it should be. > >> What I have is just 3994 bytes and 80 lines. > > > > There should be no limit to the size of a template file. I''m pretty sure > > I''ve got some pretty big templates floating around. It is a bug in > > something if your templates are getting truncated. > > > >> I am now using 0.22.4 puppetmasterd.?$B!! > > > > Try upgrading. There have been bugfixes in templating, and I think they > > were in 0.23.something. > > > > - Matt > > > > > > Now I have 0.23.2 rpm for my RedHat enterprise 4U4 and I see almost the > same behavior. > > For a large file, puppetmasterd aborts, saying: > ------ > /usr/lib/ruby/1.8/yaml/rubytypes.rb:315: [BUG] Segmentation fault > ruby 1.8.1 (2003-12-25) [i386-linux-gnu] > > Aborted > ----- > This is a kind of new to me, because > 0.22.4 just said "Segmentation fault", and not about rubytypes.rb.As I said before, and as explained in the page I linked to in my footnote (which you snipped), Ruby segfaults aren''t specifically a Puppet thing -- they''re a Ruby bug.> For relatively short templates, I have truncated files.That''s a Puppet bug, though, and should be reported with a minimal manifest and template that exhibits the bug, so that we can reproduce and fix the bug.> I haven''t tried with upgrading of ruby.That might fix the segfaults, but I doubt it''ll fix the template truncation (unless the bug is actually in ERb -- in which case, we''ll want to know about it to warn other people). - Matt -- MySQL seems to be the Windows of the database world. Broken, underspecced, and mainly only popular due to inertia and people who don''t really know what they''re doing. -- Peter Corlett, in the Monastery
Matt Palmer wrote:>> For relatively short templates, I have truncated files. >> > > That''s a Puppet bug, though, and should be reported with a minimal manifest > and template that exhibits the bug, so that we can reproduce and fix the > bug. > >OK. I cannot show you the actual template, so I tell you what I do to reproduce the problem. I copied /etc/webalizer.conf to foo.conf in my template directory and changed one to make a template file. /etc/webalizer.conf is a kind of large file that belongs to webalizer package. It is not related with my actual template, but I chose it because it''s big enogh. # diff -u /etc/webalizer.conf templates/foo.conf --- /etc/webalizer.conf 2004-08-19 06:44:54.000000000 +0900 +++ templates/foo.conf 2007-11-06 16:39:00.000000000 +0900 @@ -73,7 +73,8 @@ # kept in the normal output directory. If you don''t specify "Incremental" # as ''yes'' then this option has no meaning. -IncrementalName /var/lib/webalizer/webalizer.current +#IncrementalName /var/lib/webalizer/webalizer.current +IncrementalName <%= filename %> # ReportTitle is the text to display as the title. The hostname # (unless blank) is appended to the end of this string (seperated with This is my template definition. # cat classes/foo.pp define foo_conf ($filename) { file { "/tmp/foo.conf": owner => root, group => root, mode => 644, content => template("/etc/puppet/manifests/templates/foo.conf") } } Then in my site.pp, I put these lines. rep1nb1 is the name of my machine. import "classes/*" foo_conf { rep1nb1: filename => "foobar", } When I see the segmentation fault, I truncate the file to at around the line 120. Then I get much shorter result by templating. Please tell me if my code above is not correct. Thank you, Yoshi>> I haven''t tried with upgrading of ruby. >> > > That might fix the segfaults, but I doubt it''ll fix the template truncation > (unless the bug is actually in ERb -- in which case, we''ll want to know > about it to warn other people). > > - Matt > >
On Wed, Nov 07, 2007 at 05:35:41PM +0900, Tsuchiya Yoshihiro wrote:> Matt Palmer wrote: > >> For relatively short templates, I have truncated files. > >> > > > > That''s a Puppet bug, though, and should be reported with a minimal manifest > > and template that exhibits the bug, so that we can reproduce and fix the > > bug. > > OK. > I cannot show you the actual template, so I tell you what I do to > reproduce the problem.That''s not how it works. You need to produce a site.pp and a template file that, when run together on your system, produce a truncated template. It doesn''t necessarily need to be the exact same template that you use in production (it can be lots of Xs and Ys for all I care) but you need to have run the *exact* template and site.pp file on your system and verified that it produces the bug. When you have that, then you go to http://reductivelabs.com/trac/puppet/simpleticket and submit a bug report. Anything else is just pointless, because if someone else can''t reproduce the problem they can''t know if it''s because the bug only affects you, or if they''re not following your instructions right. - Matt -- "A cat spends her life conflicted between a deep, passionate and profound desire for fish and an equally deep, passionate and profound desire to avoid getting wet. This is the defining metaphor of my life right now." -- Unknown, Seen on the ''net
Matt Palmer wrote:> > That''s not how it works. You need to produce a site.pp and a template file > that, when run together on your system, produce a truncated template. It > doesn''t necessarily need to be the exact same template that you use in > production (it can be lots of Xs and Ys for all I care) but you need to have > run the *exact* template and site.pp file on your system and verified that > it produces the bug. > > When you have that, then you go to > http://reductivelabs.com/trac/puppet/simpleticket and submit a bug report. >I made a sample and submit the problem there. Thank you. The number is #889. Yoshi> Anything else is just pointless, because if someone else can''t reproduce the > problem they can''t know if it''s because the bug only affects you, or if > they''re not following your instructions right. > > - Matt > >
Reasonably Related Threads
- How to store a Mechanize object in the database?
- Dovecot auth works when tested with doveadm, but fails with Postfix
- Is there a limit on the size of a template?
- [PATCH V2 0/2] [BUGFIX] virtio/console: Fix two bugs of splice_write
- [PATCH V2 0/2] [BUGFIX] virtio/console: Fix two bugs of splice_write