[Multi-user][Android] User data get deleted and lost, device reset

Thank you both for your encouragements!

Despite it really makes me tired when this reset happens, Multi-User is really the perfect solution for a privacy in conjunction with Android user.
Without separating users, there is no real privacy with Android IMO.
Android is liquid and leaks in a lot of places in the phone (or makes datas to leak into it).
To be more strictly verified but IIRC, I found some of my data into:


And probably other places.
My belief is that authorisations don’t really protect against data theft.
As I have no time and competences to verify my beliefs, scan all the FS and sniff all the traffic, Multi-User is perfect for me.

I thought I’coul’d try multi-user once again, without PM.
But if you @dcaliste say it happaned to you also without PM installed, I think I’ll reconsider the question and maybe live without Android…
@nephros, I keep my second phone ready. If there is a modified version of PM you’d like me to try, just say!

Lovely, thank you! Hopefully (for PM) nothing will come of it though.

Really wierd!
If I

  • Restore the rootfs and home (dev/mmcblk0p76)with dd
  • Boot, log in Device Owner (defaultuser)
  • Start Android Support
  • Log out/in to secondary user

I get nuked, “Ahoj”, reset. 100% (4 of 4 tries)

I I uninstall PatchManager before the above steps, I couldn’t reproduce.
But if I reinstall PM and re-enable patches, even reboot, I am still not able to reproduce.


The same if I enable debug symbols on home partition

1 Like

Some dd later…
No, more I try, more I think it is not PM related.
Even if I just try enabling debug symbols on home partition without to go online to get the packages, and come back to settings, the problem doesn’t occurs anymore.
Some fragile bug stuck somewhere seems easily to make fall and disapear…

1 Like

Details added in paragraph “Modifications”

1 Like

Thanks for the super-detailed report and investigation @ric9k. I’ve created an internal bug report about this and tagged it as “tracked”.

Can I please double-check that you ruled out PatchManager as a factor? That’s what I understood from reading through, but there’s still a fragment of doubt in my mind that it would be helpful to clear up.

One thing to add:

There have been versions of MyBackup which have a bug in the RPM uninstall script where it literally does a rm -rf ~.

While I can’t see how this would trigger through a user switch, have any of you that were affected had MyBackup installed?

Unfortunately, I don’t remember much more than what I wrote.
But when it happened, I didn’t touch anything in PM before.

Perhaps interresting for you:
I still have the disk image of the system just before nuke happens.
I can restore it and be able to reproduce.
If you indicate me a way to log everything happening into the phone, I could try and report.

1 Like

Indeed, I have MyBackup installed. (but finally never used)
Also here, I could delete the concerned file (the one containing rm -f) and try to reproduce.

Or, to avoid changing too much things, I could temporarly rename the rm command, prior to try reproducing…

For general debugging, I guess the Jolla team must answer that.

For the patchmanager preload library there is the enviromnent variable PM_PRELOAD_DEBUG which makes it verbose (but will log to stdout/stderr which would need to be captured).

For the daemon there is /var/lib/environment/patchmanager/10-dbus.conf where you can set the debug environment to true and restart the service.

Enabling persistent journal would be the first step for sure.

1 Like

Re: MyBackup you can’t edit the script because it’s in the rpm file.
And busybox rm is a symlink to busybox itself, or a builtin, so no moving it out of the way either.

But if it is uninstalled and triggers the rm there should be some output in /var/log/zypp/history, I expect lots of permission denied messages.

But actually the MyBackup bug should nuke the whole system, not just home, so it’s probably unrelated.

1 Like

You can however create this script and temporarily point the /usr/bin/rm symlink to it:

echo "rm called: " $0 $* > /dev/stderr
echo -n "rm parent: "$PPID ": " > /dev/stderr
tr "\0" " " < /proc/$PPID/cmdline > /dev/stderr
echo > /dev/stderr
exec /usr/bin/busybox rm "$@"

This issue happened to me yesterday, when switching between default user and guest (Access disk of device not starting properly). I did have patchmanager installed, so I haven’t been able to rule that cause out.

What I did find was that when I tried to start Jolla-settings from icon it failed to start. But when starting from terminal it successfully launched, though with warnings that “manager” couldn’t be created (can’t remember the exact wording) and that the database was locked. Will try to recreate the behavior when I have more time.

Sorry to hear you experienced this @Mohjive, but thanks for reporting it.

1 Like

Did you start or stop Android Support just before changing user?

I never manually start or stop Android service. It may have been OOM killed, before I tried to switch to guest user, or implicitly started by me launching an Andoid app.

Unfortunately I can’t recall the exact details, as I was focusing on the user switching rather than Android support :smiley:

I have also experiencing and user data deletion after switching to a secondary user.

I have Android support, but noting special do with it. Although Android data are not lost, in contrary to other sailfish user data.

I don’t tried to re produce it. But what I identified as having done is :

  • from admin user (defaultuser) ask switching to a secondary user (not used for month) from interface
  • rapidly after switched, ask to switch again to admin user
  • when logged to admin user, the profiled was reset to new user, and “first startup setup” was launched.

This is very annoying, If I have a save, this one is over a month old.

Sorry it happened to you too.
Do you remember if Android Support was On while you did the described steps?

Yes, I supposed y than Android support was On.
I never stop it explicitly, and have application than start in background (like messaging app Element)