Bug 20077 - Patroncards are printed blank
Summary: Patroncards are printed blank
Status: RESOLVED WORKSFORME
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: 17.11
Hardware: All Linux
: P5 - low normal with 10 votes (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-23 17:53 UTC by martin.stastny
Modified: 2023-10-01 20:18 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description martin.stastny 2018-01-23 17:53:10 UTC
Hello,

we're experiencing problems with printing patroncards from Koha. The final result depends on used browser, for instance in opera I'm able to download blank pdf, however, in firefox I end up with "Not found. The document has moved here." error(under "here" link is nothing->nothing happens). 

We use self-build Koha with several changes from upstream, but we haven't edited this fuction.

The logged errors are as following:

manage.pl: CGI::param called in list context from package Template::Document line 57, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 436.

create-pdf.pl: Use of uninitialized value in substitution iterator at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 233.

create-pdf.pl: Use of uninitialized value $string_width in addition (+) at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 256.

Thanks for helping
Martin
Comment 1 Jonathan Druart 2018-02-05 16:23:14 UTC
(In reply to martin.stastny from comment #0)
> Hello,

Hi Martin,

> we're experiencing problems with printing patroncards from Koha. The final
> result depends on used browser, for instance in opera I'm able to download
> blank pdf, however, in firefox I end up with "Not found. The document has
> moved here." error(under "here" link is nothing->nothing happens). 

What is the url of the link?

> We use self-build Koha with several changes from upstream, but we haven't
> edited this fuction.

Which version of Koha do you use?
What version of Firefox?

> The logged errors are as following:

At first glance they are not related.
Comment 2 martin.stastny 2018-02-06 16:23:59 UTC
(In reply to Jonathan Druart from comment #1)
> (In reply to martin.stastny from comment #0)
> > Hello,
> 
> Hi Martin,
> 
> > we're experiencing problems with printing patroncards from Koha. The final
> > result depends on used browser, for instance in opera I'm able to download
> > blank pdf, however, in firefox I end up with "Not found. The document has
> > moved here." error(under "here" link is nothing->nothing happens). 
> 
> What is the url of the link?
/cgi-bin/koha/patroncards/create-pdf.pl?batch_id=1&template_id=1&layout_id=&layout_back_id=&start_card=1
> > We use self-build Koha with several changes from upstream, but we haven't
> > edited this fuction.
> 
> Which version of Koha do you use?
17.11.00.000
> What version of Firefox?
58.0.1 (64-bit) UBUNTU 17.10
also tested in a kind of 57.X Windows 10 64bit version
> 
> > The logged errors are as following:
> 
> At first glance they are not related.
Comment 3 Sven H. 2018-03-30 22:32:17 UTC


I have a similar problem.

When I try to print the patron cards, the /usr/share/koha/intranet/cgi-bin/patroncards/create-pdf.pl does not finish and runs with 100% CPU load.

In plack-error.log I find the following lines:
Use of uninitialized value $batch_id in concatenation (.) or string at /usr/share/koha/intranet/cgi-bin/patroncards/create-pdf.pl line 68.
Use of uninitialized value in multiplication (*) at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 239.
Use of uninitialized value in addition (+) at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 256.
Use of uninitialized value in multiplication (*) at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 288.
Use of uninitialized value in multiplication (*) at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 239.
Use of uninitialized value in addition (+) at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 256.
Use of uninitialized value in multiplication (*) at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 288.
Use of uninitialized value in multiplication (*) at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 239.
Use of uninitialized value in addition (+) at /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 256.

The problem first appeared in February 2018 after I started the Ubuntu updates. Unfortunately I don't remember what has been updated.

Current system environment (no changes made to koha!):
OS: Ubuntu 17.10
Koha-Version: 
17.11.04.000
OS Version ('uname -a'): 
Linux koha 4.13.0-37-generic #42-Ubuntu SMP Wed Mar 7 14:13:23 UTC 2018 x86_64
Perl Interpreter: 
/usr/bin/perl
Perl-Version: 
5.026000
Perl @INC: 
/usr/share/koha/lib 
/usr/share/koha/installer 
/usr/share/koha/lib/installer 
/etc/perl 
/usr/local/lib/x86_64-linux-gnu/perl/5.26.0 
/usr/local/share/perl/5.26.0 
/usr/lib/x86_64-linux-gnu/perl5/5.26 
/usr/share/perl5 
/usr/lib/x86_64-linux-gnu/perl/5.26 
/usr/share/perl/5.26 
/usr/local/lib/site_perl 
/usr/lib/x86_64-linux-gnu/perl-base 
MySQL-Version: 
mysql Ver 15.1 Distrib 10.1.30-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2 
Apache-Version: 
Server version: Apache/2.4.27 (Ubuntu) 


Unfortunately I am not able to print patron cards at the moment. It would be great if there was a solution for this soon.
Comment 4 Katrin Fischer 2018-03-31 06:01:50 UTC
Hi Sven, might be good to bring this up on the mailing list to help find a solution. Not so many people reading the bug updates, but lots on the mailing list.
Comment 5 Sven H. 2018-03-31 09:14:23 UTC
Hi Katrin,

thanks for your fast reply.

Where can i find the mailing list?

Thanks!
Comment 6 Katrin Fischer 2018-03-31 09:19:26 UTC
https://koha-community.org/support/koha-mailing-lists/ - Koha is the general one, koha-devel is more technical and might work better for this.
Comment 7 Chris Nighswonger 2018-04-02 14:38:29 UTC
(In reply to Sven H. from comment #3)
> 
> 
> I have a similar problem.
> 
> When I try to print the patron cards, the
> /usr/share/koha/intranet/cgi-bin/patroncards/create-pdf.pl does not finish
> and runs with 100% CPU load.
> 
> In plack-error.log I find the following lines:
> Use of uninitialized value $batch_id in concatenation (.) or string at
> /usr/share/koha/intranet/cgi-bin/patroncards/create-pdf.pl line 68.
> Use of uninitialized value in multiplication (*) at
> /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 239.
> Use of uninitialized value in addition (+) at
> /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 256.
> Use of uninitialized value in multiplication (*) at
> /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 288.
> Use of uninitialized value in multiplication (*) at
> /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 239.
> Use of uninitialized value in addition (+) at
> /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 256.
> Use of uninitialized value in multiplication (*) at
> /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 288.
> Use of uninitialized value in multiplication (*) at
> /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 239.
> Use of uninitialized value in addition (+) at
> /usr/share/koha/lib/C4/Patroncards/Patroncard.pm line 256.
> 
> The problem first appeared in February 2018 after I started the Ubuntu
> updates. Unfortunately I don't remember what has been updated.
> 

snip

> 
> Unfortunately I am not able to print patron cards at the moment. It would be
> great if there was a solution for this soon.

I'm not sure what is going on in this particular instance, but taking the same steps on my production system results in a PDF containing the expected cards and nearly zero CPU usage.

Unless someone else can confirm the problem, I would look at something local. Perhaps a Koha update did not apply well or some such, resulting in a script not being updated.

Also, this appears to be a different problem than the one the OP reported. It would be good to open a new bug for it.
Comment 8 Pikri Mohammad 2018-05-18 03:27:40 UTC
Hello all,

I'm having the same problem too. After clicking on the PDF link in patron card, it never finish. On the server side, the CPU usage increased to 100% for /usr/share/koha/intranet/cgi-bin/patroncards/create-pdf.pl

Koha version: 17.11.05.000
O/S: Ubuntu 16.04 x64 bit

Thanks,
Pikri Mohammad
Comment 9 Chris Nighswonger 2018-05-18 13:18:15 UTC
This bug addresses concerns about blank patron cards. Please open another bug to address concerns about 100% CPU usage when printing patron cards. Be sure to include exact steps to reproduce the issue as well as any relevant log entries, etc.
Comment 10 Martin Renvoize 2020-07-22 07:55:25 UTC
Is this still an issue for your Martin?

I'm going to downgrade the priority of this one as it appears to not affect many people and we are struggling to replicate it.. it looks like local issues from the discussions.
Comment 11 Katrin Fischer 2023-10-01 20:18:58 UTC
This has been reported against a now very old version of Koha and we haven't been able to reproduce the issue. Closing, but please re-open if you still experience this issue.