Print invoice as PDF: many notices and warnings in Apache error.log

Apologies if this is a duplicate somehow - I posted 10 minutes ago but cannot see the topic created.

Environment: Version 7.11.8 self hosted on Raspian Buster - PHP7.3 - MariaDB 10

To reproduce: Open an invoice and select action “Print as PDF”
Outcome:

  1. The invoice saves correctly and can be opened with a PDF viewer
  2. Many (many) messages appear in the Apache error.log - No errors in suitecrm.log

There are a variety of messages thrown - sample of each variant here:
[Mon Oct 07 17:11:42.353069 2019] [php7:notice] [pid 3937] [client 212.56.108.61:1089] PHP Notice: Undefined index: aos_products_quotes_vat_amt in /mnt/external/www/html/simplyguitar/modules/AOS_PDF_Templates/templateParser.php on line 162
[Mon Oct 07 17:11:42.353871 2019] [php7:notice] [pid 3937] [client 212.56.108.61:1089] PHP Notice: Undefined index: aos_products_quotes_vat in /mnt/external/www/html/simplyguitar/modules/AOS_PDF_Templates/templateParser.php on line 162, referer: https://www.mikebakke.com:8445/simplyguitar/index.php?action=ajaxui

Many similar lines for various fields

then 1 of:
[Mon Oct 07 17:11:42.368232 2019] [php7:warn] [pid 3937] [client 212.56.108.61:1089] PHP Warning: copy(upload//1dc13455-3fe3-e05c-93f2-587b36a0a81e_photo): failed to open stream: No such file or directory in /mnt/external/www/html/simplyguitar/modules/AOS_PDF_Templates/templateParser.php on line 108

then many:
[Mon Oct 07 17:11:42.371200 2019] [php7:notice] [pid 3937] [client 212.56.108.61:1089] PHP Notice: Undefined index: modified_by_name_user_name in /mnt/external/www/html/simplyguitar/modules/AOS_PDF_Templates/templateParser.php on line 162

then another:
[Mon Oct 07 17:11:42.383892 2019] [php7:warn] [pid 3937] [client 212.56.108.61:1089] PHP Warning: copy(upload//1dc13455-3fe3-e05c-93f2-587b36a0a81e_photo): failed to open stream: No such file or directory in /mnt/external/www/html/simplyguitar/modules/AOS_PDF_Templates/templateParser.php on line 108

then for many fields:
[Mon Oct 07 17:11:42.397741 2019] [php7:notice] [pid 3937] [client 212.56.108.61:1089] PHP Notice: Undefined index: assigned_user_id_user_name in /mnt/external/www/html/simplyguitar/modules/AOS_PDF_Templates/templateParser.php on line 162

then :
[Mon Oct 07 17:11:42.405263 2019] [php7:warn] [pid 3937] [client 212.56.108.61:1089] PHP Warning: copy(upload//1dc13455-3fe3-e05c-93f2-587b36a0a81e_photo): failed to open stream: No such file or directory in /mnt/external/www/html/simplyguitar/modules/AOS_PDF_Templates/templateParser.php on line 108

then many fields like:
[Mon Oct 07 17:11:42.405968 2019] [php7:notice] [pid 3937] [client 212.56.108.61:1089] PHP Notice: Undefined index: assigned_user_name_user_name in /mnt/external/www/html/simplyguitar/modules/AOS_PDF_Templates/templateParser.php on line 162

and then
[Mon Oct 07 17:11:42.443333 2019] [php7:notice] [pid 3937] [client 212.56.108.61:1089] PHP Notice: Undefined property: User::$system_generated_password in /mnt/external/www/html/simplyguitar/modules/AOS_PDF_Templates/te
mplateParser.php on line 96
[Mon Oct 07 17:11:42.444106 2019] [php7:notice] [pid 3937] [client 212.56.108.61:1089] PHP Notice: Undefined property: User::$UserType in /mnt/external/www/html/simplyguitar/modules/AOS_PDF_Templates/templateParser.php
on line 81
[Mon Oct 07 17:11:42.444253 2019] [php7:notice] [pid 3937] [client 212.56.108.61:1089] PHP Notice: Undefined property: User::$calls in /mnt/external/www/html/simplyguitar/modules/AOS_PDF_Templates/templateParser.php on
line 124

Then a change in content but the cyclical pattern continues:
[Mon Oct 07 17:11:44.172372 2019] [php7:notice] [pid 3937] [client 212.56.108.61:1089] PHP Notice: A non well formed numeric value encountered in /mnt/external/www/html/simplyguitar/modules/AOS_PDF_Templates/PDF_Lib/mpd
f.php on line 37072
[Mon Oct 07 17:11:44.172714 2019] [php7:warn] [pid 3937] [client 212.56.108.61:1089] PHP Warning: A non-numeric value encountered in /mnt/external/www/html/simplyguitar/modules/AOS_PDF_Templates/PDF_Lib/mpdf.php on line
37153
[Mon Oct 07 17:11:44.173197 2019] [php7:notice] [pid 3937] [client 212.56.108.61:1089] PHP Notice: Undefined index: outline-s in /mnt/external/www/html/simplyguitar/modules/AOS_PDF_Templates/PDF_Lib/mpdf.php on line 445
4
[Mon Oct 07 17:11:44.174993 2019] [php7:notice] [pid 3937] [client 212.56.108.61:1089] PHP Notice: Undefined index: TBODY>>ID>> in /mnt/external/www/html/simplyguitar/modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php on line 1166

Many, many more of each of these types and then finally:
[Mon Oct 07 17:11:44.459001 2019] [php7:warn] [pid 3937] [client 212.56.108.61:1089] PHP Warning: opendir(/mnt/external/www/html/simplyguitar/modules/AOS_PDF_Templates/PDF_Lib/tmp): failed to open dir: No such file or directory in /mnt/external/www/html/simplyguitar/modules/AOS_PDF_Templates/PDF_Lib/mpdf.php on line 8516

These are just a few of each type. There are probably approaching 200 lines each time a print is done. To be clear - the invoice is output as expected but this must indicate an issue in the system.

Please advise possible steps to diagnose.

Many thanks

OK. After messing about with the PDF template in use and it making zero difference, this morning I did a clean install of 7.11.8, created a product group and PDF template then proceeded to create and print an invoice.

Absolutely no difference so what I now have to assume is that every time an invoice is created as a PDF I can expect 200+ error lines hitting my error logs.

Can someone please confirm if this is “expected” behaviour?

Expected or not, I’d appreciate any suggestions about strategy forwards as this is making it very hard to trap actual Apache errors

Thanks

Mike

These are mostly Notices and warnings regarding BEST PRACTISES of PHP Coding. Most of them you can ignore and the only thing that you should worry about is FATAL errors :slight_smile: They are helpful in development environments to help debug any issues while on Production Machine its recommended to turn off the Errors.

1 Like

Many thanks for the reply. I will close the issue I opened this morning…

I’m guessing/assuming (dangerous I know) that this is configured at PHP level as I see nothing for this in Suite configs (other than Debug which is set to 0)?

Luckily I have the test system so will hack and slash php.ini there to see what happens first.

Mike

@mikebakke don’t close the issue on GitHub, I guess a little cleaning up won’t hurt.

For reference: https://github.com/salesagility/SuiteCRM/issues/8024

Sorry - too late, already did as I assumed devs had a lot of “real” issues. I can re-open if you still think it is ok?