linuxmint / sticky

A sticky notes app for the linux desktop
GNU General Public License v2.0
187 stars 40 forks source link

Sticky won't open #55

Closed monoprix closed 2 years ago

monoprix commented 2 years ago

Hi, I just noticed that I didn't have my notes up on desktop. I tried opening Sticky from the menu a few times and it seemed to just crash again and again. So then I tried to open Sticky from the terminal and got the response pasted below.

I attempted to uninstall, reboot, reinstall, reboot but the error remained.

I know you're all busy, so I certainly appreciate any thoughts you might have on how I might be able to fix this.

`sticky Traceback (most recent call last): File "/usr/lib/sticky/sticky.py", line 642, in do_activate self.file_handler = FileHandler(self.settings, self.dummy_window) File "/usr/lib/sticky/common.py", line 44, in init self.load_notes() File "/usr/lib/sticky/common.py", line 52, in load_notes info = json.loads(file.read()) File "/usr/lib/python3.8/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8d in position 1: invalid start byte Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook with os.fdopen(os.open(pr_filename, FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_lib_sticky_sticky.py.1000.crash'

Original exception was: Traceback (most recent call last): File "/usr/lib/sticky/sticky.py", line 642, in do_activate self.file_handler = FileHandler(self.settings, self.dummy_window) File "/usr/lib/sticky/common.py", line 44, in init self.load_notes() File "/usr/lib/sticky/common.py", line 52, in load_notes info = json.loads(file.read()) File "/usr/lib/python3.8/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8d in position 1: invalid start byte`

collinss commented 2 years ago

Based on the error, it looks like the file where the notes are stored may have become corrupted. Try opening the file ~/.config/sticky/notes.json in a text editor and see if the editor picks up any errors. Also, if there are any backups in that folder, you could restore one of them. Just rename the backup to notes.json and then restart sticky (make sure to keep a copy of the old one before renaming the backup, just in case). If all else fails, you should be able to get back to a working state by renaming the existing notes.json file or moving it to another location, though you'd have to start from scratch.

monoprix commented 2 years ago

Yep. You were right. Notes.json looked bananas in the text editor, so I renamed the last backup to notes.json which allowed Sticky to open up normally.

Any thoughts on how the file might have gotten corrupted?

At any rate, thanks for your help!

collinss commented 2 years ago

Any thoughts on how the file might have gotten corrupted?

Not really. It could have been anything from a hard drive error, to the process getting interrupted while the file was being written to (such as with a power outage), to a random neutrino hitting at just the right spot, or any other number of things.

At any rate, thanks for your help!

Any time!