Unable to delete logs from Web or from command line

You need additional help with phplogcon, then write into this forum.

Unable to delete logs from Web or from command line

Postby fabio.emidi » Mon Apr 27, 2009 2:59 pm

Hello,
I just finished installing phplogcon, rsyslog, mysql and apache, in order to build a Log Server.
Everything seems to work fine, except for the functionality of deleting records.
If I try to do it via Web, I get the error:

"Could not delete data in the '1' source".

If I try to use command line "php maintenance.php cleandata 1 olderthan xxxxx", there is no error, but nothing is deleted.

Here some specs:

OS: Debian 2.6.26 i386
apache: 2.2.9
mysql: 5.0.51a
rsyslog: 3.18.6-4
phplogcon: 2.6.2

thanx.
fabio.emidi
New
 
Posts: 8
Joined: Mon Apr 27, 2009 2:45 pm

phpLogCon professional services

  • Custom phpLogCon configuration?
  • Maintenance Contract?
  • Installation support?

Re: Unable to delete logs from Web or from command line

Postby alorbach » Mon Apr 27, 2009 3:06 pm

Hi,

have you tried to remove the "Clear all data" option as well?
Maybe the data is not old enough, so nothign gets deleted.

Try to enable the option "Show Debug messages" in preferences, you may see additional debug informations then.

best regards,
Andre Lorbach
User avatar
alorbach
Site Admin
 
Posts: 1180
Joined: Thu Feb 13, 2003 11:55 am

Re: Unable to delete logs from Web or from command line

Postby fabio.emidi » Tue Apr 28, 2009 8:35 am

Hello, thanx for the quick answer. I tried all of your suggestions but it is the same.
Any one of three choices for deletion (all data, all data older than..., all data before xxxx) give the same error.
I enabled debug logging from the web management page, but I coul not see any debug message, nor in syslog neither in apache's log.

Any other idea? Could it be an issue related to user's permissions? My apache demon is running as 'www-data' user, mysql has 'mysql' user and rsyslog as 'root'. I did not do any customization, so these are default parameters. The curious fact is that the program, except for the deletion of records, seems to work fine; it receives and displays all logs, local and remote ones, can do queries, etc.

I tried to examine the documentation available from the official site of phplogcon, but it seemed to me that there isn't a real in-depth manual of the product. Can you tell me if it is possible to find one, and where ? I mean, kind of a manual that explains deep functionality of phplogcon, maybe with references on how it interacts with rsyslog, mysql tables, apache and so on...

Bye. :oops:
fabio.emidi
New
 
Posts: 8
Joined: Mon Apr 27, 2009 2:45 pm

Re: Unable to delete logs from Web or from command line

Postby rgerhards » Tue Apr 28, 2009 8:44 am

fabio.emidi wrote:I tried to examine the documentation available from the official site of phplogcon, but it seemed to me that there isn't a real in-depth manual of the product. Can you tell me if it is possible to find one, and where ? I mean, kind of a manual that explains deep functionality of phplogcon, maybe with references on how it interacts with rsyslog, mysql tables, apache and so on...


I can answer only on that part: it is not available, but we happily accept contributions ;)

Rainer
User avatar
rgerhards
Site Admin
 
Posts: 2778
Joined: Thu Feb 13, 2003 11:57 am

Re: Unable to delete logs from Web or from command line

Postby alorbach » Tue Apr 28, 2009 12:29 pm

No it is for sure no permission issue. If you enable debug messages, you will see them at the bottom of each phpLogCon, if there are any.
Please try phpLogCon 2.7.0 as well, kindly copy the new files over your existing installation in order to update your installation. You can download 2.7.0 from here: http://www.phplogcon.org/downloads

best regards,
Andre Lorbach
User avatar
alorbach
Site Admin
 
Posts: 1180
Joined: Thu Feb 13, 2003 11:55 am

Re: Unable to delete logs from Web or from command line

Postby fabio.emidi » Wed Apr 29, 2009 8:12 am

Ok, I just finished copying version 2.7.0 of phplogcon to my system. First time I logged in the management page, I was suggested to upgrade database from version 7 to 8, and so I did it. I think everything went ok, but still I get the same message when I try to delete records.

"Could not delete data in the '1' source".

And still no debug messages.

Where do you think I could search for something misconfigured? In config.php? In mysql tables?

Beside, I was wondering if there is a way to schedule a regular (not done by hand) records deletion, say "preserve all logs for 30 days then clear them", or something similar. Thanks. :cry:
fabio.emidi
New
 
Posts: 8
Joined: Mon Apr 27, 2009 2:45 pm

Re: Unable to delete logs from Web or from command line

Postby alorbach » Wed Apr 29, 2009 4:01 pm

Hi,

I will add some more debug output into this area in the next release. Something is going wrong when performing the DELETE sql statement, I just need to output what exactly. Please wait for the next release.

best regards,
Andre Lorbach
User avatar
alorbach
Site Admin
 
Posts: 1180
Joined: Thu Feb 13, 2003 11:55 am

Re: Unable to delete logs from Web or from command line

Postby alorbach » Wed Apr 29, 2009 4:27 pm

Hi again,

please try the new version v2.6.3 (download from here: http://www.phplogcon.org/downloads ), it should output more detailed debug information at the bottom of the page, if the cleanup fails. This will help us troubleshooting here.

best regards,
Andre Lorbach
User avatar
alorbach
Site Admin
 
Posts: 1180
Joined: Thu Feb 13, 2003 11:55 am

Re: Unable to delete logs from Web or from command line

Postby fabio.emidi » Thu Apr 30, 2009 7:48 am

Hello Alorbach, I succesfully installed version 2.6.3. I tried deleting some records but again the program failed with the same message.
The debug output produced was the following (after trying to delete all messages older than 1 minute):

"LogStreamDB|PrintDebugError: CleanupLogdataByDate failed with SQL Statement ' DELETE FROM SystemEvents WHERE UNIX_TIMESTAMP(devicereportedtime) < 1241095080 '
Detail error: DELETE command denied to user 'phplogcon'@'localhost' for table 'SystemEvents'
Error Code: 1142"

So, as far as I understand concerning mysql syntax, the user phplogcon doesn't have DELETE permission for that table. I will wait for your response befor taking any action, but I suppose that if I will manually grant DELETE permission to phplogcon, maybe the problem should be solved.

Thank you again, hope this thime we shall succeed.

:twisted:
fabio.emidi
New
 
Posts: 8
Joined: Mon Apr 27, 2009 2:45 pm

Re: Unable to delete logs from Web or from command line

Postby rgerhards » Thu Apr 30, 2009 8:38 am

I think your conclusion is correct.

Andre: I think it would be useful to integrate this message as part of regular processing, not just debug logging. It makes finding problems much easier. I'd check for the result of the operation and push up the error message on the UI if an error is detected. Do you see any problem in doing so?

Rainer
User avatar
rgerhards
Site Admin
 
Posts: 2778
Joined: Thu Feb 13, 2003 11:57 am

Re: Unable to delete logs from Web or from command line

Postby alorbach » Thu Apr 30, 2009 10:17 am

Code: Select all
Error Code: 1142


That was the thing I was looking for, this error code means: ER_TABLEACCESS_DENIED_ERROR
So it means that access was denied. So the database user you are using is possible not allowed to use the DELETE statement. You should look into the permissions, make sure the database user you are using has full access to the database.

best regards,
Andre Lorbach

@Rainer: It is difficult because the error does happen inside the logstreams, and there is no direct connection between the logstream and the frontend at this point.
User avatar
alorbach
Site Admin
 
Posts: 1180
Joined: Thu Feb 13, 2003 11:55 am

Re: Unable to delete logs from Web or from command line

Postby rgerhards » Thu Apr 30, 2009 10:27 am

Andre, what if we add an "getLastErrorMsg()" method to the logstream calls (just like getlasterror() API call). It could be used to convey more in-depth information. Its content would obviously be netstream driver depenedent and may be blank (in which case we would better not display it ;)).

Does this sound too-complex? I think there is real value in such error messages, just think about the time we spent on diagnosing this issue here...

Rainer
User avatar
rgerhards
Site Admin
 
Posts: 2778
Joined: Thu Feb 13, 2003 11:57 am

Re: Unable to delete logs from Web or from command line

Postby fabio.emidi » Thu Apr 30, 2009 10:28 am

Finally, I decided to do the following from mysql command shell:

grant delete on Syslog.SystemEvents to 'phplogcon'@'localhost'

After issuing this command, deletion operation was succesful.

I would like to share a personal opinion. From a centralized "Syslog Server" point of view, which means building a server to store logs from various applications running on various servers, I think we shall encounter quite soon a probelm of disk space. So it would be very useful if you could configure and manage from phplogcon Web Interface periodical purging of records, based on size and/or age. Kind of:

"Delete all records after 7 days" or

"When db size reaches 5 Gb, delete records as far as 3 Gb are free"

Beside this, I would particularly like to thank rgerhards and alorbach for the help and for the grat job done with phplogcon.
fabio.emidi
New
 
Posts: 8
Joined: Mon Apr 27, 2009 2:45 pm

Re: Unable to delete logs from Web or from command line

Postby alorbach » Mon May 04, 2009 4:22 pm

Hi,

you can already use the command line script along with a crontab job to regulary cleanup the phpLogCon database, see this wiki page for more: http://wiki.rsyslog.com/index.php/PhpLo ... mmand_Line

regards,
Andre
User avatar
alorbach
Site Admin
 
Posts: 1180
Joined: Thu Feb 13, 2003 11:55 am

Re: Unable to delete logs from Web or from command line

Postby fabio.emidi » Tue May 19, 2009 8:23 am

Hi,

I tried several times to use the script maintenance.php but I couldn't find out why it didn't work for me.

Here is the command I issued from shell:

Code: Select all
php maintenance.php cleandata 2 all


Here is the output on screen:

Code: Select all
Fatal error: Cannot redeclare createhtmlheader() (previously declared in /var/www/logs/include/functions_debugoutput.php:44) in /var/www/logs/include/functions_debugoutput.php on line 73


Can you help me ???
fabio.emidi
New
 
Posts: 8
Joined: Mon Apr 27, 2009 2:45 pm

Google Ads


Next

Return to Help

Who is online

Users browsing this forum: No registered users and 0 guests

cron