News:

Wondering if this will always be free?  See why free is better.

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

Server is logging these errors in bursts -



[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?

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Illori

i dont believe we have ever figured this one out. you can search the forum for other topics related to this.

GigaWatt

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?"..."

Sir Osis of Liver

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 -



/// 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.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

richardwbb

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.

Sir Osis of Liver

Subs-Post.php



// 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 :-\





// 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.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

shawnb61

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

Illori

Quote from: shawnb61 on March 10, 2018, 01:00:33 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.

Sir Osis of Liver

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.



[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


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Aleksi "Lex" Kilpinen

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.
Slava
Ukraini!


"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

How you can help SMF

Sir Osis of Liver

Errors seem to be random.  This is the log for past 24 hours -



[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 -



// 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.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

shawnb61

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

Sir Osis of Liver

Are you seeing these errors on your installs?  I've been unable to replicate the problem.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

shawnb61

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

Illori

do you have the send birthday email scheduled task enabled? i believe this was determined to be related to that.

shawnb61

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

Sir Osis of Liver

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.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Illori

if you search this forum you will find it is caused by the scheduled tasks. each forum has those run at different times.

Sir Osis of Liver

Doesn't happen on any of my installs, is it server related?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Illori

we dont know. all that i can recall is it is related to the birthday email that is sent out.

Advertisement: