Advertisement:

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

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 8,392
  • Riding the endless highway in the sky.
Subs-Post.php server errors
« on: March 02, 2018, 01:02:16 PM »
Server is logging these errors in bursts -

Code: [Select]

[01-Mar-2018 16:00:35 US/Pacific] PHP Notice:  Undefined index: server in  /Sources/Subs-Post.php on line 627
[01-Mar-2018 16:00:35 US/Pacific] PHP Notice:  Undefined index: utf8 in  /Sources/Subs-Post.php on line 1262
[01-Mar-2018 16:00:35 US/Pacific] PHP Notice:  Undefined index: utf8 in  /Sources/Subs-Post.php on line 1264
[01-Mar-2018 16:00:35 US/Pacific] PHP Notice:  Undefined index: server in  /Sources/Subs-Post.php on line 627
[01-Mar-2018 16:00:35 US/Pacific] PHP Notice:  Undefined index: utf8 in  /Sources/Subs-Post.php on line 1262
[01-Mar-2018 16:00:35 US/Pacific] PHP Notice:  Undefined index: utf8 in  /Sources/Subs-Post.php on line 1264
[01-Mar-2018 16:00:35 US/Pacific] PHP Notice:  Undefined index: server in  /Sources/Subs-Post.php on line 627
[01-Mar-2018 16:00:35 US/Pacific] PHP Notice:  Undefined index: utf8 in  /Sources/Subs-Post.php on line 1262
[01-Mar-2018 16:00:35 US/Pacific] PHP Notice:  Undefined index: utf8 in  /Sources/Subs-Post.php on line 1264
[01-Mar-2018 16:02:05 US/Pacific] PHP Notice:  Undefined index: server in  /Sources/Subs.php on line 820
[01-Mar-2018 16:02:05 US/Pacific] PHP Notice:  Undefined index: server in  /Sources/Subs-Post.php on line 627
[01-Mar-2018 16:02:05 US/Pacific] PHP Notice:  Undefined index: character_set in  /Sources/Subs-Post.php on line 1219
[01-Mar-2018 16:02:05 US/Pacific] PHP Notice:  Undefined index: character_set in  /Sources/Subs-Post.php on line 1219
[01-Mar-2018 16:02:05 US/Pacific] PHP Notice:  Undefined index: character_set in  /Sources/Subs-Post.php on line 1219
[01-Mar-2018 16:02:05 US/Pacific] PHP Notice:  Undefined index: utf8 in  /Sources/Subs-Post.php on line 1262
[01-Mar-2018 16:02:05 US/Pacific] PHP Notice:  Undefined index: utf8 in  /Sources/Subs-Post.php on line 1264
[01-Mar-2018 16:02:05 US/Pacific] PHP Notice:  Undefined index: character_set in  /Sources/Subs-Post.php on line 1219


As you can see, they all occurred in a minute and a half, no other errors for past 24 hours.  What can cause this?


Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 50,090
Re: Subs-Post.php server errors
« Reply #1 on: March 02, 2018, 01:19:50 PM »
i dont believe we have ever figured this one out. you can search the forum for other topics related to this.

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,456
  • Gender: Male
    • Macedonian electronics forum
Re: Subs-Post.php server errors
« Reply #2 on: March 02, 2018, 08:17:18 PM »
Based on the errors... maybe related to the database character set encoding options ???.... UTF-8 vs. ANSII ???.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 8,392
  • Riding the endless highway in the sky.
Re: Subs-Post.php server errors
« Reply #3 on: March 02, 2018, 10:54:23 PM »
I've seen some of these errors on another forum, they don't appear in forum error log, only server log.  Fudged them on the other forum, nothing bad happened -

Code: [Select]

/// Fix undefined index error
if (!isset ($context['utf8']))
$context['utf8'] = '';


/// Fix undefined index error
if (!isset ($context['server']['is_windows']))
$context['server']['is_windows'] = '';


Think I'll do the same here.  I've downgraded php 7.0.27 -> 5.6.33, will let it run for a while before changing anything, see if errors are reduced.


Offline richardwbb

  • Jr. Member
  • **
  • Posts: 310
  • currently reading; '$smcFunc'
Re: Subs-Post.php server errors
« Reply #4 on: March 09, 2018, 03:41:40 PM »
Where is that code put Sir Osis of Liver? Would that work within index.php all of SMF?
If my post in this topic looks ambiguous to you, then I'm with Murphy's law and General Stupidity. In other words, trial and error.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 8,392
  • Riding the endless highway in the sky.
Re: Subs-Post.php server errors
« Reply #5 on: March 09, 2018, 09:08:53 PM »
Subs-Post.php

Code: [Select]

// Unicode, baby.
$charset = 'UTF-8';
}
}

/// Fix undefined index error
if (!isset ($context['utf8']))
$context['utf8'] = '';

// Convert all special characters to HTML entities...just for Hotmail :-\


Code: [Select]

// Use sendmail if it's set or if no SMTP server is set.
$use_sendmail = empty($modSettings['mail_type']) || $modSettings['smtp_host'] == '';


/// Fix undefined index error
if (!isset ($context['server']['is_windows']))
$context['server']['is_windows'] = '';

// Line breaks need to be \r\n only in windows or for SMTP.


There are others in other source files that I haven't bothered with.  Errors are not logged in forum error log, and don't seem to cause any problems, but you should be able to use the same hack for any of them.


Offline shawnb61

  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,005
    • sbulen on GitHub
Re: Subs-Post.php server errors
« Reply #6 on: March 10, 2018, 01:00:33 AM »
I have seen these same errors - also posted in the unusual error log.  This makes me think they are not app errors, but something posted outside normal app processing (because the smf error handler isn't invoked), e.g., from cron.php or proxy.php (I don't use ssi.php).  But I believe these errors existed before the proxy... So my suspicion is cron.php (or ssi.php) somehow is invoking something without the environment setup...   Haven't nailed it down yet. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 50,090
Re: Subs-Post.php server errors
« Reply #7 on: March 10, 2018, 06:04:46 AM »
So my suspicion is cron.php (or ssi.php) somehow is invoking something without the environment setup...   Haven't nailed it down yet. 

cant be cron.php as SMF 2.0 does not have cron.php.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 8,392
  • Riding the endless highway in the sky.
Re: Subs-Post.php server errors
« Reply #8 on: March 10, 2018, 04:34:38 PM »
Odd thing is, the errors occur in bursts.  In the following log, you can see approx. 80 errors with same timestamp.  This was the entire errorlog for approx. 12 hours on a busy forum.  There have been no errors logged in past 18 hours.

Code: [Select]

[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: is_admin in  /Sources/Security.php on line 824
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: is_admin in  /Sources/Security.php on line 824
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: is_admin in  /Sources/Security.php on line 824
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: is_admin in  /Sources/Security.php on line 824
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: is_guest in  /Sources/Load.php on line 1580
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: mod_cache in  /Sources/Load.php on line 1585
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: username in  /Sources/Load.php on line 1586
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: language in  /Sources/Load.php on line 1587
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: email in  /Sources/Load.php on line 1588
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: ignoreusers in  /Sources/Load.php on line 1589
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: name in  /Sources/Load.php on line 1592
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: smiley_set in  /Sources/Load.php on line 1597
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: smiley_set in  /Sources/Load.php on line 1597
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined variable: _SESSION in  /Sources/Load.php on line 1613
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined variable: _SESSION in  /Sources/Load.php on line 1614
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  array_unshift() expects parameter 1 to be array, null given in  /Sources/Load.php on line 1647
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Use of undefined constant WIRELESS - assumed 'WIRELESS' in  /Sources/Load.php on line 1663
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Use of undefined constant WIRELESS_PROTOCOL - assumed 'WIRELESS_PROTOCOL' in  /Sources/Load.php on line 1665
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: language in  /Sources/Load.php on line 1756
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: time_offset in  /Sources/Subs.php on line 756
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: time_format in  /Sources/Subs.php on line 795
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Use of undefined constant WIRELESS - assumed 'WIRELESS' in  /Sources/Subs.php on line 901
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: avatar in  /Sources/Subs.php on line 3264
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: avatar in  /Sources/Subs.php on line 3267
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: avatar in  /Sources/Subs.php on line 3267
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: avatar in  /Sources/Subs.php on line 3283
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: total_time_logged_in in  /Sources/Subs.php on line 3291
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: total_time_logged_in in  /Sources/Subs.php on line 3292
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: total_time_logged_in in  /Sources/Subs.php on line 3293
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 834
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  array_intersect(): Argument #2 is not an array in  /Sources/Security.php on line 834
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 834
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  array_intersect(): Argument #2 is not an array in  /Sources/Security.php on line 834
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: groups in  /Sources/Subs.php on line 3960
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  implode(): Invalid arguments passed in  /Sources/Subs.php on line 3960
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: language in  /Sources/Subs.php on line 3960
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 834
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  array_intersect(): Argument #2 is not an array in  /Sources/Security.php on line 834
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 834
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  array_intersect(): Argument #2 is not an array in  /Sources/Security.php on line 834
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Notice:  Undefined index: permissions in  /Sources/Security.php on line 831
[09-Mar-2018 13:55:03 US/Pacific] PHP Warning:  in_array() expects parameter 2 to be array, null given in  /Sources/Security.php on line 831
[09-Mar-2018 16:04:39 US/Pacific] PHP Notice:  Undefined index: server in  /Sources/Subs-Post.php on line 627
[09-Mar-2018 16:04:39 US/Pacific] PHP Notice:  Undefined index: server in  /Sources/Subs-Post.php on line 627
[09-Mar-2018 16:04:39 US/Pacific] PHP Notice:  Undefined index: server in  /Sources/Subs-Post.php on line 627


Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 17,576
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
Re: Subs-Post.php server errors
« Reply #9 on: March 11, 2018, 03:24:54 AM »
That does sound odd, have you taken a look at what those lines mentioned are actually about?
I mean, there are other files mentioned as well - there must be some connection.
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.

How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 8,392
  • Riding the endless highway in the sky.
Re: Subs-Post.php server errors
« Reply #10 on: March 11, 2018, 11:29:04 PM »
Errors seem to be random.  This is the log for past 24 hours -

Code: [Select]

[10-Mar-2018 16:00:27 US/Pacific] PHP Notice:  Undefined index: server in  /Sources/Subs-Post.php on line 627
[10-Mar-2018 16:00:27 US/Pacific] PHP Notice:  Undefined index: server in  /Sources/Subs-Post.php on line 627
[10-Mar-2018 16:00:27 US/Pacific] PHP Notice:  Undefined index: server in  /Sources/Subs-Post.php on line 627
[11-Mar-2018 17:00:06 US/Pacific] PHP Notice:  Undefined index: server in  /Sources/Subs-Post.php on line 627
[11-Mar-2018 17:00:06 US/Pacific] PHP Notice:  Undefined index: server in  /Sources/Subs-Post.php on line 627
[11-Mar-2018 17:00:06 US/Pacific] PHP Notice:  Undefined index: server in  /Sources/Subs-Post.php on line 627


It's core code -

Code: [Select]

// Line breaks need to be \r\n only in windows or for SMTP.
$line_break = $context['server']['is_windows'] || !$use_sendmail ? "\r\n" : "\n";


Best guess it's server related, but no clue what causes the errors.  I've seen it on other forums, never on mine.


Offline shawnb61

  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,005
    • sbulen on GitHub
Re: Subs-Post.php server errors
« Reply #11 on: March 12, 2018, 12:40:06 AM »
Doesn't look random to me...   The daily time corresponds to a few of my daily scheduled tasks. 

I just staggered the start times of all my scheduled tasks by a few minutes, to make it painfully obvious which one is the culprit...   Now to wait a day.   ::)

My theory is that some of the batch code assumes it has a full environment... 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 8,392
  • Riding the endless highway in the sky.
Re: Subs-Post.php server errors
« Reply #12 on: March 12, 2018, 12:41:14 AM »
Are you seeing these errors on your installs?  I've been unable to replicate the problem.

Offline shawnb61

  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,005
    • sbulen on GitHub
Re: Subs-Post.php server errors
« Reply #13 on: March 12, 2018, 12:42:30 AM »
Yes, I am seeing it on my main forum.  I suspect a mod.  Will know more tomorrow. 

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 50,090
Re: Subs-Post.php server errors
« Reply #14 on: March 12, 2018, 05:08:32 AM »
do you have the send birthday email scheduled task enabled? i believe this was determined to be related to that.

Offline shawnb61

  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,005
    • sbulen on GitHub
Re: Subs-Post.php server errors
« Reply #15 on: March 12, 2018, 07:14:53 AM »
I believe it is the daily notification summary.   Now tp look at that a little deeper...
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 8,392
  • Riding the endless highway in the sky.
Re: Subs-Post.php server errors
« Reply #16 on: March 12, 2018, 12:52:29 PM »
The errors vary, at different times and on different forums.  Core scheduled tasks wouldn't be causing it, so it must be mods, or non-default core tasks.

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 50,090
Re: Subs-Post.php server errors
« Reply #17 on: March 12, 2018, 12:56:28 PM »
if you search this forum you will find it is caused by the scheduled tasks. each forum has those run at different times.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 8,392
  • Riding the endless highway in the sky.
Re: Subs-Post.php server errors
« Reply #18 on: March 12, 2018, 01:08:35 PM »
Doesn't happen on any of my installs, is it server related?

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 50,090
Re: Subs-Post.php server errors
« Reply #19 on: March 12, 2018, 01:12:38 PM »
we dont know. all that i can recall is it is related to the birthday email that is sent out.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 8,392
  • Riding the endless highway in the sky.
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 Legend
  • *
  • Posts: 50,090
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: 8,392
  • Riding the endless highway in the sky.
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
  • Sophist Member
  • *
  • Posts: 1,005
    • 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
  • Sophist Member
  • *
  • Posts: 1,005
    • 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: 8,392
  • Riding the endless highway in the sky.
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.