Bug Server errors running digest job - emogrifier

Status
Not open for further replies.

ichpen

Customer
Mail 4.3b1

So I got about 30+ of these new errors this morning. I can successfully test the digest which doesn't generate these errors but the actual digest job appears to be. My digest log shows this morning's digest as as sent but I'm not so sure and can't independently verify this easily so a little concerned.

  • Error: Call to a member function appendChild() on null
  • src/vendor/pelago/emogrifier/src/Emogrifier.php:1419
  • Generated by: Unknown account
  • May 16, 2019 at 9:20 PM
Stack trace
#0 src/vendor/pelago/emogrifier/src/Emogrifier.php(1328): Pelago\Emogrifier->addStyleElementToDocument('.listInline.lis...')
#1 src/vendor/pelago/emogrifier/src/Emogrifier.php(526): Pelago\Emogrifier->copyUninlineableCssToStyleNode(Object(DOMXPath), Array)
#2 src/vendor/pelago/emogrifier/src/Emogrifier.php(377): Pelago\Emogrifier->process()
#3 src/XF/Mail/Styler.php(36): Pelago\Emogrifier->emogrify()
#4 src/XF/Mail/Mailer.php(187): XF\Mail\Styler->styleHtml('<p>Your Brand N...', false, Object(XF\Language))
#5 src/addons/DBTech/Mail/Job/DigestEmail.php(182): XF\Mail\Mailer->renderMailTemplate('dbtech_mail_dig...', Array, Object(XF\Language), Object(ForumApps\API\XF\Entity\User))
#6 src/XF/Job/AbstractUserCriteriaJob.php(59): DBTech\Mail\Job\DigestEmail->executeAction(Object(ForumApps\API\XF\Entity\User))
#7 src/addons/DBTech/Mail/Job/DigestEmail.php(90): XF\Job\AbstractUserCriteriaJob->run(G)
#8 src/XF/Job/Manager.php(253): DBTech\Mail\Job\DigestEmail->run(G)
#9 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#10 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#11 job.php(42): XF\Job\Manager->runQueue(false, 8)
#12 {main}
Request state
array(4) {
["url"] => string(8) "/job.php"
["referrer"] => string(51) "https://mysite.com/whats-new/posts/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 
Last edited:
Without a reliable way to reproduce it, I'm not rightly sure how to debug this. You may be able to replicate the issue in the test mode by figuring out which user it attempted to send the digest to and testing using that user as the test user.
 
Without a reliable way to reproduce it, I'm not rightly sure how to debug this. You may be able to replicate the issue in the test mode by figuring out which user it attempted to send the digest to and testing using that user as the test user.

This is happening for every user. I can test successfully as I mention with any user including those that have generated an error without issue. Now have hundreds of errors in my log as the digest continues to run
 
Have you customised the email templates for this mod, for any style? If so, please try reverting them.
 
So this started suddenly working after an addon rebuild.... Pfff. :) Thanks for looking into it.

Hold your champagne glasses it happened again but for a subset of digest users. I'm suspecting something content based at this point so will try to create it using the test digest function.
 
@Fillip H. confirming my logs are still filling up with the exact issue as above. Occasionally some digest emails do make it through without generating the error by eyeballing the logs but most cause this. I'm double checking with some members to see if they're actually receiving the digest or not at this point.

No template edits, running the b2 version of course.
 
Without a reliable way to reproduce this there's not much I can do, unfortunately.

What do you have as the intro text for the digest?
 
Without a reliable way to reproduce this there's not much I can do, unfortunately.

What do you have as the intro text for the digest?

Funny you say that I took off the intro text in the middle of this morning's digest error prone run and errors stopped but I can't scientifically say that's the reason.

I had a couple of lines of text with a period at the end. No html markup.

Is there a way to manually trigger the job run workflow on demand as I can't recreate this with the test digest feature? I know I can restrict the digest but right now have to wait a day until the next run.
 
You could potentially set the dbtech_mail_newsletter_lastreceive column on the xf_user table back to 0 and then run the cron job manually, in theory that should mean you receive it.
 
@Fillip H.

Update after removing the intro text entirely I'm not seeing this error at the moment. Mind you very few digest emails were sent out this morning (majority go out Sunday morning) so not definitive.

The below is what I had for an intro text, nothing special about it (remove the quotes):
"Your Brand New CCF Digest is here. Below are some of the new topics discussed since we shipped off your last digest email. "

I cannot reliably recreate this at the moment unfortunately I just saw the error during large batches.
 
I have a theory that it could be related to BBCode in the preview. If the BBCode renders to advanced HTML, that could cause a problem since not all forms of HTML are supported in emails.

Add that to the fact that broken BBCode can occur, I'm going to disable BBCode in the preview going forward.
 
I have a theory that it could be related to BBCode in the preview. If the BBCode renders to advanced HTML, that could cause a problem since not all forms of HTML are supported in emails.

Add that to the fact that broken BBCode can occur, I'm going to disable BBCode in the preview going forward.

Aww (sad face), I got a pretty positive reaction to the embedded images in emails. I'm curious though why I can't recreate it using the test function vs the job runner. From what I can tell I'm supposedly rendering the same content using some of the usernames that triggered this error.
 
So I've had a few smaller batches of digests go out and this error hasn't shown up yet since I nuked the Intro text. Not saying that's the reason as your theory is a lot more sound than my own so simply reporting this possibly coincidental occurrence. I'll update the thread if error comes back as larger batches are coming this weekend. @Fillip H.
 
Fair enough, thanks for getting back to me :)

I've added an option to control whether rich preview is enabled in digests as opposed to just blanket removing it, since it would appear as if rich previews are not the root cause.
 
Hello @ichpen,

We hope your ticket regarding DragonByte Mail has been addressed to your satisfaction. This ticket has now been scheduled to be closed.

If your ticket has not been resolved, you can reply to this thread at any point in the next 7 days in order to reopen the ticket, afterwards this thread will be closed.

Please do not reply to this thread if your ticket has been resolved.

Thank you.


- DragonByte Technologies, Ltd.
 
Hello @ichpen,

As we have not heard back from you, your ticket regarding DragonByte Mail has now been closed.

If your ticket has not been resolved, please feel free to start a new support ticket and link back to this ticket.

If you have time, please leave a review on XenForo.com's Resource Manager.

Thank you.


- DragonByte Technologies, Ltd.
 
Status
Not open for further replies.

DragonByte Mail

XenForo 1.5.3+ XenForo 2.0.x XenForo 2.1.x XenForo 2.2.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
1,148
Customer rating
0.00 star(s) 0 ratings
Back
Top