Events Made Easy › Forums › Generic › Pdf Attachment has 0 bytes
- This topic has 15 replies, 2 voices, and was last updated 2 years, 9 months ago by Franky.
-
AuthorPosts
-
Tue 1 Feb 2022 at 11:42 #63783AnonymousInactive
Dear Franky,
I have the urgent problem that attachments that are sent to participants (as pdf invoice) contain 0 bytes. This happens to part of the attachments, not all of them. I cannot make out any pattern like special characters in names or size of strings etc. Pff generation is set be triggered at all events (booking, confirmation etc).
The document contains html-code, sourcing an image, nothing special I can identify as potential source of error.Any help is appreciated!
Tue 1 Feb 2022 at 12:48 #63786FrankyKeymasterMaybe the webserver has issues generating the pdf due to memory issues. Can you check your php error logs here?
Tue 1 Feb 2022 at 14:38 #63789AnonymousInactiveIf I enable debugging by changing define(‘WP_DEBUG’, true); in wp-config.php, I get an unspecific error in WordPress so I cant access the error logs unfortunately. The image that is sourced has 76,2Â kB, could it be that memory issues are unlikely then?
Tue 1 Feb 2022 at 15:21 #63790FrankyKeymasterWP_DEBUG is not needed here, I talk about php errors in the standard logfiles (apache/nginx/php-fpm). You should have access to these (or your provider can help).
Tue 1 Feb 2022 at 16:21 #63792AnonymousInactiveOK thank you. I requested logfiles from the hoster
Wed 2 Feb 2022 at 09:32 #63802FrankyKeymasterBtw: wordpress is more than just the filesize of a pdf đ It needs memory to work (all plugins take up mem too) and maybe your default mem setting is just too low?
If you go to wp-admin/site-health.php?tab=debug , section “Server”, you’ll see the PHP memory limit value. Make sure it is at least 128M or even better 256M or 512M.Wed 16 Feb 2022 at 17:45 #63916AnonymousInactiveDear Franky, thanks a lot for your help. Strangly, the error of 0 byte pdf attachements did not occur anymore. Therefore, we have a fraction of booking-mails where attachements are just missing.
I checked logs for server and php and also the PHP memory_limit. The latter has 256M and should therefore be large enough. Error logs did not show any specific errors. We looked for errors around the time of generation of pdf attachements but could not find any. Do you have any other suggestions what could have gone wrong here?
Wed 16 Feb 2022 at 17:48 #63917FrankyKeymasterNo sorry, without error logs I can’t tell you more. 0 bytes means “something” went wrong, but without more log info the cause is just unknown.
Tue 22 Feb 2022 at 12:58 #63943AnonymousInactiveOk that makes sense. Here are the error logs for the time around a booking, for which the Bookign corfirmation mail was sent on 02.02.22 11:46
Do you find any clues here? I did not and neither did a WordPress-experienced Person we consulted..
[Wed Feb 02 11:42:33.247732 2022] [:error] [pid 2643580] [client 185.220.101.187:27740] [client 185.220.101.187] ModSecurity: Warning. Operator EQ matched 0 at REQUEST_HEADERS. [file “/usr/share/modsecurity-crs/rules/REQUEST-920-PROTOCOL-ENFORCEMENT.conf”] [line “662”] [id “920340”] [msg “Request Containing Content, but Missing Content-Type header”] [severity “NOTICE”] [ver “OWASP_CRS/3.2.0”] [tag “application-multi”] [tag “language-multi”] [tag “platform-multi”] [tag “attack-protocol”] [hostname “www.linkemedienakademie.de”] [uri “/xmlrpc.php”] [unique_id “YfpgGZ4yetM9lbwZauu6XwAAABQ”]
[Wed Feb 02 11:42:37.262639 2022] [:error] [pid 2643580] [client 185.220.101.187:27740] [client 185.220.101.187] ModSecurity: Audit log: Failed to lock global mutex: Permission denied [hostname “www.linkemedienakademie.de”] [uri “/xmlrpc.php”] [unique_id “YfpgGZ4yetM9lbwZauu6XwAAABQ”]
[Wed Feb 02 11:42:37.263955 2022] [:error] [pid 2643580] [client 185.220.101.187:27740] [client 185.220.101.187] ModSecurity: Audit log: Failed to unlock global mutex: Permission denied [hostname “www.linkemedienakademie.de”] [uri “/xmlrpc.php”] [unique_id “YfpgGZ4yetM9lbwZauu6XwAAABQ”]
[Wed Feb 02 11:54:49.552251 2022] [:error] [pid 2396497] [client 104.244.76.127:36764] [client 104.244.76.127] ModSecurity: Warning. Pattern match “[\\\\n\\\\r]” at ARGS_NAMES:gt;\\r\\n. [file “/usr/share/modsecurity-crs/rules/REQUEST-921-PROTOCOL-ATTACK.conf”] [line “166”] [id “921150”] [msg “HTTP Header Injection Attack via payload (CR/LF detected)”] [data “Matched Data: \\x0d found within ARGS_NAMES:gt;\\x5cr\\x5cn: gt;\\x0d\\x0a”] [severity “CRITICAL”] [ver “OWASP_CRS/3.2.0”] [tag “application-multi”] [tag “language-multi”] [tag “platform-multi”] [tag “attack-protocol”] [tag “OWASP_CRS”] [tag “OWASP_CRS/WEB_ATTACK/HEADER_INJECTION”] [hostname “www.linkemedienakademie.de”] [uri “/-/-/-/-/-/-/-/-/-/-/”] [unique_id “Yfpi@dvgjFgr1FlcCXd@GQAAACE”]Tue 22 Feb 2022 at 13:24 #63944FrankyKeymasterThose are just modsecurity logs (a web application firewall thing), and indicate no issue at the time of your mail. Two of those are for malicious requests to xmlrpc.php, 1 is with uri â/-/-/-/-/-/-/-/-/-/-/â (which is obviously also a malicious request).
So modsecurity was not the problem in this case.Tue 22 Feb 2022 at 13:45 #63945AnonymousInactiveOK thanks, around the time of another booking on there are also only modsecurity warnings.
The PHP error logs appear to have only errors in Theme and GK Plugins. So there must be errors that are neither captured by Error Logs or PHP error Logs and not caused by memory problems. Do you have any other idea?
Tue 22 Feb 2022 at 14:17 #63946FrankyKeymasterSorry but no. If it is not reliably reproducible, my best guess is still a memory issue at that time. Or a bug in the pdf-library EME uses, but that would cause issues for all generated pdf files.
Tue 22 Feb 2022 at 15:17 #63947AnonymousInactiveOk thanks a lot for your effort. Just to clarify, this error still regularly occurs, at the moment in one third of booking mails. I will try to get back to the host.
Tue 22 Feb 2022 at 15:26 #63948FrankyKeymasterIf there’s such a booking with an empty pdf and you resend the booking mail (via the mass action), is it then ok?
Also: it might be that – if you approve many bookings in one go – the pdf generation causes a timeout (but that should be visible in the approval). I’ll check here on when possible timeouts could happen too.Tue 22 Feb 2022 at 15:40 #63949AnonymousInactiveI resent a couple of Mails via the mass action and then it worked. To clarify, the error of 0 byte pdf strangely did not occur anymore, the error I am talking about now is the complete missing of an attachment as written above.
What do you mean by “approval”?Tue 22 Feb 2022 at 17:13 #63950FrankyKeymasterTo be sure: I’ll update the dompdf library to the latest version, maybe that also resolves certain bugs.
But it would be nice if you were able to reproduce it … -
AuthorPosts
- The forum ‘Generic’ is closed to new topics and replies.