Events Made Easy Forums Generic Pdf Attachment has 0 bytes

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #63783
    Anonymous
    Inactive

    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!

    #63786
    Franky
    Keymaster

    Maybe the webserver has issues generating the pdf due to memory issues. Can you check your php error logs here?

    #63789
    Anonymous
    Inactive

    If 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?

    #63790
    Franky
    Keymaster

    WP_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).

    #63792
    Anonymous
    Inactive

    OK thank you. I requested logfiles from the hoster

    #63802
    Franky
    Keymaster

    Btw: 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.

    #63916
    Anonymous
    Inactive

    Dear 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?

    #63917
    Franky
    Keymaster

    No 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.

    #63943
    Anonymous
    Inactive

    Ok 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”]

    #63944
    Franky
    Keymaster

    Those 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.

    #63945
    Anonymous
    Inactive

    OK 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?

    #63946
    Franky
    Keymaster

    Sorry 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.

    #63947
    Anonymous
    Inactive

    Ok 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.

    #63948
    Franky
    Keymaster

    If 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.

    #63949
    Anonymous
    Inactive

    I 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”?

    #63950
    Franky
    Keymaster

    To 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 …

Viewing 16 posts - 1 through 16 (of 16 total)
  • The forum ‘Generic’ is closed to new topics and replies.
Scroll to Top