Coder Social home page Coder Social logo

Comments (8)

tbabej avatar tbabej commented on August 29, 2024 1

I'll try to look into this in the evening.

from taskpirate.

tbabej avatar tbabej commented on August 29, 2024

@kaushikgopal Could you reproduce the problem having set debug.hooks configuration setting to 2. (i.e using rc.debug.hooks=2 override)? This will give us the underlying info what's happening between task and the hook script.

from taskpirate.

kaushikgopal avatar kaushikgopal commented on August 29, 2024

Sorry only noticed the message now. I tried this again after updating some libs (from a previous issue) and am getting a slightly different error now. Here's some additional information:

# task diag

task 2.6.1
   Platform: Darwin

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

Build Features
      CMake: 3.21.3
    libuuid: libuuid + uuid_unparse_lower
  libgnutls: 3.6.16
 Build type: Release

Configuration
       File: ~/.config/task/taskrc (found), 2363 bytes, mode 100644
       Data: ~/.data/task/ (found), dir, mode 40755
    Locking: Enabled
         GC: Enabled
    $VISUAL: nvim
     Server: app.wingtask.com:53589
     //....
Hooks
     System: Enabled
   Location: ~/.config/task/hooks/
     Active: on-add-pirate    (executable)
             on-exit-sync.sh  (executable)
             on-modify-pirate (executable)
   Inactive: 

Tests
   Terminal: 237x110
       Dups: Scanned 768 tasks for duplicate UUIDs:
             No duplicates found
 Broken ref: Scanned 768 tasks for broken references:
             No broken references found

Sample of what i tried:

# task rc.debug.hooks=2 add "expensify Home Internet & Cell Phone Reimbursement [prev month] (30 days)" project:fin recur:monthly due:sonm+15d until:due+28d
Timer Config::load (~/.config/task/taskrc) 0.000549 sec
No context set
Found hook script ~/.config/task/hooks//on-add-pirate
Found hook script ~/.config/task/hooks//on-exit-sync.sh
Found hook script ~/.config/task/hooks//on-modify-pirate
  MODIFICATION project <-- 'fin'
  MODIFICATION recur <-- 'monthly'
  MODIFICATION due <-- '1637046000' <-- '2021-11-15T23:00:00' <-- 'sonm+15d'
  MODIFICATION until <-- '1639465200' <-- '2021-12-13T23:00:00' <-- 'due+28d'
  MODIFICATION description <-- 'expensify Home Internet & Cell Phone Reimbursement [prev month] (30 days)'
Hook: Calling ~/.config/task/hooks//on-add-pirate
Hook: input
  {"description":"expensify Home Internet & Cell Phone Reimbursement [prev month] (30 days)","due":"20211116T070000Z","entry":"20211028T160825Z","modified":"20211028T160825Z","project":"fin","recur":"monthly","rtype":"periodic","status":"recurring","until":"20211214T070000Z","uuid":"a36be048-e3e3-459b-9897-8429735d50e3"}
Hooks: args
  api:2
  args:task rc.debug.hooks=2 add expensify Home Internet & Cell Phone Reimbursement [prev month] (30 days) project:fin recur:monthly due:sonm+15d until:due+28d
  command:add
  rc:~/.config/task/taskrc
  data:~/.data/task/
  version:2.6.1
Timer Hooks::execute (~/.config/task/hooks//on-add-pirate) 0.151386 sec
Hook: output
  {"description":"expensify Home Internet & Cell Phone Reimbursement [prev month] (30 days)","due":"20211116T070000Z","entry":"20211028T160825Z","modified":"20211028T160825Z","project":"fin","recur":"monthly","rtype":"periodic","status":"recurring","until":"20211214T070000Z","uuid":"a36be048-e3e3-459b-9897-8429735d50e3"}
Hook: Completed with status 0
 
  pending.data rw O T0301+001~000-000 L0300+000
completed.data rw - T0468+000~000-000 L0468+000
     undo.data rw O T0000+000~000-000 L0003+003
  backlog.data rw O T0000+000~000-000 L0001+001
 
Hook: Calling ~/.config/task/hooks//on-exit-sync.sh
Hook: input
  {"description":"expensify Home Internet & Cell Phone Reimbursement [prev month] (30 days)","due":"20211116T070000Z","entry":"20211028T160825Z","modified":"20211028T160825Z","project":"fin","recur":"monthly","rtype":"periodic","status":"recurring","until":"20211214T070000Z","uuid":"a36be048-e3e3-459b-9897-8429735d50e3"}
Hooks: args
  api:2
  args:task rc.debug.hooks=2 add expensify Home Internet & Cell Phone Reimbursement [prev month] (30 days) project:fin recur:monthly due:sonm+15d until:due+28d
  command:add
  rc:~/.config/task/taskrc
  data:~/.data/task/
  version:2.6.1
Timer Hooks::execute (~/.config/task/hooks//on-exit-sync.sh) 0.005306 sec
Hook: output
Hook: Completed with status 0
 
Perf task 2.6.1 - 20211028T160825Z init:2328 load:12244 gc:0 filter:0 commit:18127 sort:0 render:0 hooks:157020 other:15110 total:192585

Created task 301 (recurrence template).
Configuration override rc.debug.hooks=2
The project 'fin' has changed.  Project 'fin' is 48% complete (18 of 35 tasks remaining).
# task --rc.debug.hooks=2 
Traceback (most recent call last):
  File "~/.config/task/hooks//on-add-pirate", line 46, in <module>
    hook(task)
  File "~/.config/task/hooks/shift-recurrence/pirate_add_shift_recurrence.py", line 25, in hook_shift_recurrence
    parent = tw.tasks.get(uuid=task['parent']['uuid'])
  File "~/Library/Python/3.9/lib/python/site-packages/tasklib/task.py", line 552, in get
    raise Task.DoesNotExist(
tasklib.task.DoesNotExist: Task matching query does not exist. Lookup parameters were {'uuid': 'a36be048-e3e3-459b-9897-8429735d50e3'}
Hook Error: Expected feedback from failing hook script: on-add-pirate

So interestingly, it looks like my tasklib is misconfigured again?

# pip3 show tasklib
Name: tasklib
Version: 2.4.2
Summary: Official Taskwarrior library for Python
Home-page: https://github.com/GothenburgBitFactory/tasklib
Author: GothenburgBitFactory
Author-email: [email protected]
License: BSD
Location: ~/Library/Python/3.9/lib/python/site-packages
Requires: tzlocal, pytz
Required-by: 

I'm on 2.4.2 though which i thought would be ok. I upgraded to 2.4.3

Name: tasklib
Version: 2.4.3
Summary: Official Taskwarrior library for Python
Home-page: https://github.com/GothenburgBitFactory/tasklib
Author: GothenburgBitFactory
Author-email: [email protected]
License: BSD
Location: ~/Library/Python/3.9/lib/python/site-packages
Requires: tzlocal, pytz
Required-by: 

But no dice, i seem to be getting the same error.

from taskpirate.

kaushikgopal avatar kaushikgopal commented on August 29, 2024

So reading that error message

tasklib.task.DoesNotExist: Task matching query does not exist. Lookup parameters were {'uuid': 'a36be048-e3e3-459b-9897-8429735d50e3'}

made me realize it might be because the task doesn't exist, but it does (just as a recurring template):

# task info a36be048

Name            Value                                                                              
ID              301
Description     expensify Home Internet & Cell Phone Reimbursement [prev month] (30 days)
Status          Recurring
Project         fin
Recurrence      monthly
Recurrence type periodic
Entered         2021-10-28 09:08:25 (8min)
Due             2021-11-15 23:00:00
Until           2021-12-13 23:00:00
Last modified   2021-10-28 09:08:25 (8min)
Virtual tags    LATEST PROJECT QUARTER UNBLOCKED UNTIL YEAR
UUID            a36be048-e3e3-459b-9897-8429735d50e3
Urgency          3.4

    project      1 *    1 =      1
    due        0.2 *   12 =    2.4
                            ------
                               3.4

from taskpirate.

tbabej avatar tbabej commented on August 29, 2024

Tasklib version is OK. I think this is a race condition on the DB, the content of the files might not be synced to the disk yet, and that's why query for the UUID of the newly created task failed.

from taskpirate.

kaushikgopal avatar kaushikgopal commented on August 29, 2024

hmm.. this happens almost consistently (for me).

i know i'm sounding like a crazy person at this point, but i started to see a lot of these problems arise after my move to the $XDG_ folder system.

i reverted my data.location (and .taskrc for good measure) locations and tried the same commands again ... and it worked.

only variable is i also disabled two of my other hooks (on-exit-sync and time-warrior), so those are the only other variables i can think of.

from taskpirate.

williamjameshandley avatar williamjameshandley commented on August 29, 2024

I have just switched to taskpirate and been very impressed with the speed uplift -- I had quite a few hooks which were importing tasklib.

I'm also seeing this issue when running task undo. The issue seems to stem from the fact that at some point in the 2.6.0 processing the task is None.

from taskpirate.

RonMcKay avatar RonMcKay commented on August 29, 2024

I can confirm. I get the following when undoing an add command:

The last modification was made 2022-05-28

             Prior Values  Current Values
description                Testing task pirate
due                        2022-05-28
entry                      2022-05-28
modified                   2022-05-28
status                     pending
uuid                       77e6411f-c941-4949-a95d-295ed2744bae

The undo command is not reversible.  Are you sure you want to revert to the previous state? (yes/no) yes
Timer Config::load (/home/testuser/.taskrc) 0.000558 sec
Found hook script /home/testuser/.task/hooks/on-add-pirate
Found hook script /home/testuser/.task/hooks/on-modify-pirate
Hook: Calling /home/testuser/.task/hooks/on-modify-pirate
Hook: input
  {"description":"Testing task pirate","due":"20220528T170000Z","entry":"20220528T152542Z","modified":"20220528T152542Z","status":"pending","uuid":"77e6411f-c941-4949-a95d-295ed2744bae"}
  {}
Hooks: args
  api:2
  args:task undo rc.debug.hooks=2
  command:undo
  rc:/home/testuser/.taskrc
  data:/home/testuser/.task
  version:2.6.1
Timer Hooks::execute (/home/testuser/.task/hooks/on-modify-pirate) 0.057345 sec
Hook: output
  {}
Hook: Completed with status 0

Configuration override rc.debug.hooks=2
Hook Error: Expected 1 JSON task(s), found 0, in hook script: on-modify-pirate

When tasklib is processing the above input the values of self._data of the Task instance become None as mentioned by @williamjameshandley. Exporting this Task instance then prints {}. But I have the feeling that this is not a problem caused by taskpirate nor tasklib as the output of the hook equals the modified task input of {}.
@tbabej might this be a bug on the site of taskwarriors hook system?

My taskwarrior version: 2.6.1 (112ac54a5)

from taskpirate.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.