Error Log Files

Hier können Probleme und alles andere in Deutscher Sprache gelöst werden.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Error Log Files

Post by garvinhicking »

Hi!

Hm, eine weiße Seite würde einen fatalen Fehler bedeuten. Hast Du mal in dein PHP Errorlog geguckt ob da dann eine Ferhlemeldung auftritt?

Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
milos27
Regular
Posts: 154
Joined: Sun Jul 06, 2008 8:31 pm
Contact:

Re: Error Log Files

Post by milos27 »

Soeben ausprobiert und Seite wie bereits beim ersten mal bleibt weiß ohne Inhalt ...

Die error logfile gibt in dieser Zeit keine Meldung aus ...

Problem weiterhin ungelöst :-(
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Error Log Files

Post by garvinhicking »

Hi!

Hm, weiße Seite kann wirklich nur Fatal ERror bedeuten, der in deinem Fall evtl unterdrückt wird.

Hast Du von Don evtl was gehört ob es ein Kinetic-Update gibt? Ansonsten kanni ch Dir nur anbieten mir deine Zugangsdaten zu schicken, und ich gucke mir das auf dem Server mal an...

Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
milos27
Regular
Posts: 154
Joined: Sun Jul 06, 2008 8:31 pm
Contact:

Re: Error Log Files

Post by milos27 »

Don ist bereits dran und hoffe er findet den Fehler.

***DON
I think I discovered WHAT is responsible for the error, but next I need to determine WHY.
***

Danke schon mal für deine Hilfe evtl. komme ich nochmals drauf zurück...
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Error Log Files

Post by Don Chambers »

Hey guys. Do you object to changing this thread to English? I really want to help, but I do not speak German, though I sincerely wish I did!
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Error Log Files

Post by garvinhicking »

Don Chambers wrote:Hey guys. Do you object to changing this thread to English? I really want to help, but I do not speak German, though I sincerely wish I did!
No problem with me of course :)
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Error Log Files

Post by Don Chambers »

The error is this:
PHP Warning: sprintf() [[a href='function.sprintf']function.sprintf[/a]]: Too few arguments in /PATH/bundled-libs/Smarty/libs/plugins/modifier.string_format.php on line 24
line 24 of modifier.string_format.php is as follows:

Code: Select all

    return sprintf($format, $string);
In fact, other than comments, the entire file modifier.string_format.php is just this single function:

Code: Select all

function smarty_modifier_string_format($string, $format)
{
    return sprintf($format, $string);
}
The template has a function that converts elapsed time since an entry was modified to words. ie, instead of saying an entry was modified 70 minutes ago, it will say "about an hour ago". This is emitted with this code:

Code: Select all

        return (sprintf(ELAPSED_HOURS_AGO, round(floatval($distanceInMinutes) / 60.0)));
=Don=
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Error Log Files

Post by Timbalu »

As it is a PHP Warning you have two choices:
Either no Constant ELAPSED_HOURS_AGO or no $distanceInMinutes Variable set. In favour the last.
In Smarty, modifiers have higher priority than multiplication, so we have to use parenthesis to execute math first. Maybe you could try that there too...

Code: Select all

return (sprintf(ELAPSED_HOURS_AGO, (round(floatval($distanceInMinutes) / 60.0))));
or check if $distanceInMinutes is set and if is >= 61...
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Error Log Files

Post by Don Chambers »

@define('ELAPSED_HOURS_AGO','%s hours ago');
$distanceInMinutes = round($distanceInSeconds / 60)

The function works the way its supposed to. This is in config.inc.php, not a smarty template, but I will try the additional set of parenthesis.
=Don=
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Error Log Files

Post by Timbalu »

Yes I know.
But is seems (in special cases) % isn't set, so you have to check if it is set (more than 60 minutes) else use a default value.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Error Log Files

Post by Don Chambers »

I don't think this function is the source of the error afterall. I found the same error on one of the servers I have. That server has two domains... one is a live site with good traffic, the other is just a sandbox.

I have NOT modified the code yet. I cannot reproduce the error at all on the test site, no matter what pages I go to. On the live site, I do see the error in the error log several times per day, but in the past hour, I have not been able to trigger it myself even after well over a hundred page views.

The last time this error showed was about 2 hours ago:

Code: Select all

[Wed Oct 17 11:52:01 2012] [error] [client 66.249.73.245] PHP Warning:  sprintf(): Too few arguments in /var/www/vhosts/PATH/bundled-libs/Smarty/libs/plugins/modifier.string_format.php on line 24
At the exact time of that error message, my access log shows this line for the same IP address, which is a request to url that does not exist.

Code: Select all

66.249.73.245 - - [17/Oct/2012:11:52:01 -0500] "GET /top%20headlines.html HTTP/1.1" 404 37268
This one is likewise an invalid url, and produced the same error

Code: Select all

157.55.35.40 - - [17/Oct/2012:02:10:14 -0500] "GET /view/full_story/218667/article-It%E2%80%99s-a-boy-Barlow- HTTP/1.1" 404 37310
When I try these bad urls, I can trigger the error. If I try to navigate to a simple http://www.domain/don.html, it does not log an error. The error only happens when the requested URL contains what looks like escaped characters (%E2%80%99). In all instances, I do get a 404 page generated by the template:

Code: Select all

                {elseif $view=='404'}
                    <div class="serendipity_Entry_Date">
                        <div class="serendipity_overview_noentries">
                            <p class="serendipity_msg_important">{$CONST.ERROR_404}</p>
                            <p><a href="{$serendipityBaseURL}">{$CONST.HOMEPAGE} - {$blogTitle}</a></p>
                        </div>
                    </div>
I tried the two bad urls above on my test site. The first did not log any error. The second (/view/full_story/218667/article-It%E2%80%99s-a-boy-Barlow-), produced just this error:

Code: Select all

File does not exist: /var/www/vhosts/sandbox/view
Interesting to note that in my two errors above, the ip address of the first is googlebot, and the ip address of the second is msnbot. So, any ideas?
=Don=
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Error Log Files

Post by Timbalu »

U+2019 ’ e2 80 99 RIGHT SINGLE QUOTATION MARK
why not
U+0027 ' 27 APOSTROPHE
?

Mysterious... As I noted on page 1, it remembered me to a problem we had some time ago. There a wrong smarty modifier use did produce the same error, when getting (search) request like that. On page 3 in that thread I wrote about the solution, likewise in english. Maybe that will get you a hint where to search for... There we had to change |sprintf with |replace.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Error Log Files

Post by garvinhicking »

Hi!

Is this error reproducible with the default template? If so, we could use that as a starting point to put in the kinetic files one by one to see which error happens?

I think that in some place inside a tpl file a sprintf modifier must be called with an argument or string that comes from the URL page request, and thus contains the bad "%..." sequence. This %... sequence triggers a sprintf modifier, and this triggers the error.

Say if some config.inc.php puts $_SERVER['REQUEST_URI'] into a value like {$url}, and then at some point {$url|@sprintf:CONSTANT} is used, it would trigger such an error...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Error Log Files

Post by Don Chambers »

I can reproduce the error on the live site. However, on the sandbox site, I can trigger an error, but it is a different error.

For example, I saw the smarty error on the live site, and the corresponding IP address and time stamp had this in the access log:

Code: Select all

"GET /view/full_story/10348231/article-Sheriff%E2%80%99s-department-has-extremely-busy-week?instance=special_coverage_bullets_right_column
When I type in that path into my sandbox, I get two lines in my access log:

Code: Select all

"GET /view/full_story/10348231/article-Sheriff%E2%80%99s-department-has-extremely-busy-week?instance=special_coverage_bullets_right_column HTTP/1.1" 404 12615
GET /view/full_story/10348231/article-Sheriff%E2%80%99s-department-has-extremely-busy-week/P2.html HTTP/1.1" 404 12618
But I do not get a smarty error, I get this error instead:

Code: Select all

File does not exist: /var/www/vhosts/sandbox/view
I get this error with Kinetic, or bulletproof. I am not sure why one domain gets the smarty error, and the other does not.
=Don=
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Error Log Files

Post by Don Chambers »

Getting more complicated. Have a second sandbox site. When using the path in my message above

Code: Select all

/view/full_story/10348231/article-Sheriff%E2%80%99s-department-has-extremely-busy-week?instance=special_coverage_bullets_right_column
This site gets BOTH errors when using kinetic:

Code: Select all

File does not exist: /var/www/vhosts/sandbox2/view
PHP Warning:  sprintf(): Too few arguments in /var/www/vhosts/sandbox2/bundled-libs/Smarty/libs/plugins/modifier.string_format.php on line 24
But only one when using bulletproof:

Code: Select all

File does not exist: /var/www/vhosts/sandbox2/view
=Don=
Post Reply