Out of nowhere, I'm getting an error that I can't make heads or tails of:

user warning: Duplicate entry '347831' for key 1 query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp)

It goes on to list the action that happened, but the error--including the number 347831 remains the same.

Now, this doesn't affect the actual ability to, say, post in the forums or log in, but it's an annoyance and clearly SOMETHING's busted.

When I actually look at the watchdog logs, the thing that I notice that is VERY strange is that EIGHT pages of errors log at the exact same time (may 7, 5:48 PM). Going back even further, it's 20 pages before the logs start recording time normal again--and only ONE HOUR has passed. At exactly 4:48 pm the log recorded the following: "Illegal choice in Category element." Before that watchdog log entry, time records pretty much as normal.

How do I correct this? And what went wrong??

Comments

sinker’s picture

OK, that 4:48 entry isn't the one that sends everything wild. It does, however, pop back up at 5:45 and then only three minutes are logged for the remaining 20 pages. The weird thing is that the log doesn't seem to be updating at all anymore. No new actions are recorded. How do I get the log restarted??

sinker’s picture

since posting this eight hours or so ago, the watchdog log has not been updated at all and the error is still there. ANY help would be much appreciated.

catch’s picture

You can empty the watchdog table in your database quite safely.

Assuming you've got phpmyadmin, you can just select it, then "empty".

Or run TRUNCATE TABLE "watchdog" as an sql query.

You'll lose your logs, but that should be it.

A workaround if you don't have any administration tools would be to set logs to collect for only one hour in admin >> settings >> error reporting - it should clear out entries every cron rup (which you can do manually by going to example.com/cron.php

sinker’s picture

I figured that out about an hour before you posted. Thanks for the advice!