Advertisement:

Author Topic: Subs-Post.php server errors  (Read 1187 times)

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,799
  • There's someone in my head but it's not me.
Re: Subs-Post.php server errors
« Reply #20 on: March 12, 2018, 01:21:07 PM »
Just ran it manually, received birthday email, no errors.

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 49,239
Re: Subs-Post.php server errors
« Reply #21 on: March 12, 2018, 01:22:05 PM »
then no one had a birthday for it to send an email.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,799
  • There's someone in my head but it's not me.
Re: Subs-Post.php server errors
« Reply #22 on: March 12, 2018, 01:23:55 PM »
I set birth date to today, ran task, received email.  I have it set to run automatically tomorrow, will see what happens.

Offline shawnb61

  • Support Specialist
  • Sr. Member
  • *
  • Posts: 761
    • sbulen on GitHub
Re: Subs-Post.php server errors
« Reply #23 on: March 12, 2018, 11:56:11 PM »
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... 
« Last Edit: March 13, 2018, 12:31:14 AM by shawnb61 »
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline shawnb61

  • Support Specialist
  • Sr. Member
  • *
  • Posts: 761
    • sbulen on GitHub
Re: Subs-Post.php server errors
« Reply #24 on: March 13, 2018, 11:22:48 AM »
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

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,799
  • There's someone in my head but it's not me.
Re: Subs-Post.php server errors
« Reply #25 on: March 13, 2018, 05:09:28 PM »
It seems to be at least somewhat server related.  Received a birthday email overnight from 2.0.15 test install, no errors.