Page MenuHomePhabricator

wikiviewstats rapidly fills error.log
Closed, ResolvedPublic


The error log at /data/project/wikiviewstats/error.log is growing constantly and has reached 25 GByte now. It is filled with entries like:

PHP Notice:  Undefined variable: prid in /data/project/wikiviewstats/wvs_modules/Core.php on line 994
PHP Stack trace:
PHP   1. {main}() /data/project/wikiviewstats/public_html/api.php:0
PHP   2. wvs::get_stats_day() /data/project/wikiviewstats/public_html/api.php:85


PHP Warning:  Cannot modify header information - headers already sent by (output started at /data/project/wikiviewstats/wvs_modules/Core.php:994) in /data/project/wikiviewstats/public_html/api.php on line 210
PHP Stack trace:
PHP   1. {main}() /data/project/wikiviewstats/public_html/api.php:0
PHP   2. header() /data/project/wikiviewstats/public_html/api.php:210

Unfortunately, I don't understand the code well enough to fix this.

Event Timeline

scfc created this task.May 27 2015, 10:43 PM
scfc raised the priority of this task from to Needs Triage.
scfc updated the task description. (Show Details)
scfc added a project: XTools.
scfc added a subscriber: scfc.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 27 2015, 10:43 PM
Andyrom75 set Security to None.Jun 13 2015, 9:50 AM
Andyrom75 added subscribers: Technical13, coren.
valhallasw added a subscriber: valhallasw.EditedJun 13 2015, 10:46 AM

php.ini contains

log_errors = On

which is why this is logged to stderr. I think these warnings don't pass through SGE, but are directly written by lighttpd.

Of couse, fixing the warnings would be preferrable, but we can take a look at this for a stopgap solution. Simply removing error.log will also solve the issue until the next webservice restart.

I agree with valhallasw. If no one is currently take care about the log error file, it's better to turn it off, as a temporary patch. Once the cause of the rows written in it has been found and corrected, it could be turn on again.

The webservice was stopped a couple days ago until it can be worked on by someone.

Technical13 triaged this task as Normal priority.Jun 23 2015, 5:44 PM

When I said "turn it off" I was referring to the error log feature, not the whole application.
Can the application be turned on without the error log feature? If not, can the error.log be deleted with an high frequency, in order to mitigate its quick dimension increase (until the problem is completely solved)?

scfc added a comment.Aug 5 2015, 9:32 AM

Deleted files that other processes still write to are not removed from the file system until those other processes close them, so deleting error.log is not a solution (unless we restart the web service every time as well).

scfc added a comment.Aug 5 2015, 10:15 AM

If I understand the code flow correctly, it connects to s7.labsdb's meta_p and then tries to query the tables projectmap and pagemap there which don't exist, but they exist in p50380g50769__wvs2ds. That database however is only referenced in ~tools.wikiviewstats/wvs_modules/Init.php as a constant WVS_DATABASE, but this constant is never used.

I will add an abort to the code that instead of doing nothing useful, it will exit with a 500 server error, and then restart the web service.

scfc closed this task as Resolved.Aug 5 2015, 11:04 AM
scfc claimed this task.

I have added an abort in another place, restarted the web service and error.log has been quiet for ten minutes, so this task is resolved. (That the tool was and is broken at least in those code flows is another matter.)

scfc, is it normal the message "Internal error
The URI you have requested, /wikiviewstats/, appears to be non-functional at this time." that I see when I try to access to the wikiviewstats tool?

scfc added a comment.Aug 5 2015, 5:53 PM

@Andyrom75: I changed code paths where previously wrong information was returned to now failing ("internal error"). If you mean that previously returned a "construction site" notice ("We apologize for this downtime, but are working diligently to get this tool back up and running correctly as soon as is reasonably possible. Thanks for your support!") and now fails then that is due to even this page hitting those code paths.

As this information was obviously false ("working diligently" :-)), I won't try to restore that message, but if one of the maintainers of wikiviewstats or XTools wants to fix it, great.

my question now is: is it possible to restore the tool Wikiviewstats?
My main purpose is to use it :-)

scfc added a comment.Aug 5 2015, 10:00 PM

It is broken at the moment and it needs someone to fix it. If you know PHP or know someone who does and wants to maintain the tool, you can ask one of the current maintainers of wikiviewstats (cf. to add you to the maintainer list which will give you all the access you need.

But: The whole XTools infrastructure is scattered over various Toolforge tools and a Cloud-Services project and – AFAIUI – no longer actively maintained. So before investing too much effort into fixing wikiviewstats, I would look into how it fits in with the other tools and what is the best way to achieve the wanted functionality.

scfc, thanks for the clarification.
What I (and I suppose many other users) want is to have a tool that will allow to easily see which are the most visited pages of any project in a visual way. AFAIK wikiviewstats is the best one.
Currently the tool mostly used that perform a similar job is that has several limitation and bugs never fixed.

Regarding Wikiviewstats, few months ago it has been turned on, and then shutted down because of the huge dimension of the error.log, but if you have disabled the error log functionality, Wikiviewstats should be turned on again.

scfc added a comment.Aug 6 2015, 2:35 PM

That's not true. wikiviewstats is dysfunctional at the moment and has been for some time, and that has no connection with error.log. It tries to access a database that does not exist. wikiviewstats is "turned on" at the moment, but until someone fixes those data issues, it will not work. It was never shut down due to its large error.log or (AFAIK) for any other reason.

*sigh* I had completely stopped the webservice because this tool wasn't working. There is no reason to start it back up until it is fixed. If you leave it stopped until then, it won't fill any error logs...

Instead of stopping the webservice, please create a landing page stating the tool is broken (or move public_html). If a webservice is stopped and someone complains about this on irc, we restart the webservice. I think that's a reasonable approach, although it did not give the intended effect here.

scfc added a comment.Aug 6 2015, 3:06 PM

@Technical13: It was running a web service when I looked at it yesterday. I have now stopped the web service with webservice stop.

This is a stupid question, but I honestly don't know the answer. What did wikistatsview do? I don't think I ever actually used it. Was it a traffic report service, e.g. how many page views?

who ever has access to the files, could T108058 be fixed so that others can also help

MusikAnimal: this tool shows with (any timeframe) the most accessed pages on a project in a very friendly visual and multilingual interface. This helps a lot to understand the trend of the moment and gives clues (specially for the minor sister project) on which are the pages that should be improved or created (because popular on other languages).

MusikAnimal moved this task from Inbox to Complete on the XTools board.Jul 23 2017, 7:47 PM