:: TheOneAndTheOnly.com – Andrew Buckman ::

Urchin 5 Stats Stopping

Blogged in Plesk,The Site,Web Development by Andrew · Saturday March 17, 2007

So it seems there’s something wrong with Urchin 5 that is preventing my web stats from being compiled out of the logs files and into Urchin’s reporting interface. This began happening a year after I switched to the current server (running Plesk 7.5) and I noticed it on a few more important domains and found a fix at that time. Meanwhile I wrote myself a post-it note to go back and fix it on the rest of the domains, which of course I never did. Today I was curious about some stats for one of the domains I hadn’t fixed and thankfully was still able to find my note. I’ve decided to blog the solution so that I don’t have to worry about losing that note any longer and hopefully it will help someone else in the future as well.

If you try processing your log by clicking the “Run Now” button in Urchin Admin and see the following message come up, these instructions should help with your problem.
WARNING: (7063-54-63) Unable to open database for writing since it has been archived

The official solution to this problem exists on the Urchin Help site (now owned by google) at this location:

My more detailed walkthrough follows…

The problem has to do with the archiving feature on a per domain basis. If you login to the Urchin Admin interface and configure the profile for that domain, there is a Storage/DB tab. On the tab you’ll see “Archive DB Options” with options for on/off and a timeframe for archiving if you leave it on. Change the setting for “Archive DB” to off and click “Update” to save your change.

The second half of the fix is a bit trickier and will require shell access to your server with an appropriate permissions level that grants you access to urchin’s installation directory. I logged in via ssh and switched to the superuser account to perform the following tasks (obviously you do so at your own risk, remember when you’re the superuser you have the power to break many things you don’t want to break). First, find where urchin is storing its reports for the domain you’re fixing (/usr/local/urchin/data/reports/theoneandtheonly.com/ for this domain). Change to that directory and look at the contents. You should see a variety of zip files named with the following format: YYYYMM-archive.zip. You should unzip these files to restore the data from the archives and remove the archive.zip files after they’ve been unzipped. This is important, you MUST remove the archive files, or at least move them to another directory so Urchin doesn’t see them.

UPDATE: By request, here is a list of the commands I ran for step 2…
cd /usr/local/urchin/data/reports/theoneandtheonly.com/
unzip *-archive.zip
mkdir archive-backup
mv *-archive.zip archive-backup

After both steps above are complete, go back to your Urchin Admin interface and run the stats report. You should see it processing your log files again and your missing data should fill in. Depending on the log file rotation schedule for your webserver you may or may not have gaps. If you keep backups on your server of all the logs, you should be able to reconfigure urchin to process the old files if you don’t have it setup that it does so already.

5 Responses to “Urchin 5 Stats Stopping”

  1. Dan Sheetz says:

    I know this may sound dumb, but can you post the exact command for unzipping the files? I’m nervous that I’m gonna miss a flag or screw something up in the unzipping process.

    Many thanks!

  2. Andrew says:

    No problem, I updated the post to include the steps. As you’ll see there weren’t any flags, just unzip and move or remove the files (the steps above move them to a backup directory).

  3. [...] I am not big on deleting files as suggested in that solution so I did a little more digging. Shortly thereafter I found Urchin 5 Stats StoppingĀ over at TheOneAndTheOnly.com. I liked this solution much better and figured I would take it one step further. [...]

  4. Rich says:

    On RHEL (Red Hat) at leastm this doesn’t work.

    You need to put a back-slash in front of the asterisk to keep unzip from passing itself unzipped file lists as input… or something like that…

    What I know is that got lots of:

    caution: filename not matched:

    ..until I used:

    unzip \*-archive.zip


  5. Arthur says:

    Excellent How-To Fix. Thanks a ton!

Leave a Reply

©2010 Andrew Buckman
34 queries. 0.275 seconds.
Powered by Wordpress
theme based on desert by evil.bert