insanum / sncli

Simplenote CLI
MIT License
396 stars 34 forks source link

KeyError: 'modificationDate' #73

Closed 1094 closed 5 years ago

1094 commented 5 years ago

I just updated sncli and installed Simperium3, below is the error I get when I run the program.

~ $ sncli
Traceback (most recent call last):
  File "/usr/bin/sncli", line 11, in <module>
    load_entry_point('sncli==0.3.0', 'console_scripts', 'sncli')()
  File "/usr/lib/python3.7/site-packages/simplenote_cli/sncli.py", line 1353, in main
    sncli(sync, verbose, config).gui(key)
  File "/usr/lib/python3.7/site-packages/simplenote_cli/sncli.py", line 960, in gui
    'log'           : self.log
  File "/usr/lib/python3.7/site-packages/simplenote_cli/view_titles.py", line 18, in __init__
    urwid.SimpleFocusListWalker(self.get_note_titles()))
  File "/usr/lib/python3.7/site-packages/simplenote_cli/view_titles.py", line 143, in get_note_titles
    lines.append(self.get_note_title(n.note))
  File "/usr/lib/python3.7/site-packages/simplenote_cli/view_titles.py", line 128, in get_note_title
    return urwid.AttrMap(self.format_title(note),
  File "/usr/lib/python3.7/site-packages/simplenote_cli/view_titles.py", line 49, in format_title
    t = time.localtime(float(note['modificationDate']))
KeyError: 'modificationDate'

From my snclirc:

cfg_format_strftime = %d %B %Y
cfg_format_note_title = %F|%-N %T|%D

I did a re-install using yaourt and I get the same error. I don't know what other information might be helpful.

1094 commented 5 years ago

I did a full system update, removed ~/.sncli, and did a full snyc. I'm not sure which combination of three corrected the problem, but it did. sncli now loads properly.

samuelallan72 commented 5 years ago

Sorry for the delay in replying; this issue disappeared during the database issues Github was having. I'm glad you sorted it out. For reference, it would have been removing ~/.sncli that solved it. The note schema has changed slightly so old notes in the local database can cause crashes. More info in the release notes for version 0.3.0.