Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu 14.04 arbtt-stats index to large error

I've recently installed arbtt which seems to be an intersting, rule based, automatic time tracker. http://arbtt.nomeata.de/#what

I've got it working for the most part, but after 30 minutes or so of gathering stats, I end up with the following error.

Processing data [=>......................................................................................................................................................................................]   1%
arbtt-stats: Prelude.(!!): index too large

Does anyone have any suggestions on ways I can troubleshoot this issue, or better yet, solve it? I have 0 experience with the coding language used to create the rules (Haskell I believe). All I've done to this point is follow the documentation as closely as possible.

This error ultimately renders the tool useless since it doesn't gather data any longer than 30 minutes. To fix it, I have to delete the log and start from scratch. I'm primarily interested in the notion of having a customizable, rule based time tracker but I'm by no means tied to using arbtt.

Based on the comments below, I'm including some more information below.

When I try to run arbtt-recover I get a long list of errors that look like this. All of them seem to be related to an Unsupported TimeLogEntry.

Trying at position 1726098.
Failed to read value at position 1726098:
   Unsupported TimeLogEntry version tag 0

As for the configuration file, here is what I have so far.

$idle > 30 ==> tag inactive,

-- A rule that matches on a list of strings
current window $program == ["Chrome", "Firefox"] ==> tag Web,

current window $program == ["skype"]  ==> tag Skype,

current window $program == ["jetbrains-phpstorm"] ==> tag PhpStorm,

( current window $title =~ m!Inbox! ||
  current window $title =~ m!Outlook! ) ==> tag Emails,

( current window $title =~ m!AdWords! ||
  current window $title =~ m!Analytics! ) ==> tag Adwords,

It goes on further, but I'm fairly confident I've followed this same syntax for all other lines. The rest of the lines are following the same format but are project/client specific for me. If required, I'm happy to include the rest of the file.

like image 645
MMMTroy Avatar asked Jul 28 '15 02:07

MMMTroy


1 Answers

As discussed in the comments: This is a case of a corrupt ~/.arbtt/capture.log. You can usually fix this by

  • running arbtt-recover
  • and then moving ~/.arbtt/capture.log.recovered to ~/.arbtt/capture.log.

The second manual step is required to avoid accidentially deleting too much data. You can test that the recovered file is better by making arbtt-stats using the recovered file by passing --logfile=~/.arbtt/capture.log.recovered to it.

Data corruption happens for example when there is an unclean shutdown, or other undetermined reasons. But the log file format is such that even after a corruption (e.g. a partial write of one sample), further samples will be written correctly and should be picked up by arbtt-recover, so you did not lose more than a few samples.

like image 90
Joachim Breitner Avatar answered Sep 27 '22 22:09

Joachim Breitner