News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Subs-Post.php server errors

Started by Sir Osis of Liver, March 02, 2018, 01:02:16 PM

Previous topic - Next topic

Sir Osis of Liver

Just ran it manually, received birthday email, no errors.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Illori

then no one had a birthday for it to send an email.

Sir Osis of Liver

I set birth date to today, ran task, received email.  I have it set to run automatically tomorrow, will see what happens.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

shawnb61

#23
I can reproduce the "utf8" and "server" ones at will.  These two can be generated from the daily digest. 

The basic problem is that when run via the call to AutoTask() in index.php ~L88, $context variables aren't set yet because it is so early in index.php.  We haven't loaded user or theme stuff.  Also, our normal error handler isn't yet set, that also comes later in index.php. 

So, we have no error handler and we have no $context.  Hence the odd messages & odd error logging location. 

During the daily digest's call to sendmail, $context['server'] is referenced, that generates the "undefined index: server" message. 

The utf8 errors come later when it thinks the email addresses need the "hotmail fix".  Same thing - $context isn't set.  So it gets set only when trying to send emails to att/comcast/bellsouth addresses.  That's why those are more sporadic. 

The scheduled tasks know stuff is missing, and there is a function to LoadEssentialThemeData() that attempts to fill in some of the blanks.  Maybe we need a LoadMinimalContext() as well to fill in the other missing stuff for scheduled tasks. 

This will not happen when you run a task from the maint menu, because as a user, index.php has loaded all of the user info, theme info & the error handler. 

I imagine each of the auto-scheduled tasks may have its own set of needed/missing $context variables. 

EDIT:  To fix the error logging part of this issue, we need to move the error handler before the call to AutoTask(). 
EDIT2: The hotmail thing isn't just used for hotmail/att/comcast/bellsouth addresses, it's more involved than that... 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

And...  I see this has been discussed frequently before.  But known & fixed in 2.1.   Not likely fixed in 2.0.

One reference:
https://www.simplemachines.org/community/index.php?topic=517547.msg3748605#msg3748605
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Sir Osis of Liver

It seems to be at least somewhat server related.  Received a birthday email overnight from 2.0.15 test install, no errors.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: