-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panic after successful sync when running list on 0.18.0 and 0.20.0 #232
Comments
Thanks for the detailed bug report @cscutcher |
Do you have any special characters in your labels, @cscutcher? That's where things seem to be a bit strange. I seem to remember some issues with labels in the past, but I'm having trouble placing it. To be clear, I don't think there's an issue with your Todoist setup, I believe this client is possibly not handling certain characters well. |
@HacDan I don't think so; $ jq '[.items[].labels[]] | join("") | split("") | unique | join("")' ~/.cache/todoist/cache.json
"-CEMNOSTabcdefghijklmnoprstuvwxy" (Assuming my The only place I'm doing anything "interesting", is that I have quite long saved filters that I edit in vim and copypasta into standard todoist UI normally. I'd assume filters are unrelated to this issue, but noting that todoist often groups labels and filters in the same tab; $ jq '[.filters[].query] | join("") | split("") | unique | join("") ' ~/.cache/todoist/cache.json
" !#&()*,-/0123459:@CFGHILMPRTWabcdefghijklmnoprstuvwxy|" (I had expected to see a newline or something slip into a filter, but I guess todoist drops those.) and filter names; $ jq '[.filters[].name] | join("") | split("") | unique | join("") ' ~/.cache/todoist/cache.json
" &1ADEHMOPRSTWabdeghiklmnorstuvy" I suppose maybe the |
Well, this one was pretty fun to track down. I don't have a fix yet, but I spent a few minutes playing with the cache and the special characters from your labels. It seems it's the I'll dig into this tonight or tomorrow, as this should be patched, as it's a very expected use case. I did confirm, if it helps anyway, that the |
I haven't made any progress here outside of being able to reproduce this issue. If someone else wants to look into this, please feel free! |
Thanks for looking into that. Unfortunately, the workaround doesn't seem to work or at least removing $ nix run nixpkgs#todoist -- sync && nix run nixpkgs#todoist -- list ; jq '[.items[].labels[]] | join("") | split("") | unique | join("")' ~/.cache/todoist/cache.json
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x6df1ab]
goroutine 1 [running]:
github.com/sachaos/todoist/lib.Item.LabelsString({{{{0xc0003761c2, 0xa}}, {{0xc0003761d0, 0xa}}, {0xc00017bbe0, 0x1e}, {0xc0003761e0, 0x8}}, {0x0}, {0x0}, ...}, ...)
github.com/sachaos/todoist/lib/item.go:221 +0x20b
main.List.func1(0xc000409c00, 0x0?)
github.com/sachaos/todoist/list.go:72 +0x31b
main.traverseItems(0xc000409c00, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:13 +0x2e
main.traverseItems(0xc000409ac8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000409990, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000409240, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000409108, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000408e98, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000408d60, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000408c28, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000408af0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004089b8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000408880, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000408748, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000408610, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004084d8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004083a0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000408268, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407ff8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407ec0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407d88, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407b18, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004079e0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407638, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407500, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004073c8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407290, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407158, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407020, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406ee8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406db0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406c78, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406b40, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406a08, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004068d0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406798, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406660, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406528, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004063f0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406180, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000405f10, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000405dd8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000405ca0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000405b68, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004058f8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004057c0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000405688, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000405550, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000405418, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004052e0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004051a8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000405070, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000404f38, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000404e00, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000404cc8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000404b90, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000404a58, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000404920, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004047e8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004046b0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000404578, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000404440, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004041d0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000403e28, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000403cf0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000403bb8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000403a80, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000403948, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000403810, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004036d8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004035a0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000403468, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000403330, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004031f8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004030c0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402f88, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402e50, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402d18, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402be0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402aa8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402970, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402700, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004025c8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402490, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402358, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402220, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004020e8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401fb0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401e78, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401d40, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401c08, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401ad0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401860, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401728, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004015f0, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004014b8, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401380, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401248, 0xc00021eff0, 0x0)
github.com/sachaos/todoist/list.go:20 +0x74
"CEMNOST_abcdefghijklmnoprstuvwxy" |
I am experiencing this issue and in my case it is caused by the fact that some tasks have shared labels in addition to personal labels. The sync API only returns personal labels (https://developer.todoist.com/sync/v9/#labels), so the func below returns an empty string and that triggers the panic as the ID of the shared label is not found: https://github.com/sachaos/todoist/blob/master/lib/label.go#L25 This looks a bit tricky to fix as todoist-cli would need to retrieve shared labels using the REST api and keep them in some other json file in order to display them. |
Good spot! FWIW, I also use shared labels. |
I'm experiencing this as well with a fresh install of 0.20.0. My labels are all camel case, so there are no other symbols like |
Originally commented on #192 which is most likely unrelated since my issue occurs on
list
after a seeming successfulsync
.Checked this again today and still seeing the issue both with the 0.18.0 nix built version and with the 0.20.0 binary from github.
Rather than before where I was running on Arch, I'm now running full NixOS but the error seems the same;
Full Output
As I say
sync
seems to work fine and the contents of~/.cache/todoist/cache.json
look fine on a casual scan.I also tried to look for any incidents of subtasks being in the state described by #228 (i.e. uncompleted subtasks with a completed parent task), but couldn't find anything. I also assume I'd not have been able to
sync
if the issue was related to #228.The text was updated successfully, but these errors were encountered: