mail stops sending from queue intermiddentlyDescription:
------------
I want to start out by saying how much I like this package.
I have the mail sent on a cron and it will work for while then stop. The script returns then the error message below.
This is not continuous which makes it harder to detect. The only way to restart it, that I have found it to empty to the mail_queue table at which point it works fine for several runs until it stops again.
Any help would be greatly appreciated.
Test script:
---------------
include('mail_queue.config.php');
/* How many mails could we send each time the script is called */
$max_amount_mails = 75;
/* We use the db_options and mail_options from the config again */
$mail_queue =& new Mail_Queue($db_options, $mail_options);
/* Really sending the messages */
$mail_queue->sendMailsInQueue($max_amount_mails);
?>
Actual result:
--------------
Fatal error: Call to undefined method Mail_Queue_Error::getRecipient() in /usr/local/php5/lib/php/Mail/Queue.php on line 433spitfire
spitfirehttp://pear.php.net/bugs/16995
Mail_Queue Bug
Reported by spitfire
2010-01-14T11:45:47+00:00
PHP: 5.2.5 OS: Linux Package Version: 1.2.3
Description:
------------
I want to start out by saying how much I like this package.
I have the mail sent on a cron and it will work for while then stop. The script returns then the error message below.
This is not continuous which makes it harder to detect. The only way to restart it, that I have found it to empty to the mail_queue table at which point it works fine for several runs until it stops again.
Any help would be greatly appreciated.
Test script:
---------------
include('mail_queue.config.php');
/* How many mails could we send each time the script is called */
$max_amount_mails = 75;
/* We use the db_options and mail_options from the config again */
$mail_queue =& new Mail_Queue($db_options, $mail_options);
/* Really sending the messages */
$mail_queue->sendMailsInQueue($max_amount_mails);
?>
Actual result:
--------------
Fatal error: Call to undefined method Mail_Queue_Error::getRecipient() in /usr/local/php5/lib/php/Mail/Queue.php on line 433]]>Mail_Queue Bug
Reported by spitfire
2010-01-14T11:45:47+00:00
PHP: 5.2.5 OS: Linux Package Version: 1.2.3
Description:
------------
I want to start out by saying how much I like this package.
I have the mail sent on a cron and it will work for while then stop. The script returns then the error message below.
This is not continuous which makes it harder to detect. The only way to restart it, that I have found it to empty to the mail_queue table at which point it works fine for several runs until it stops again.
Any help would be greatly appreciated.
Test script:
---------------
include('mail_queue.config.php');
/* How many mails could we send each time the script is called */
$max_amount_mails = 75;
/* We use the db_options and mail_options from the config again */
$mail_queue =& new Mail_Queue($db_options, $mail_options);
/* Really sending the messages */
$mail_queue->sendMailsInQueue($max_amount_mails);
?>
Actual result:
--------------
Fatal error: Call to undefined method Mail_Queue_Error::getRecipient() in /usr/local/php5/lib/php/Mail/Queue.php on line 433]]>2010-01-14T11:45:47+00:00
till [2010-01-20 12:41] http://pear.php.net/bugs/16995#1263991262
<div id="changeset">
<span class="removed">-Status: Feedback</span>
<span class="added">+Status: Closed</span>
<span class="removed">-Roadmap Versions:</span>
<span class="added">+Roadmap Versions: 1.2.4</span>
</div>This bug has been fixed in SVN.
If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET).
If this was a problem with the pear.php.net website, the change should be live shortly.
Otherwise, the fix will appear in the package's next release.
Thank you for the report and for helping us make PEAR better.
David,
I'm gonna pronounce this fixed. Thank you very much for your bug report and
feedback. If this happens to be still an issue, feel free to re-open. I'll see if I can roll a
release by next week.
Till]]><div id="changeset">
<span class="removed">-Status: Feedback</span>
<span class="added">+Status: Closed</span>
<span class="removed">-Roadmap Versions:</span>
<span class="added">+Roadmap Versions: 1.2.4</span>
</div>This bug has been fixed in SVN.
If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET).
If this was a problem with the pear.php.net website, the change should be live shortly.
Otherwise, the fix will appear in the package's next release.
Thank you for the report and for helping us make PEAR better.
David,
I'm gonna pronounce this fixed. Thank you very much for your bug report and
feedback. If this happens to be still an issue, feel free to re-open. I'll see if I can roll a
release by next week.
Till]]>2010-01-20T12:41:02+00:00
till [2010-01-15 16:24] http://pear.php.net/bugs/16995#1263572673
Made another commit to improve error "handling", this should allow you to see what
your DB error is:
http://svn.php.net/viewvc/pear/packages/Mail_Queue/trunk/Mail/Queue/Container/mdb2
.php?r1=288376&r2=293586]]>Made another commit to improve error "handling", this should allow you to see what
your DB error is:
http://svn.php.net/viewvc/pear/packages/Mail_Queue/trunk/Mail/Queue/Container/mdb2
.php?r1=288376&r2=293586]]>2010-01-15T16:24:33+00:00
till [2010-01-15 16:02] http://pear.php.net/bugs/16995#1263571330
Which one exactly?
The E_NOTICE hints that something with the db failed.
Or is the memory_limit still being hit? If this is the case, can you increase it?]]>Which one exactly?
The E_NOTICE hints that something with the db failed.
Or is the memory_limit still being hit? If this is the case, can you increase it?]]>2010-01-15T16:02:10+00:00
spitfire [2010-01-15 12:51] http://pear.php.net/bugs/16995#1263559902
Unfortunately not - the problem pesists]]>Unfortunately not - the problem pesists]]>2010-01-15T12:51:42+00:00
till [2010-01-15 12:46] http://pear.php.net/bugs/16995#1263559616
Any updates? Let me know, I'd like to pronounce this bug as fixed. :)]]>Any updates? Let me know, I'd like to pronounce this bug as fixed. :)]]>2010-01-15T12:46:56+00:00
till [2010-01-14 18:07] http://pear.php.net/bugs/16995#1263492425
Nevermind my PEAR Error config question -- we issue an E_NOTICE ourselves. Not the
most pretty way to display/handle an error, but I guess the objective is to not "cancel"
the process just because a single message fails.
Also, please try this "patch":
http://svn.php.net/viewvc/pear/packages/Mail_Queue/trunk/Mail/Queue.php?
r1=293549&r2=293552]]>Nevermind my PEAR Error config question -- we issue an E_NOTICE ourselves. Not the
most pretty way to display/handle an error, but I guess the objective is to not "cancel"
the process just because a single message fails.
Also, please try this "patch":
http://svn.php.net/viewvc/pear/packages/Mail_Queue/trunk/Mail/Queue.php?
r1=293549&r2=293552]]>2010-01-14T18:07:05+00:00
till [2010-01-14 17:58] http://pear.php.net/bugs/16995#1263491939
Do you use any PEAR error configuration?
It sounds like you loose the db connection, and the memory limit is hit. The thing is
that re: the db connection, you could up the mysql timeout and as for the
memory_limit, it looks like you have a limit of 32 MB? Which is not too much and
pretty conservative.
I know people generally hesitate to up that, but on the other hand the standard PHP
install comes with 128 MB at least.
To track memory usage, do the following: In Mail_Queue::sendMailsInQueue()
(Mail/Queue.php), there is a while() loop, feel free to
var_dump(memory_get_usage()); inside of it. If it grows, I'm guessing we could
improve memory handling there.
How large are your emails?]]>Do you use any PEAR error configuration?
It sounds like you loose the db connection, and the memory limit is hit. The thing is
that re: the db connection, you could up the mysql timeout and as for the
memory_limit, it looks like you have a limit of 32 MB? Which is not too much and
pretty conservative.
I know people generally hesitate to up that, but on the other hand the standard PHP
install comes with 128 MB at least.
To track memory usage, do the following: In Mail_Queue::sendMailsInQueue()
(Mail/Queue.php), there is a while() loop, feel free to
var_dump(memory_get_usage()); inside of it. If it grows, I'm guessing we could
improve memory handling there.
How large are your emails?]]>2010-01-14T17:58:59+00:00
spitfire [2010-01-14 17:07] http://pear.php.net/bugs/16995#1263488847
Different error now - I got several lines of
Notice: Error in sending mail: Mail Queue Error: db query failed in /usr/local/php5/lib/php/PEAR.php on line 896
followed by:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 32 bytes) in /usr/local/php5/lib/php/PEAR.php on line 872]]>Different error now - I got several lines of
Notice: Error in sending mail: Mail Queue Error: db query failed in /usr/local/php5/lib/php/PEAR.php on line 896
followed by:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 32 bytes) in /usr/local/php5/lib/php/PEAR.php on line 872]]>2010-01-14T17:07:27+00:00
spitfire [2010-01-14 16:36] http://pear.php.net/bugs/16995#1263487003
Thank you Till - I have installed the patch and set it running again - its sending okay, I'll watch and see if it stops and let you know.
Very grateful for your help!]]>Thank you Till - I have installed the patch and set it running again - its sending okay, I'll watch and see if it stops and let you know.
Very grateful for your help!]]>2010-01-14T16:36:43+00:00
till [2010-01-14 16:11] http://pear.php.net/bugs/16995#1263485464
<div id="changeset">
<span class="removed">-Assigned To:</span>
<span class="added">+Assigned To: till</span>
</div>Hey David,
here's the commit:
http://svn.php.net/viewvc/pear/packages/Mail_Queue/trunk/Mail/Queue.php?
r1=288406&r2=293549
Please let me know if this helps your situation. It should improve error handling in
Mail_Queue and at least help you debug why there is an error.
Btw, I noticed that the line where the error occurs is different from trunk, but who
knows why that is the case. Trunk might contain other bugfixes.
Cheers,
Till]]><div id="changeset">
<span class="removed">-Assigned To:</span>
<span class="added">+Assigned To: till</span>
</div>Hey David,
here's the commit:
http://svn.php.net/viewvc/pear/packages/Mail_Queue/trunk/Mail/Queue.php?
r1=288406&r2=293549
Please let me know if this helps your situation. It should improve error handling in
Mail_Queue and at least help you debug why there is an error.
Btw, I noticed that the line where the error occurs is different from trunk, but who
knows why that is the case. Trunk might contain other bugfixes.
Cheers,
Till]]>2010-01-14T16:11:04+00:00
till [2010-01-14 16:00] http://pear.php.net/bugs/16995#1263484807
Ok, first off, thanks for staying with us. :D
Then, I just realized the error is simple. But probably not something you can fix. I'm
assuming that the error is from your database connection, or something -- maybe
it times out, etc..
Give me an hour or so and I'll have a patch for you to try.]]>Ok, first off, thanks for staying with us. :D
Then, I just realized the error is simple. But probably not something you can fix. I'm
assuming that the error is from your database connection, or something -- maybe
it times out, etc..
Give me an hour or so and I'll have a patch for you to try.]]>2010-01-14T16:00:07+00:00
spitfire [2010-01-14 15:47] http://pear.php.net/bugs/16995#1263484075
Many thanks for your help on this.
I did an update on the library earlier, to ensure it the current version.
It hung again, this time a message with 18 tries was the cause, once this was deleted, it started again.
Here is the file, with passwords etc xxxxed out:
// Pear library:
require_once ('Mail/Queue.php');
// Options for storing the messages
// Type is the container used, currently there are 'creole', 'db', 'mdb' and 'mdb2' available
$db_options['type'] = 'mdb2';
// Database access:
$db_options['dsn'] = 'mysql://mail_queue:xxxxxxxxx@localhost/midas_local';
$db_options['mail_table'] = 'mail_queue';
// Here are the options for sending the messages themselves
// These are the options needed for the Mail-Class, especially used for Mail::factory()
$mail_options['driver'] = 'smtp';
$mail_options['host'] = 'smtp.xxxxxxx.com';
$mail_options['port'] = 25;
$mail_options['localhost'] = 'localhost'; //optional Mail_smtp parameter
$mail_options['auth'] = true;
$mail_options['username'] = 'xxxxxxxx';
$mail_options['password'] = 'xxxxxxxx';]]>Many thanks for your help on this.
I did an update on the library earlier, to ensure it the current version.
It hung again, this time a message with 18 tries was the cause, once this was deleted, it started again.
Here is the file, with passwords etc xxxxed out:
// Pear library:
require_once ('Mail/Queue.php');
// Options for storing the messages
// Type is the container used, currently there are 'creole', 'db', 'mdb' and 'mdb2' available
$db_options['type'] = 'mdb2';
// Database access:
$db_options['dsn'] = 'mysql://mail_queue:xxxxxxxxx@localhost/midas_local';
$db_options['mail_table'] = 'mail_queue';
// Here are the options for sending the messages themselves
// These are the options needed for the Mail-Class, especially used for Mail::factory()
$mail_options['driver'] = 'smtp';
$mail_options['host'] = 'smtp.xxxxxxx.com';
$mail_options['port'] = 25;
$mail_options['localhost'] = 'localhost'; //optional Mail_smtp parameter
$mail_options['auth'] = true;
$mail_options['username'] = 'xxxxxxxx';
$mail_options['password'] = 'xxxxxxxx';]]>2010-01-14T15:47:55+00:00
till [2010-01-14 12:31] http://pear.php.net/bugs/16995#1263472281
No, please include your "mail_queue config".
Also, are you using the latest version? (I'm just making sure) :)]]>No, please include your "mail_queue config".
Also, are you using the latest version? (I'm just making sure) :)]]>2010-01-14T12:31:21+00:00
spitfire [2010-01-14 12:26] http://pear.php.net/bugs/16995#1263471998
Do you mean this?
include('mail_queue.config.php');
/* How many mails could we send each time the script is called */
$max_amount_mails = 100;
/* We use the db_options and mail_options from the config again */
$mail_queue = new Mail_Queue($db_options, $mail_options);
/* Really sending the messages */
$mail_queue->sendMailsInQueue($max_amount_mails);]]>Do you mean this?
include('mail_queue.config.php');
/* How many mails could we send each time the script is called */
$max_amount_mails = 100;
/* We use the db_options and mail_options from the config again */
$mail_queue = new Mail_Queue($db_options, $mail_options);
/* Really sending the messages */
$mail_queue->sendMailsInQueue($max_amount_mails);]]>2010-01-14T12:26:38+00:00
bate [2010-01-14 12:21] http://pear.php.net/bugs/16995#1263471694
Can you please provide smallest running example code so that i can reproduce that?
Try without database stuff ...]]>Can you please provide smallest running example code so that i can reproduce that?
Try without database stuff ...]]>2010-01-14T12:21:34+00:00
spitfire [2010-01-14 12:14] http://pear.php.net/bugs/16995#1263471276
Taking the & out didn't seem to make any difference.
What I have noticed however is that when it stops sending the message in the queue with the lowed id has a number between 0 and 25 for tries sent. That is to say it didn't send on the first time but didn't try 25 times when it passes over.]]>Taking the & out didn't seem to make any difference.
What I have noticed however is that when it stops sending the message in the queue with the lowed id has a number between 0 and 25 for tries sent. That is to say it didn't send on the first time but didn't try 25 times when it passes over.]]>2010-01-14T12:14:36+00:00
bate [2010-01-14 11:47] http://pear.php.net/bugs/16995#1263469653
<div id="changeset">
<span class="removed">-Status: Open</span>
<span class="added">+Status: Feedback</span>
</div>can you please try your code without the & in $mail_queue =& new Mail_Queue
ie. $mail_queue = new Mail_Queue]]><div id="changeset">
<span class="removed">-Status: Open</span>
<span class="added">+Status: Feedback</span>
</div>can you please try your code without the & in $mail_queue =& new Mail_Queue
ie. $mail_queue = new Mail_Queue]]>2010-01-14T11:47:33+00:00