Can not run android apps that use realm (e.g. Element) after updating to 4.5

To me it looks like it is trying some ad-hoc compilation of realm or some of it components and it cant find the cpp files, either because they are not there, or it does not have the permissions.

It would be good to know if the people where it is working got the file /tmp/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp somewhere.

Ahoy @jovirkku ,

Thank you for taking the time to look at the problem. Did you try to remove the Element and then reinstall it on 4.5 version? I had two working versions (installed before 4.5, one was cloned), I updated the first one and stoped working as described above. The second one was still working and unfortunately I uninstalled it and after I tried to install it again didn’t work too.

I would happily be at your disposal if you need help to investigate it further, logs / video from trying to start Element and fail, try different things let me know

Cheers

1 Like

@nas That was my experience too, after the Sailfish update I had two “Element” icons and one initially worked. Then when I updated Element it stopped working…

In general, is there a way that we can escalate this issue to get some more attention to it?

p.s. in the meantime I have been using Fluffychat instead of Element but it doesn’t provide notifications as well as Element did.

1 Like

You can always take a topic to a community meeting

I have returned from a vacation.

I did this now:

  • updated my test device Xperia 10 II from 4.5.0.18 to 4.5.0.19
  • installed Elements app v. 1.5.28 from Aurora Store
  • gave permissions for it in Settings > Apps > Element
  • tried to launch the app but it gets minimised to an app cover in a few seconds

Verdict: Broken. Does not work.

7 Likes

Hi,

In case someone has issues with storage, please check if the following would help. One device got fixed with this who had issues with WhatsApp especially.

devel-su
systemctl stop aliendalvik
chown 501023:501023 /home/defaultuser/android_storage /home/defaultuser/android_storage/Android 
chown 501023:501078 /home/defaultuser/android_storage/Android/data 
chown 501023:501079 /home/defaultuser/android_storage/Android/obb
systemctl start aliendalvik

cc: @goverton who had the issue in other thread.

1 Like

unfortunatley it does look like this won’t change anything for me:. (I did not run the chown commands)

$ ls -na /home/defaultuser/android_storage/Android
total 40
drwxrws--x    5 501023   501023        4096 Feb  2 16:54 .
drwxrwx---   16 501023   501023        4096 May 25 23:33 ..
drwxrws--x   51 501023   501078        4096 May 28 17:53 data
drwxrws--x    5 501023   501023        4096 Nov  4  2022 media
drwxrws--x    8 501023   501079        4096 May 29 23:15 obb

@jovirkku Could you get any insight on what is the cause of the issue?

And /home/defaultuser/android_storage permissions are the same also?

And /home/defaultuser/android_storage permissions are the same also?

Obviously so.

This should be ..

fill characters:

the shell is like regret
once you got it, you better never stop fighting it.

(sorry for that :wink:

1 Like

Indeed Element notifications, and even with Element I would like more noticeable notifications / sound / blue led etc. Fluffychat is a decent alternative and also has the option to add multiple accounts witch Element miss this functionality. A kind of work arround to no-notification problem I do is to run a sailfish matrix client: it might not has encryption support but at least I get notified.

Notify with ntfy and fluffychat works and configuration is “magique”

Could you share the “magique” way to have notifications with fluffychat ?!

I do nothing just installed fluffychat and ntfy

Launch ntfy
Launch fluffychat
In fluffychat go to settings notification, activate if not done and a subscription is done in nfty… Tada !!!

Thank you for the instructions @kaulian, I tried it, I run ntfy, I saw there the fluffychat, I saw a link to ntfy.sh but after that no notification on the sailfish… In fluffychat notification all settings are on (no setting for ntfy.sh) . Should the notifications go through ntfy.sh ? ( I wouldn’t like the notification goes out of the phone) Do I have to enable / activate anything else to have notifications on sailfish - like receiving sms kinda?

Thank you in advance!

If you use Element version from F-droid, there is no problem with notifications because it use there own pulling system, while the play store version relies on Google push service.

Perhaps in old time i did that

Try old version with register in unifiedpush.org

To add information to this ticket, I have this problem with apps that use realm on my new 10III, but not on my XA2 plus.
The 2 phones freshly flashed with 4.5.0.19 and no problem on the XA2.
@thigg, you noted you have this also on the XA2 ?

1 Like

Here are my observations done so far:

  • Initialized Realm database on former Sailfish OS version (4.4) works fine after migration to current release (4.5)
  • Re-initialization or installation of a new Realm-based application crashes with “File not found” error

Now what’s crashing it and what file is not found?

I compiled Realm and added debug output to see where the “File not found” is located as the error message shown in logcat output is misleading in thinking a .cpp file could not be compiled JIT. It simply shows the source code line number where a std_io error (file not found) was excepted. (see realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp at main · realm/realm-java · GitHub)

This brings in the JNI runtime bindings used by Realm. If a new database is going to be initialized a shared access thread tries to read the database file located inside the appsupport container at

/data/user/0/<name of your APK package>/files/<name of the Realm database file> (this is the file not found by the initialization shared Realm thread)

This path can be found at the host filesystem here:

[root@Xperia10II-DualSIM user]# pwd
/home/.android/data/user
[root@Xperia10II-DualSIM user]# ls -la
total 20
drwx--x--x    3 501000   appsuppo      4096 Feb  2 16:05 .
drwxrwx--x   46 501000   appsuppo      4096 Jun 11 00:46 ..
drwx------    2 501000   appsuppo      4096 Feb  2 16:05 0

However the 0 directory is mounted inside the appsupport container from /data/data/ so the host folder shows an empty directory here.

# mount | grep /data
/dev/mapper/luks-d60ed9d4-4192-4fcd-af04-b8e9d6f14d0c on /data type ext4 (rw,seclabel,noatime,errors=remount-ro,data=ordered,jqfmt=vfsv0,usrjquota=aquota.user)
/dev/mapper/luks-d60ed9d4-4192-4fcd-af04-b8e9d6f14d0c on /data/media/0 type ext4 (rw,seclabel,noatime,errors=remount-ro,data=ordered,jqfmt=vfsv0,usrjquota=aquota.user)
/dev/mapper/luks-d60ed9d4-4192-4fcd-af04-b8e9d6f14d0c on /data/user/0 type ext4 (rw,seclabel,noatime,errors=remount-ro,data=ordered,jqfmt=vfsv0,usrjquota=aquota.user)

That being said it looks like the initialization thread started by Realm JNI is either missing permissions to access the database file or it uses the plain (unmounted) /data/user/0 folder where no files are located.

Why I’m saying this?

Compared to a working Sailfish OS 4.4 appsupport container you’ll see that the /data/user/0 is symlinked to /data/data.

(Appsupport XA2, SFOS 4.4)

# ls /data/user -la
total 8
drwx--x--x  2 system system 4096 2019-11-29 13:56 .
drwxrwx--x 45 system system 4096 2023-06-14 08:54 ..
lrwxrwxrwx  1 root   root     10 2019-11-29 13:56 0 -> /data/data

versus

(Appsupport 10II, SFOS 4.5)

# ls /data/user -la
total 24
drwx--x--x  3 system system 4096 2023-02-02 16:05 .
drwxrwx--x 46 system system 4096 2023-06-11 00:46 ..
drwxrwx--x 73 system system 4096 2023-06-14 08:37 0

I’ve also tried to give full permissions to group and world on the applications data folder but still the file is not found. So in my opinion it has something to do with the mount vs. symlink difference between the new and old appsupport setup.

Cheers,
Nek

7 Likes