Home / GitHub Page

Android 1.0.311: crash due to undeletable stale data?

System specs

  • Android Joplin v1.0.311 (also a problem on vs 1.0.310 and 1.0.279)
  • Android v7.0
  • I am unable to provide a log because the app crashes before I can ask it to make a log.

Basic Question

How do I delete Joplin’s data cache? It appears that some stale data is causing it to crash, and nothing I do can obliterate that stale data!

Maybe pertinent details

  • I synchronize to the file system, then use syncthing to synchronize my files between my laptop and phone.

Issues started to occur after I did a number of things on my laptop.

  • added a bunch of notes (seems like an unlikely cause of the problems)
  • added some unicode pictographs to the end of my notebook titles
  • deleted a conflicting note on my laptop

Things I tried

At this point, I believe there is some stale application data that I simply do not know how to remove. Here is how I arrived at this conclusion:

Hypothesis: Unicode Issues :-1:

I initially assumed that this problem arose from the Unicode characters in the note titles, so I changed them on the laptop, ensured that syncthing had synchronized the underlying files to the phone, and attempted to re-open the application. I have just enough time to pull up a list of notebooks before it crashes. In those moments I can see that the app no longer thinks the Unicode characters are there, so clearly the Unicode characters were not the issue.

Hypothesis: Delete All Notes :-1:

Figuring that a clean slate would fix the problem, I changed my laptop’s working folder, then deleted the contents of the old folder. (So, I can still safely use Joplin on my laptop.) The phone’s data folder is now empty. If this worked, I figured I would copy notes back, one at a time, until I found the offending note. However, when I started the application on the phone it still crashed. Furthermore, it brought me back to my previous state, displaying the contents of the most recently open notebook. That notebook and all notes in it no longer exists!! This means the app has stored the most recently opened notebook and the titles of its notes somewhere.

Hypothesis: Delete App Data :-1:

OK, so then I went into Android Settings :arrow_right: Apps :arrow_right: Joplin, force stopped it, and cleared the stored data (Clear Data button). I figured this would remove all of Joplin’s prior knowledge about notes on the system. However, it still crashes, and furthermore it still brings up the old notebook and its contents. At this point, the files are gone, and all of Joplin’s application data should be gone, too. How on Earth could it be displaying this stale information? And, is this stale information the source of the crash?

Hypothesis: Uninstall and Reinstall the App :-1:

I came across this for a similar problem:

I tried uninstalling and reinstalling the app and it still crashed. I then made sure to delete the application data first, then uninstall and reinstall, and that still failed. It still loads the stale last-opened-notebook with the note listing.

Hypothesis: Downgrade the App :-1:

I then cleared the app data, uninstalled it, and installed prior versions. I first tried v1.0.310, then v1.0.279. Both of them crashed with the same behavior.

Hypothesis: Use v1.0.181 :-1:

I saw somebody mention that the 100-series worked for them when a newer series was crashing, so I tried to install v1.0.181. That runs fine! I was even able to tell it to look at the new synced folder, but it did not like something about the files. I assume the file format changed in the jump to the 200 series.

Hypothesis: Use v1.0.181 to change settings, then upgrade :-1:

This failed. It seems that the 100-series application settings do not intersect with the 300-series settings.

What actually happens when I start the app?

When I start the app, I have between two and five seconds in which I can do things. The thing I can do which gives a clear user feedback is to pull up the list of notebooks/menu (menu button in :arrow_upper_left:). Usually it crashes before I can select anything, but occasionally it does not crash. I can then scroll up and down in the list of notebooks. However, the application does not do anything either when I select a notebook or when I choose the Synchronization or Configure menu options.

The fact that Joplin leaves behind data after an uninstall points to a bug. I’m just not sure where. Android reserves space for an app. However, this space is scrapped as soon as the app is deleted.
I’m not sure how it is even technically possible to persist data between installs unless you use an external file system, which Joplin doesn’t - except for syncing to file system, in which case it is your respobsibility to clear the sync target.

The app specific data location used for settings (internal sqlite3 database) and local notes/resources should not survive a deletion of the app.

It might help if you could provide a crash log https://joplinapp.org/debugging but as @tessus said it’s unlikely that Joplin is leaving data behind after uninstall. We only use the /data dir, which is wiped out when uninstalling.

I took a bug report using developer mode, but the zipped attachment is too large for me to attach it here. Where should I send it? The instructions state that “To share the bug report, tap the notification.” But where should I send it?

I noticed that was listed on Google’s Play page for Joplin, so I sent the bug report there. Let me know if there is somewhere else it should go!

Also, @laurent, @tessus, I understand how precious developer time is for this kind of project and I am sure there are higher priorities than sorting out this specific bug. I strongly suspect that the problem is from a corrupt file and if I delete that file and reinstall the app, everything will be fine. Which directories should I double-check for emptiness after an uninstall?

I have factory reset my phone, yet it still crashes.