sachaos / todoist

Todoist CLI Client. I ❤️ Todoist and CLI.
MIT License
1.46k stars 105 forks source link

todoist list command fails on mac #112

Open sherry-ummen opened 4 years ago

sherry-ummen commented 4 years ago

➜ ~ todoist list panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x143112c]

goroutine 1 [running]: main.List.func1(0x0, 0x0) /private/tmp/todoist-20200116-87090-1lu0d0c/todoist-0.14.0/src/github.com/sachaos/todoist/list.go:40 +0xfc main.traverseItems(0x0, 0xc000140f30, 0x0) /private/tmp/todoist-20200116-87090-1lu0d0c/todoist-0.14.0/src/github.com/sachaos/todoist/list.go:9 +0x3e main.List(0xc0000f0b00, 0x0, 0x0) /private/tmp/todoist-20200116-87090-1lu0d0c/todoist-0.14.0/src/github.com/sachaos/todoist/list.go:35 +0x2d5 github.com/urfave/cli.HandleAction(0x148b5a0, 0x15485f0, 0xc0000f0b00, 0xc0000c8700, 0x0) /private/tmp/todoist-20200116-87090-1lu0d0c/todoist-0.14.0/.brew_home/go/pkg/mod/github.com/urfave/cli@v1.20.0/app.go:490 +0xc8 github.com/urfave/cli.Command.Run(0x1528adc, 0x4, 0x0, 0x0, 0xc0000ab310, 0x1, 0x1, 0x152bfc8, 0xe, 0x0, ...) /private/tmp/todoist-20200116-87090-1lu0d0c/todoist-0.14.0/.brew_home/go/pkg/mod/github.com/urfave/cli@v1.20.0/command.go:210 +0x991 github.com/urfave/cli.(*App).Run(0xc0000b7380, 0xc0000c0020, 0x2, 0x2, 0x0, 0x0) /private/tmp/todoist-20200116-87090-1lu0d0c/todoist-0.14.0/.brew_home/go/pkg/mod/github.com/urfave/cli@v1.20.0/app.go:255 +0x6ab main.main() /private/tmp/todoist-20200116-87090-1lu0d0c/todoist-0.14.0/src/github.com/sachaos/todoist/main.go:262 +0x160e

sherry-ummen commented 4 years ago

Please ask if you need more details

tthansel commented 4 years ago

Same error on Manjaro, appears to have been remedied by calling todoist sync first, so it looks like an error associated with trying to print something that isn't there.

sepehrhosseini commented 4 years ago

Also have this issue on my Mac, and running todoist sync resolved the issue. Obviously it's better to run this command automatically rather than throwing error.

overcache commented 4 years ago

same here. run todoist sync to fix

sherry-ummen commented 4 years ago

I ran todoist sync and then ran todoist list , same issue. So the workaround did not work for me. Any other workaround?

sherry-ummen commented 4 years ago

so master version does not have this issue, I just built the code myself and using that

squarepegsys commented 3 years ago

I have a simliar error on mac, but it also happens when I sync. Just compiled fresh from master:

➜ todoist sync
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x12d525d]

goroutine 1 [running]:
github.com/sachaos/todoist/lib.addToChildItem(...)
        /Users/mikeh/go/src/github.com/sachaos/todoist/lib/sync.go:99
github.com/sachaos/todoist/lib.(*Store).ConstructItemTree(0xc0000a7c00)
        /Users/mikeh/go/src/github.com/sachaos/todoist/lib/sync.go:176 +0x77d
github.com/sachaos/todoist/lib.(*Client).Sync(0xc0000d4e40, 0x14eb7d0, 0xc0000a2000, 0x6, 0xc0000c7ca8)
        /Users/mikeh/go/src/github.com/sachaos/todoist/lib/todoist.go:116 +0x257
main.Sync(0xc0000ec580, 0x0, 0xc0000ec580)
        /Users/mikeh/go/src/github.com/sachaos/todoist/sync.go:12 +0x9d
github.com/urfave/cli.HandleAction(0x13e8b40, 0x1482f68, 0xc0000ec580, 0xc0000b8700, 0x0)
        /Users/mikeh/go/pkg/mod/github.com/urfave/cli@v1.20.0/app.go:490 +0x82
github.com/urfave/cli.Command.Run(0x146467b, 0x4, 0x0, 0x0, 0xc000099500, 0x1, 0x1, 0x1466412, 0xa, 0x0, ...)
        /Users/mikeh/go/pkg/mod/github.com/urfave/cli@v1.20.0/command.go:210 +0x9bb
github.com/urfave/cli.(*App).Run(0xc0000a51e0, 0xc0000ba000, 0x2, 0x2, 0x0, 0x0)
        /Users/mikeh/go/pkg/mod/github.com/urfave/cli@v1.20.0/app.go:255 +0x768
main.main()
        /Users/mikeh/go/src/github.com/sachaos/todoist/main.go:326 +0x193d
➜ go version
go version go1.16.2 darwin/amd64
tammersaleh commented 2 years ago

I also get this on sync:

$ todoist sync
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x130a422]

goroutine 1 [running]:
github.com/sachaos/todoist/lib.addToChildItem(...)
        /private/tmp/todoist-20210127-6214-1uxhr2i/todoist-0.15.0/lib/sync.go:93
github.com/sachaos/todoist/lib.(*Store).ConstructItemTree(0xc000127c00)
        /private/tmp/todoist-20210127-6214-1uxhr2i/todoist-0.15.0/lib/sync.go:165 +0x742
github.com/sachaos/todoist/lib.(*Client).Sync(0xc00014ee40, 0x1591960, 0xc000122000, 0x6, 0xc000143a68)
        /private/tmp/todoist-20210127-6214-1uxhr2i/todoist-0.15.0/lib/todoist.go:116 +0x254
main.Sync(0xc00015e580, 0x0, 0xc00015e580)
        /private/tmp/todoist-20210127-6214-1uxhr2i/todoist-0.15.0/sync.go:12 +0x9d
github.com/urfave/cli.HandleAction(0x1472a20, 0x151d1a8, 0xc00015e580, 0xc000136700, 0x0)
        /Users/tsaleh/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/urfave/cli@v1.20.0/app.go:490 +0x82
github.com/urfave/cli.Command.Run(0x14fccfc, 0x4, 0x0, 0x0, 0xc0001193b0, 0x1, 0x1, 0x14febd0, 0xa, 0x0, ...)
        /Users/tsaleh/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/urfave/cli@v1.20.0/command.go:210 +0x9fb
github.com/urfave/cli.(*App).Run(0xc000125520, 0xc00012e040, 0x2, 0x2, 0x0, 0x0)
        /Users/tsaleh/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/urfave/cli@v1.20.0/app.go:255 +0x768
main.main()
        /private/tmp/todoist-20210127-6214-1uxhr2i/todoist-0.15.0/main.go:274 +0x1610