PM Problem (notification e-mail repeats over and over)

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)
gbdg
Registered User
Posts: 25
Joined: Mon Jan 12, 2004 6:30 am

Re: PM Problem (notification e-mail repeats over and over)

Post by gbdg » Sun May 04, 2008 9:13 pm

I had a similar issue this week and could not clear the cache using the admin feature. Eventually I stopped the site (I run the server), deleted the CACHE folder, created a new folder and assigned the correct permissions. Problem solved.

User avatar
T0ny
Registered User
Posts: 1383
Joined: Sun Jan 29, 2006 8:42 pm
Location: Lancashire
Name: Tony

Re: PM Problem (notification e-mail repeats over and over)

Post by T0ny » Sun May 04, 2008 10:45 pm

If the concern is that an admin might unknowingly purge queue.php in a "normal" purge, the reverse is also true, where purging the cache in an attempt to solve a serious problem leaves the admin unknowingly with the problem still in the cache.
The queue.php file is technically not a cache file, even though it resides (presumably for permissions reasons) in the cache directory.

However, you are entirely correct that phpbb should inform the admin when something goes wrong with the queue system rather than press on regardless sending the same email over and over. As an example, when the script detects that a queue lock file already exists it should notify the admin(s) and then exit without sending any emails. This would give an admin the option of deleting the lock file and allowing email delivery to continue or delete the queue and lock files to avoid multiple emails being sent.
If the board hit maximum_execution_time, why no logged error?
Maybe the configuration of the server is such that timeout errors aren't written to the error log. Testing with a script that deliberately times out may answer this question

Captain Don
Registered User
Posts: 88
Joined: Wed Jan 17, 2007 4:46 am
Location: Michigan
Contact:

Re: PM Problem (notification e-mail repeats over and over)

Post by Captain Don » Sun May 04, 2008 11:06 pm

T0ny wrote:

However, you are entirely correct that phpbb should inform the admin when something goes wrong with the queue system rather than press on regardless sending the same email over and over. As an example, when the script detects that a queue lock file already exists it should notify the admin(s) and then exit without sending any emails. This would give an admin the option of deleting the lock file and allowing email delivery to continue or delete the queue and lock files to avoid multiple emails being sent.
So that queue lock file was supposed to stop the e-mail notificatons from going out when there is a problem? If I am not mistaken on my site there was a queue lock file generated and the notifications kept going out until Ruler deleted the lock file and renamed the queue file.

Just some more info on the problem as everything is still working fine on my site! Thanks again everyone! Hope it never happens again! 8-)

SamG
Former Team Member
Posts: 3221
Joined: Fri Aug 31, 2001 6:35 pm
Location: Beautiful Northwest Lower Michigan
Name: Sam Graf

Re: PM Problem (notification e-mail repeats over and over)

Post by SamG » Mon May 05, 2008 1:27 am

T0ny wrote:The queue.php file is technically not a cache file, even though it resides (presumably for permissions reasons) in the cache directory.
Then perhaps a queue folder with its own "panic purge" is worth considering as a minimally invasive revision suitable for a 3.0.x release...

User avatar
Eelke
QA Team
Posts: 2903
Joined: Thu Dec 20, 2001 8:00 am
Location: NL, Bussum
Name: Eelke Blok
Contact:

Re: PM Problem (notification e-mail repeats over and over)

Post by Eelke » Mon May 05, 2008 6:37 am

Captain Don wrote:So that queue lock file was supposed to stop the e-mail notificatons from going out when there is a problem?
What it's supposed to do can only be answered by the dev team :) T0ny is suggesting a more appropriate behaviour than what it seems to be exhibiting now.

I'm also interested in the question raised earlier; why not keep the queue in the database, flagging off (or removing) entries as they are processed? In that case, even when the maximum execution time is reached, there really isn't a big problem; the next time the process runs, it will just start over where it left off.

User avatar
Ruler2112
Registered User
Posts: 21
Joined: Mon Apr 28, 2008 5:54 am

Re: PM Problem (notification e-mail repeats over and over)

Post by Ruler2112 » Tue May 06, 2008 4:43 am

The reason IMHO that the queue.php file resides in the cache folder is because it's a temporary file - it's created and disappears often. If something gets borked in that directory at a file system level, it's not a big deal if the stuff in it is lost. (Kind of like /tmp on *nix file systems.) Just an opinion - I have very little experience with the code for this project, so take it for what it's worth.


gbdg - Please look in the cache directory. If there is no .htaccess file, create one like below as a plain text file. This is what gives security to that folder so a malicious user cannot just go into it and change files to run malicious code on your server! Without it, go to your forum index and append cache/ to the URL. (If your site is blah.com and you access the forum by going to blah.com/phpbb3, type in blah.com/phpbb3/cache/ and hit enter.) By doing so, you can probably see why this would be a bad thing to be missing... :)

Code: Select all

<Files *>
	Order Allow,Deny
	Deny from All
</Files>

I was not aware that there was a maximum execution time defined for cron to run. If true, that could be what was happening - the original queue.php was 920k. The only problem with this theory is that my e-mail address was record #17 in queue.php, and I was not receiving duplicate e-mail notifications. Unless the loop counted down from the end instead of up from the beginning...



One reason I suggested using a database for the notifications is because I recently wrote a mass e-mail marketing system at work that uses this same design. (How's that for coincidental! :o :) ) When a job is triggered, the customer database is filtered to select who should receive which messages based on criteria set up in the job. Records that match said criteria have messages sent to the customer and are flagged as being sent as they go out. I even record the UID of each e-mail; in case somebody complains of the number of e-mails they're getting, I can go back and with very simple SQL, see exactly how many of what messages got sent to this person when. Even if the background daemon responsible for processing jobs (among other things) dies, a customer won't get duplicate messages because the system knows who it sent one to and when, refusing to send another before a specific amount of time has passed, also defined on a per-job basis. (It may actually be technically possible for a duplicate to be sent, but only if the system stops working between the time the SMTP connection is closed and the time the record indicating a sent e-mail is added to the table, but we're talking a window of maybe a few nanoseconds here... it's never happened and I'd be very surprised if it ever does - the daemon has yet to go down once in 7 months of use. 8-) )

While I never considered using a file-based approach as phpBB does in it's notifications (I had a database available - why would I use a plain file???), I did try to think of any possible happenstance and plan for an elegant recovery of such. If anybody wants details to use in an implementation under phpBB, feel free to contact me; I'd be glad to help. Remember though - I know squat when it comes to PHP. Perl is my language of choice under *nix currently, but design would be identical. And really, code is code - change some statements/syntax around and you're all set... :D

User avatar
Eelke
QA Team
Posts: 2903
Joined: Thu Dec 20, 2001 8:00 am
Location: NL, Bussum
Name: Eelke Blok
Contact:

Re: PM Problem (notification e-mail repeats over and over)

Post by Eelke » Tue May 06, 2008 6:54 am

Ruler2112 wrote:I was not aware that there was a maximum execution time defined for cron to run.
IIRC, the cron.php has nothing to do with the cron process on a Unix system, it is the maximum execution time for a PHP script you have to worry about. The only way in which a PHP web application can start processing something is when a client makes a request, AFAIK that's also how the "cron" system in phpBB works; it's simply triggered when someone requests a page.

User avatar
Ruler2112
Registered User
Posts: 21
Joined: Mon Apr 28, 2008 5:54 am

Re: PM Problem (notification e-mail repeats over and over)

Post by Ruler2112 » Wed May 07, 2008 5:07 am

Ruler2112 wrote:the daemon has yet to go down once in 7 months of use.
I had to do it, didn't I? I couldn't just leave well enough alone! The very day after bragging about how my daemon has never had a problem, I get to work and the lady in charge of e-mail marketing tells me that the e-mails didn't go out. I checked and the daemon wasn't running. :oops: :roll: In my own defense, the logs clearly indicate that it ran into a bug in the Slackware kernel - not a bug of mine! :) 'Write daemon watchdog' was added to my whiteboard today.

Not that this has anything even remotely to do with the main topic of this thread - I just felt like sharing what I caused by mentioning that in this thread... ;) :lol: (Kind of like the whole 'it rained because I washed my car' scenario. :D )

User avatar
Eelke
QA Team
Posts: 2903
Joined: Thu Dec 20, 2001 8:00 am
Location: NL, Bussum
Name: Eelke Blok
Contact:

Re: PM Problem (notification e-mail repeats over and over)

Post by Eelke » Wed May 07, 2008 6:31 am

Ruler2112 wrote:Not that this has anything even remotely to do with the main topic of this thread
Never mind. Thanks for the amusing anecdote.

moozer
Registered User
Posts: 102
Joined: Sat Nov 10, 2007 10:36 pm
Location: Netherlands
Contact:

Re: PM Problem (notification e-mail repeats over and over)

Post by moozer » Fri Jun 27, 2008 8:00 pm

Hi all,

What is the reason this topic came to an end?
To me it seems like a serious issue and I would like to find the cause and the solution.

I experienced the same behaviour of PM notification emails being send repeatetly after sending a mass-PM to all registered users. In my case there were also invalid email addresses.
My phpbb3 is running on a win2k3 server. The cache folder has modify/read/write permission but no full-controll permission.

I hope there are still some people here interested in this problem.
cheers, Robbie
Board at http://www.noobdude.com , Running phpbb3, Template(s) used: ProSilver, Language(s) used: English, Its hosted on a local server, Version of PHP used: 5.2.0, Database and version used: MySQL 5

SamG
Former Team Member
Posts: 3221
Joined: Fri Aug 31, 2001 6:35 pm
Location: Beautiful Northwest Lower Michigan
Name: Sam Graf

Re: PM Problem (notification e-mail repeats over and over)

Post by SamG » Fri Jun 27, 2008 9:17 pm

The topic ended because 1) the OP did not experience a repeat of the problem, 2) it was not repeatable, and 3) no clear understanding of the cause was obtained. There was no real basis for continuing.
We should talk less, and say more.

Paranoia
Registered User
Posts: 4
Joined: Mon Nov 04, 2002 7:49 am

Re: PM Problem (notification e-mail repeats over and over)

Post by Paranoia » Thu Jul 10, 2008 3:25 am

This topic is pretty old now that I read everything.
However if the hints of deleting the queue file works then my problem is solved.
I have not changed any permissions. But if the problem comes back then i'll check the permissions.

My setup is fresh.
No bad emails.
No mass email was sent.

However I was playing with the report a post things.
And I check the box to send me an email on the status of the reported post.
Then as the admin Deleted the post. I got the email over and over and over about how and administrator deleted the report.

I did purge the cache playing with stuff.
I am pretty sure I purged the cache to fix the problem.
I have check ALL logs. SMTP, IIS, FORUM, even logs from my event Viewer.
I changed PHP settings, rebooted the computer, changed administrator email settings, the method which the emails are sent.

I wouldn't surprize me that its a permission setting.
Seems like when something goes wrong its a permission setting.

What I don't understand is as the cache file is being written, however not deleted.
Wouldn't the file continue to get bigger and bigger as more emails are added to the queue.
Would start out as the begging of the list and then eventually everyone is getting spammed with repeaded emails?

I do have to admit I like the PANIC PURGE ideal :D

As I wrap this up and shuddup.
What should the proper permissions be set to as far as the cache folder is concerned.
My os is Windows2k3 so 777 don't make sence to me lol.

User avatar
jimdunn
Registered User
Posts: 1570
Joined: Tue Mar 25, 2008 11:49 am
Location: Australia

Re: PM Problem (notification e-mail repeats over and over)

Post by jimdunn » Thu Jul 10, 2008 4:44 am

You need READ, WRITE + MODIFY permissions on the directory, and I think DELETE too, in Windows.
You may need to drill into ADVANCED to find the permission to delete files and subdirectories.

I think the normal equivalent of 777 on Windows is just to give the local IUSER Full Control of the directory.

keelobyte
Registered User
Posts: 6
Joined: Thu Jun 19, 2008 1:37 am

Re: PM Problem (notification e-mail repeats over and over)

Post by keelobyte » Fri Sep 12, 2008 2:30 am

Guys,

I've read this and other topics on this problem start to finish, and can perhaps provide some clarity for users who are experiencing this problem.

In my case (PHPBB3.0.2 running on a Win Server 2003 box), it was my mis-configuration of the permissions that was to blame.

At first glance, everything seemed right - the "Internet Guest Account" user had "Read & Execute", "List folder contents", "read" and "write" permissions ticked, yet I was still getting the problem of duplicate emails sent to users periodically.

After reading this and other forums, I've realised the vital missing link is the "modify" permission - I hadn't ticked that.

Since doing so, all is well.

It's worth noting I have RDP access (ie, I can Remote Desktop into the server) and thus I am talking about the actual Windows permissions module. I have no idea about Plesk or any of the other server management tools mentioned.

User avatar
jimdunn
Registered User
Posts: 1570
Joined: Tue Mar 25, 2008 11:49 am
Location: Australia

Re: PM Problem (notification e-mail repeats over and over)

Post by jimdunn » Fri Sep 12, 2008 3:22 pm

keelobyte wrote:Guys,

I've read this and other topics on this problem start to finish, and can perhaps provide some clarity for users who are experiencing this problem.

In my case (PHPBB3.0.2 running on a Win Server 2003 box), it was my mis-configuration of the permissions that was to blame.

At first glance, everything seemed right - the "Internet Guest Account" user had "Read & Execute", "List folder contents", "read" and "write" permissions ticked, yet I was still getting the problem of duplicate emails sent to users periodically.

After reading this and other forums, I've realised the vital missing link is the "modify" permission - I hadn't ticked that.

Since doing so, all is well.

It's worth noting I have RDP access (ie, I can Remote Desktop into the server) and thus I am talking about the actual Windows permissions module. I have no idea about Plesk or any of the other server management tools mentioned.
Yes.

You need to give full permissions to the cache directory to avoid this issue, I think.

Locked

Return to “[3.0.x] Support Forum”