gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

Fail to load project

Open dennist12 opened this issue 1 year ago • 5 comments

When I open the app, the error message displays 'Failed to load projects.' I have already restarted my computer, but I still get the same error.

OS: Windows 10 Gitbutler Version: v.0.12.27

image

dennist12 avatar Oct 03 '24 17:10 dennist12

It looks like the projects.json file is defective, so the initial app load fails without recurse.

Could you try renaming or removing it so it can start from scratch next time the application opens up?

As a fix for this, one could probably make the application-startup more resilient.

Byron avatar Oct 03 '24 20:10 Byron

The content of the projects.json file was malformed, but it has been fixed after I removed the file.

image

dennist12 avatar Oct 03 '24 21:10 dennist12

I am glad it worked, and thanks for showing the contents - maybe it's a lot of zeros?

In any case, I think since the file is so critical, ideally there is a way to workaround read-failures like this to have some sort of 'auto-fix'.

Since there are thoughts about moving the additional data into a sqlite database, which should be more robust, maybe that would also be the time to protect against corruption of vital resources to never get stuck.

Byron avatar Oct 04 '24 05:10 Byron

In notepad it's a empty white text.

That's good, or back up the project.json data in SQLite. If the file gets corrupted, the app can restore it automatically.

dennist12 avatar Oct 04 '24 12:10 dennist12

@dennist12, we're planning to eventually transition over to storing the majority of the app data in SQLite so we can have referential integrity and eliminate potential corruption.

Before we do that, as you say, we ought to try and resolve corrupted files, by at the very least defaulting it to empty.

Sorry for the inconvenience.

I'll leave this issue open with two action points being:

  • Gracefully recover from situations where state files are missing
  • Transition over to a harder-to-corrupt data type/

Caleb-T-Owens avatar Oct 04 '24 17:10 Caleb-T-Owens