GothenburgBitFactory / timewarrior

Timewarrior - Commandline Time Tracking and Reporting
https://timewarrior.net
MIT License
1.27k stars 96 forks source link

No active tracking after start #605

Open dakotak opened 6 months ago

dakotak commented 6 months ago

After starting tracking it seem that time warrior does not find any entries. Issue seems similar to #146 but seems different as the database file name is correct.

~ → timew start
Tracking
  Started 2024-05-03T16:46:41
  Current                  41
  Total               0:00:00
~ → timew
There is no active time tracking.
~ → timew start test
Tracking test
  Started 2024-05-03T16:46:52
  Current                  52
  Total               0:00:00
~ → timew
There is no active time tracking.
~ → timew summary
No filtered data found in the range 2024-05-03T00:00:00 - 2024-05-04T00:00:00.

I removed the database files and config files with the same result.

~ → ls .data/timewarrior/data
 2024-05.data   tags.data   undo.data
~ → rm -rf ~/.data/timewarrior ~/.config/timewarrior
~ → timew start
Create new config in /Users/dakota/.config/timewarrior?
Create new database in /Users/dakota/.data/timewarrior? (yes/no) yes
Tracking
  Started 2024-05-03T16:50:44
  Current                  44
  Total               0:00:00
~ → timew
There is no active time tracking.
~ → timew stop
There is no active time tracking.
~ → timew start test
Note: 'test' is a new tag.
Tracking test
  Started 2024-05-03T16:50:57
  Current                  57
  Total               0:00:00
~ → ls .data/timewarrior/data
 2024-05.data   tags.data   undo.data

Diagnostics:

~ → timew diagnostics

timew 1.7.1
       Platform: Darwin

Compiler:
        Version: Apple LLVM 15.0.0 (clang-1500.1.0.2.5)
           Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
     Compliance: C++17

Build Features
          Built: Jan 16 2024 12:35:02
          CMake: 3.28.1
     Build type: Release

Configuration
  TIMEWARRIORDB: -
            Cfg: /Users/dakota/.config/timewarrior/timewarrior.cfg (-rw- 0 bytes)
       Database: /Users/dakota/.data/timewarrior (drwx 96 bytes)
        $EDITOR: nvim
    Color theme: Built-in default
                 00 01 02 03 04 05 06 07 08 09 10 11 12

Extensions
       Location: /Users/dakota/.config/timewarrior/extensions (drwx 64 bytes)
               (None)

I have been using time warrior on my work computer (also osx) without any issues, but after installing on my personal computer I have not been able to get it to work.

lauft commented 6 months ago

@dakotak I see there is a 2024-05.data in ~/.data/timewarrior/data after you called timew start test, but does it have any content?

Can you try to manually create a ~/.timewarrior directory an see whether it works then? 🤔

dakotak commented 6 months ago

@lauft I can see the files in ~/.data/timewarrior/data growing in size after each command, so it seems data is being correctly written just not read from this location. Manually creating ~/.timewarrior makes the application work it seems (though not using xdg directories).

~ → ll ~/.data/timewarrior/data
.rw-r--r-- dakota staff 106 B Wed May  8 19:48:11 2024 2024-05.data
.rw-r--r-- dakota staff  47 B Wed May  8 19:48:11 2024 tags.data
.rw-r--r-- dakota staff 361 B Wed May  8 19:48:11 2024 undo.data
~ → timew start test2
Note: 'test2' is a new tag.
Tracking test2
  Started 2024-05-08T19:50:05
  Current                  05
  Total               0:00:00
~ → timew
There is no active time tracking.
~ → ll ~/.data/timewarrior/data
.rw-r--r-- dakota staff 135 B Wed May  8 19:50:05 2024 2024-05.data
.rw-r--r-- dakota staff  70 B Wed May  8 19:50:05 2024 tags.data
.rw-r--r-- dakota staff 456 B Wed May  8 19:50:05 2024 undo.data

~ → mkdir ~/.timewarrior
~ → timew
There is no active time tracking.
~ → timew start test2
Note: 'test2' is a new tag.
Tracking test2
  Started 2024-05-08T19:50:55
  Current                  55
  Total               0:00:00
~ → timew
Tracking test2
  Started 2024-05-08T19:50:55
  Current               51:00
  Total               0:00:05
~ → ll ~/.timewarrior/data
.rw-r--r-- dakota staff  29 B Wed May  8 19:50:55 2024 2024-05.data
.rw-r--r-- dakota staff  25 B Wed May  8 19:50:55 2024 tags.data
.rw-r--r-- dakota staff  95 B Wed May  8 19:50:55 2024 undo.data
lauft commented 6 months ago

@dakotak Debugging further...

When using XDG, how does the output of timew start test2 :debug look like? The :debug hint will print more context information which may help us reproducing the issue.

dakotak commented 6 months ago

@lauft Here are the outputs from running times start test2 :debug. I ran it twice, once with the ~/.timewarrior directory in place and another after deleting the ~/.timewarrior directory.

~ → timew start test2 :debug
CLI Parser
  _original_args
    timew start test2 :debug
  _args
    word basename='timew' raw='timew' BINARY
    word canonical='start' raw='start' ORIGINAL CMD
    word raw='test2' ORIGINAL FILTER TAG
    word canonical=':debug' raw=':debug' ORIGINAL HINT FILTER

>> 2024-05.data: 2 intervals
>> Loaded 0 tracked intervals
>> 2024-05.data: Added inc 20240511T122146Z # test2
Tracking test2
  Started 2024-05-11T05:21:46
  Current                  46
  Total               0:00:00
>> Moving '/Users/dakota/.timewarrior/data/2024-05.data.70516-2.tmp' -> '/Users/dakota/.timewarrior/data/2024-05.data'
>> Moving '/Users/dakota/.timewarrior/data/undo.data.70516-3.tmp' -> '/Users/dakota/.timewarrior/data/undo.data'
>> Moving '/Users/dakota/.timewarrior/data/tags.data.70516-4.tmp' -> '/Users/dakota/.timewarrior/data/tags.data'
>> Timer timew 0.023992 sec

And after removing ~/.timewarrior:

~ → rm -rf ~/.timewarrior
~ → timew start test
Tracking test
  Started 2024-05-11T05:22:24
  Current                  24
  Total               0:00:00
~ → timew
There is no active time tracking.
~ → timew start test2 :debug
CLI Parser
  _original_args
    timew start test2 :debug
  _args
    word basename='timew' raw='timew' BINARY
    word canonical='start' raw='start' ORIGINAL CMD
    word raw='test2' ORIGINAL FILTER TAG
    word canonical=':debug' raw=':debug' ORIGINAL HINT FILTER

>> Loaded 0 tracked intervals
>> 2024-05.data: 6 intervals
>> 2024-05.data: Added inc 20240511T122239Z # test2
Tracking test2
  Started 2024-05-11T05:22:39
  Current                  39
  Total               0:00:00
>> Moving '/Users/dakota/.data/timewarrior/data/2024-05.data.71170-2.tmp' -> '/Users/dakota/.data/timewarrior/data/2024-05.data'
>> Moving '/Users/dakota/.data/timewarrior/data/undo.data.71170-3.tmp' -> '/Users/dakota/.data/timewarrior/data/undo.data'
>> Moving '/Users/dakota/.data/timewarrior/data/tags.data.71170-4.tmp' -> '/Users/dakota/.data/timewarrior/data/tags.data'
>> Timer timew 0.022123 sec
~ → timew
There is no active time tracking.