Mass Email causing an error in queue.php file - Fatal error:

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
User avatar
Alien_Time
Registered User
Posts: 389
Joined: Fri Dec 31, 2010 7:08 am

Mass Email causing an error in queue.php file - Fatal error:

Post by Alien_Time »

HI guys,

I need help since I am having this error on my site now:
Fatal error: Maximum execution time of 30 seconds exceeded in /home1/(my domain)/public_html/cache/queue.php on line 3
I am using phpbb v3.0.9. I will also tell you what may be causing this error..

First, I am trying to send an HTML mass email to all users (1200 members). When I was trying to send the email, by NOT selecting "send Immediately" so the email is logged in queue, I was getting this error at first:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 35050049 bytes) in /home1/(my domain)/public_html/includes/functions_messenger.php on line 903
I fixed the above error by going to php.ini file and changed memory_limit from 64M to 128M. After that, when I resent the mass HTML email, it was sent this time with the message that "It has been placed in the queue". So it seems everything was okay..

but a new problem has started now. When someone is posting a reply to a topic, after they click "Submit", I am receiving this message now after 30 seconds of loading:
Fatal error: Maximum execution time of 30 seconds exceeded in /home1/(my domain)/public_html/cache/queue.php on line 3
The wierd thing is that the users get this message even though the message was posted in the topic!!

So, I had a look at the cache/queue.php and I see these:

Code: Select all

<?php
if (!defined('IN_PHPBB')) exit;
$this->queue_data = unserialize('a:1:{s:5:"email";a:2:{s:12:"package_size";s:2:"50";s:4:"data";a:1034:{i:0;a:5:{s:2:"to";s:55:"=?UTF-8?B?YWRtaW4=?= <admin email address>";s:9:"addresses";a:1:{s:2:"to";a:1:{i:0;a:2:{s:5:"email";s:32:"admin email address";s:4:"name";s:5:"admin";}}}s:7:"subject";s:46:"EMAIL subject";s:3:"msg";s:7349:"
[i]followed by my HTML email codes...[/i]
The size of this queue.php is huge as well: 8.41 MB and I think its mainly because of the size of the html email. I read this topic: http://www.phpbb.com/community/viewtopi ... &t=2042715

So, I downloaded a copy of the queue.php and I deleted this file from the server. After that the above error disappeared and the forum functions fine. Users are able to post without getting this error now!

Now, the problem I have is, the mass email has not been sent! Not even 1! Also, I understand that the emails are sent in packets of 50 every 10 minutes, but it has been an hour since I sent the mass email (even before I deleted the queue.php file), and nothing is sent and also the queue.php file is causing error is other forum functions like posting topics.

My email settings:
E-mail package size: 50
and using SMTP settings.

I know that the email settings are correct and its not the email settings that is casuing the problem! I also wonder now what happens to the mass emails on queue when I tried sending it before now that I have deleted the queue.php file??? Would someone be able to help me understand the cause of this problem and a solution to fix this? Why is this happening?

Very much appreciated!
Oleg
Former Team Member
Posts: 1221
Joined: Sat Jan 30, 2010 4:42 pm
Location: NYC
Contact:

Re: Mass Email causing an error in queue.php file - Fatal er

Post by Oleg »

The maximum execution time issue is something we see periodically, but we do not have a solution for it yet. I personally have a hard time understanding how deserializing 10 megabytes of data can take over half a minute.

Would you be ok with PMing me your queue.php file? You can delete or replace any private information in it (but take care not to alter the structure of the file, e.g. punctuation, while doing so).

A workaround would be decreasing queue interval (I'm not sure whether it is tunable in the acp, you might need to alter it manually in the config table).

When you delete queue.php you lose all queued mail.
Participate in phpBB development: Get involved | Issue tracker | Report a bug | Development board | [url=irc://chat.freenode.net/phpbb-dev]Development IRC chat[/url]
My stuff: mindlinkgame.com
User avatar
Alien_Time
Registered User
Posts: 389
Joined: Fri Dec 31, 2010 7:08 am

Re: Mass Email causing an error in queue.php file - Fatal er

Post by Alien_Time »

Thank you Oleg,
I personally have a hard time understanding how deserializing 10 megabytes of data can take over half a minute.
I understand what you mean...I've noticed you had mentioned this here as well: http://www.phpbb.com/community/viewtopi ... &t=2008535
A workaround would be decreasing queue interval (I'm not sure whether it is tunable in the acp, you might need to alter it manually in the config table).


I am not really sure how to do it..I will try and look into it..

I will PM my queue.php file to you now..Thank you so much for looking into it.
User avatar
Alien_Time
Registered User
Posts: 389
Joined: Fri Dec 31, 2010 7:08 am

Re: Mass Email causing an error in queue.php file - Fatal er

Post by Alien_Time »

Hi Oleg,

I have sent you the queue.php file. Hope you received it...

Also just an update. I just sent the newsletter that I was trying to send earlier to all my users. This time, I selected the members manually in batches of 250 users at a time and selected "Send Immedietly" option. The emails were sent successfully this time. It took me 2-3 hours to send the emails to all users this way since i am doing this manually.

So there is only a problem when I try to send the emails in queue. So hopefully you can understand where the problem might be.

Also I would like to ask others as well. As anyone else had problems like these? What is the way around this? How do boards with over 5000 members do it?

Thank you for all the support..Hopefully there is a solution to this..Cheers
danthony2
Registered User
Posts: 45
Joined: Wed May 06, 2009 2:55 am

Re: Mass Email causing an error in queue.php file - Fatal er

Post by danthony2 »

tagging this to read later since I am having this issue also after my 3.0.9 upgrade.
Oleg
Former Team Member
Posts: 1221
Joined: Sat Jan 30, 2010 4:42 pm
Location: NYC
Contact:

Re: Mass Email causing an error in queue.php file - Fatal er

Post by Oleg »

I used this test file:

Code: Select all

<?php
define('IN_PHPBB',1);
class c {
function foo() {
include "queue.php";

}}
$c=new c;
$c->foo();
I got:

Code: Select all

time php test.php
PHP Notice:  unserialize(): Error at offset 7708 of 8866755 bytes in /usr/home/pie/queue.php on line 44465

Notice: unserialize(): Error at offset 7708 of 8866755 bytes in /usr/home/pie/queue.php on line 44465
php test.php  0.15s user 0.07s system 99% cpu 0.218 total
Participate in phpBB development: Get involved | Issue tracker | Report a bug | Development board | [url=irc://chat.freenode.net/phpbb-dev]Development IRC chat[/url]
My stuff: mindlinkgame.com
Oleg
Former Team Member
Posts: 1221
Joined: Sat Jan 30, 2010 4:42 pm
Location: NYC
Contact:

Re: Mass Email causing an error in queue.php file - Fatal er

Post by Oleg »

accn wrote: Also I would like to ask others as well. As anyone else had problems like these? What is the way around this? How do boards with over 5000 members do it?
There is no need to use the queue if you have a local MTA (sendmail/exim/postfix/qmail).
Participate in phpBB development: Get involved | Issue tracker | Report a bug | Development board | [url=irc://chat.freenode.net/phpbb-dev]Development IRC chat[/url]
My stuff: mindlinkgame.com
User avatar
Alien_Time
Registered User
Posts: 389
Joined: Fri Dec 31, 2010 7:08 am

Re: Mass Email causing an error in queue.php file - Fatal er

Post by Alien_Time »

Oleg wrote:I used this test file:

Code: Select all

<?php
define('IN_PHPBB',1);
class c {
function foo() {
include "queue.php";

}}
$c=new c;
$c->foo();
I got:

Code: Select all

time php test.php
PHP Notice:  unserialize(): Error at offset 7708 of 8866755 bytes in /usr/home/pie/queue.php on line 44465

Notice: unserialize(): Error at offset 7708 of 8866755 bytes in /usr/home/pie/queue.php on line 44465
php test.php  0.15s user 0.07s system 99% cpu 0.218 total
Hi Oleg...thank you for testing..But i dont understand what the error means..do you know what it is?
There is no need to use the queue if you have a local MTA (sendmail/exim/postfix/qmail).
Thanks...I guess I need to look into that from now on when I send the newsletters to all users..
Oleg
Former Team Member
Posts: 1221
Joined: Sat Jan 30, 2010 4:42 pm
Location: NYC
Contact:

Re: Mass Email causing an error in queue.php file - Fatal er

Post by Oleg »

It looks like queue.php you sent me was corrupt.

If you did not alter it in any way then we are not really getting closer to a solution.
Participate in phpBB development: Get involved | Issue tracker | Report a bug | Development board | [url=irc://chat.freenode.net/phpbb-dev]Development IRC chat[/url]
My stuff: mindlinkgame.com
Locked

Return to “[3.0.x] Support Forum”