nomeata / arbtt

arbtt, the automatic rule-based time-tracker
http://arbtt.nomeata.de/
GNU General Public License v2.0
318 stars 36 forks source link

Parser error: unexpected end of input on empty categorize.cfg #148

Closed Ileca closed 2 years ago

Ileca commented 2 years ago

My categorize.cfg is empty and arbtt-stats gives me:

Parser error: "/home/ileca/.arbtt/categorize.cfg" (line 1, column 1): unexpected end of input expecting "aliases", "{", "(", "[", variable, regular expression, string, time, date, number, "if", "tag" or "condition"

If I add one line aka "$idle > 60 ==> tag inactive,", I still get:

Parser error: "/home/ileca/.arbtt/categorize.cfg" (line 2, column 1): unexpected end of input expecting "{", "(", "[", variable, regular expression, string, time, date, number, "if", "tag" or "condition"

It was working before. I have no idea what I did. I uninstalled and reinstalled.

Ubuntu 21.10. Arbtt on Impish is 0.10.2-0.2build1.1.

nomeata commented 2 years ago

What if you omit the final , in

$idle > 60 ==> tag inactive,
Ileca commented 2 years ago

arbtt-stats: Unsupported TimeLogEntry version tag 0.......................] 0% CallStack (from HasCallStack): error, called at src/Data.hs:90:15 in main:Data

nomeata commented 2 years ago

Hmm, that looks as if your capture.log file bis corrupt? Odd

Ileca commented 2 years ago

Ok so I renamed ~/.arbtt/capture.log as capture_old.log, logged out and logged in. With an empty categorize.cfg, I still have the exact same error. With $idle > 60 ==> tag inactive I now have

arbtt-stats: Prelude.!!: index too large..................................] 0%

nomeata commented 2 years ago

Something is still odd here; your capure.log file gets corrupted. Maybe you are running multiple arbtt-capture instances in parallel accidentialy?

Ileca commented 2 years ago

Every time I wrote arbtt-capture instead of arbtt-stats, I couldn't get the lock on the log. I checked many times if arbtt-capture was working and I never saw two processes. Here is a small log I did for you to check if it is corrupted. capture_new.log

nomeata commented 2 years ago

How did you obtain or build it? Which version? On Linux, I assume?

Ileca commented 2 years ago

I wrote that in my first post. It's the package that comes with my distro. Just to be clear, I just purged the package, removed ~/.arbtt and logged out. I still have the problem.

nomeata commented 2 years ago

That file seems fine here:

~/projekte/programming/arbtt $ ./bin/arbtt-dump -f capture_new.log 
2022-02-09 11:49:02 (0ms inactive):
2022-02-09 11:49:32 (0ms inactive):
    ( ) dolphin:        .arbtt — Dolphin
2022-02-09 11:50:02 (0ms inactive):
    ( ) dolphin:        .arbtt — Dolphin
2022-02-09 11:50:32 (0ms inactive):
    ( ) dolphin:        .arbtt — Dolphin
2022-02-09 11:51:02 (0ms inactive):
    ( ) dolphin:        .arbtt — Dolphin
2022-02-09 11:51:32 (0ms inactive):
    ( ) dolphin:        .arbtt — Dolphin
2022-02-09 11:52:02 (0ms inactive):
    ( ) dolphin:        .arbtt — Dolphin
2022-02-09 11:52:32 (0ms inactive):
    ( ) dolphin:        .arbtt — Dolphin
2022-02-09 11:53:02 (0ms inactive):
    ( ) dolphin:        .arbtt — Dolphin
2022-02-09 11:53:32 (0ms inactive):
    ( ) dolphin:        .arbtt — Dolphin
2022-02-09 11:54:02 (0ms inactive):
    ( ) dolphin:        .arbtt — Dolphin
2022-02-09 11:54:33 (0ms inactive):
    ( ) dolphin:        .arbtt — Dolphin
2022-02-09 11:55:03 (0ms inactive):
    ( ) dolphin:        .arbtt — Dolphin
2022-02-09 11:55:33 (0ms inactive):
    ( ) dolphin:        .arbtt — Dolphin
2022-02-09 11:56:03 (0ms inactive):
    (*) dolphin:        /ROOT — Dolphin
2022-02-09 11:56:33 (0ms inactive):
    (*) dolphin:        /ROOT — Dolphin
~/projekte/programming/arbtt $ ./bin/arbtt-stats --logfile capture_new.log 
Processing data [========================================================================================================================================================================] 100%
Total time per tag
==================
____________Tag_|___Time_|_Percentage_
Program:dolphin |  1m00s |      12.50
Ileca commented 2 years ago

God knows why but now it's working again. Maybe logging out wasn't enough? I can also dump my first 1M capture.log while it throws a

arbtt-dump: Unsupported TimeLogEntry version tag 0 CallStack (from HasCallStack): error, called at src/Data.hs:90:15 in main:Data

at the end. It still throws me an error with arbtt-stats. Is there a way to salvage a corrupted log? Is capture.log.lck an important file which must be synchronized to the capture.log as I cut and pasted the log without this file. Can changing the sample-rate corrupt the log?

nomeata commented 2 years ago

Is there a way to salvage a corrupted log?

See arbtt-recover

The .lck file is not important, it's the lock that is used to try to prevent multiple instances of arbtt-capture from running in parallel.

Changing the rate shouldn't corrupt the log, I hope.

Ileca commented 2 years ago

Nice. Now old log is working again. The subsections of Program references are missing from your summary in https://arbtt.nomeata.de/doc/users_guide/index.html. You don't see the five program's help pages unless you navigate with prev/next. That's the only section I didn't read because the name didn't inspire me even though it describes all the programs shipped with arbtt.

Well well well, that was a mysterious issue we will never know what it was about.

nomeata commented 2 years ago

I know, it's just how this docbook thing seems to work :-(. Fixes welcome :-)