[Bug 21092] New: Bad template in patron card creator can cause server issues
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21092 Bug ID: 21092 Summary: Bad template in patron card creator can cause server issues Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Label/patron card printing Assignee: cnighswonger@foundations.edu Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org While creating the PDF file for a patron card batch the CPU goes to 100% and brings the server down. We have seen this behaviour in 2 separate package installations running 17.11.07 so far. We have sadly not been able to make it happen in a dev environment. Filing the report in hope that someone has an idea or seen something similar that will help us to nail down the problem. So far we think the problem is related to 0 values in a patron card template. I will attach screenshots of the layout and patron card template used, when the problem appears. To test: - Add patron card template - Add patron card layout (or use existing) - Create batch of patrons - Export - Click on PDF link - Boom! There is no error, the system just keeps loading. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21092 --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 77137 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77137&action=edit Patron card layout -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21092 --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 77138 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77138&action=edit Patron card template We are aware that the values make no sense - it's what you get when you save without changing anything on the form. The form doesn't require any fields, so that could happen by accident. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21092 --- Comment #3 from Chris Nighswonger <cnighswonger@foundations.edu> --- (In reply to Katrin Fischer from comment #1)
Created attachment 77137 [details] Patron card layout
It would be helpful to have the output of the following SELECT: SELECT * FROM creator_layouts WHERE layout_id = <your id>\G -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21092 --- Comment #4 from Chris Nighswonger <cnighswonger@foundations.edu> --- (In reply to Katrin Fischer from comment #2)
Created attachment 77138 [details] Patron card template
We are aware that the values make no sense - it's what you get when you save without changing anything on the form. The form doesn't require any fields, so that could happen by accident.
Likewise, the out put of: SELECT * FROM creator_templates WHERE template_id = <your id>\G -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21092 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Chris, was not sure how to report best, so I have created INSERTS of the data with workbench: INSERT INTO `creator_layouts` (`layout_id`,`barcode_type`,`start_label`,`printing_type`,`layout_name`,`guidebox`,`oblique_title`,`font`,`font_size`,`units`,`callnum_split`,`text_justify`,`format_string`,`layout_xml`,`creator`) VALUES (20,'CODE39',1,'BAR','Testlayout',0,1,'TR',10,'POINT',0,'L','barcode','<opt page_side=\"F\" units=\"POINT\">\n <images name=\"image_1\" Dx=\"72\" Ox=\"0\" Oy=\"0\" Sx=\"0\" Sy=\"0\" Tx=\"4.5\" Ty=\"63\">\n <data_source image_name=\"none\" image_source=\"patronimages\" />\n </images>\n <text><firstname> <surname></text>\n <text enable=\"1\" font=\"TR\" font_size=\"10\" llx=\"100\" lly=\"100\" text_alignment=\"L\" />\n <text>Bibliothek: <branchcode></text>\n <text enable=\"1\" font=\"TR\" font_size=\"10\" llx=\"100\" lly=\"75\" text_alignment=\"L\" />\n <text>Ablaufdatum: 31.06.2014</text>\n <text font=\"TR\" font_size=\"6\" llx=\"115\" lly=\"65\" text_alignment=\"L\" />\n</opt>\n','Patroncards'); INSERT INTO `creator_templates` (`template_id`,`profile_id`,`template_code`,`template_desc`,`page_width`,`page_height`,`label_width`,`label_height`,`top_text_margin`,`left_text_margin`,`top_margin`,`left_margin`,`cols`,`rows`,`col_gap`,`row_gap`,`units`,`creator`) VALUES (24,0,'Testtemplate1','Default description',0,0,0,0,0,0,0,0,0,0,0,0,'POINT','Patroncards'); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21092 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- patronimages are activated. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21092 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |christian.stelzenmueller@bs | |z-bw.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21092 --- Comment #7 from Chris Nighswonger <cnighswonger@foundations.edu> --- The INSERTS are great, and they represent the quickest way to duplicate a setup for testing. I'll work on this over the next few weeks unless someone gets to it before me. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21092 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Thx! We haven't been able yet to narrow it down more, but it's a little scary. So would be nice to figure out what happens there. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21092 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wizzyrea@gmail.com --- Comment #9 from Liz Rea <wizzyrea@gmail.com> --- This may be related to the line wrapping code? i.e. we get into a templated situation where we get into the while(1) loop and never get out. More recently lately we've seen the following in our logs when these fail (also this generates gigs and gigs of logs! It's terrible!) [2022/08/08 11:28:39] [WARN] Use of uninitialized value $1 in quotemeta at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 269. [2022/08/08 11:28:39] [WARN] Use of uninitialized value $1 in quotemeta at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 269. [2022/08/08 11:28:39] [WARN] Use of uninitialized value $1 in concatenation (.) or string at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 267. [2022/08/08 11:28:39] [WARN] Use of uninitialized value $1 in concatenation (.) or string at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 267. Hope this helps some, Liz -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21092 Chris Nighswonger <cnighswonger@foundations.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31259 --- Comment #10 from Chris Nighswonger <cnighswonger@foundations.edu> --- (In reply to Liz Rea from comment #9)
This may be related to the line wrapping code? i.e. we get into a templated situation where we get into the while(1) loop and never get out. More recently lately we've seen the following in our logs when these fail (also this generates gigs and gigs of logs! It's terrible!)
See my comment here: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31259#c6 The root problem may be the same. An immediate solution would be to add a conditioned break to the loop that trips when the loop count exceeds the total length of the line being wrapped. That at least should prevent infinite looping. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21092 Chris Nighswonger <cnighswonger@foundations.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org