1

I recently encountered a problem using Threema on LineageOS 15.1: I noticed that whenever I want to download a picture posted by someone else in a conversation, I get the message "Could not download message". A logcat reveals, that an excepction is thrown when opening the file:

java.io.FileNotFoundException: /storage/emulated/0/Android/data/ch.threema.app/files/data.blob/017c31a18e3325c75d3564fd3565b144

I used adb shell (as root) to create an empty file:

# whoami
root
# echo "" > /storage/emulated/0/Android/data/ch.threema.app/files/data.blob/017c31a18e3325c75d3564fd3565b144
sh: can't create /storage/emulated/0/Android/data/ch.threema.app/files/data.blob/017c31a18e3325c75d3564fd3565b144: Invalid argument

So the same error occurs in the shell, even if I am logged in as root. Apparently, once the file is created, it can't be written to:

# echo "asd" > 017c31a18e3325c75d3564fd3565b    
# echo "asd" > 017c31a18e3325c75d3564fd3565b
sh: can't create 017c31a18e3325c75d3564fd3565b: Invalid argument

The permissions of newly created files are set to

-rw-rw---- 1 u0_a71 sdcard_rw 4 2018-12-31 13:45 017c31a18e3325c75d3564fd3565b

Any ideas what is causing this? Is this a misconfiguration / permission issue? Or is this a problem with the file system (I used both f2fs and fat32)?

  • Can you use strace? Do you have SELinux enforcing? – Irfan Latif Dec 31 '18 at 22:41
  • strace yields openat(AT_FDCWD, "/storage/emulated/0/Android/data/ch.threema.app/files/data.blob/017c31a18e3325c75d3564fd3565b144", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = -1 EINVAL (Invalid argument) – hfhc2 Jan 3 at 14:06
  • As to SEAndrodi: getenforce => Permissive – hfhc2 Jan 3 at 18:59
  • dmesg tells me: WARNING: at ../../../../../../kernel/samsung/kminilte/fs/sdcardfs/inode.c:743 sdcardfs_setattr_wrn+0x48/0x60(), sdcardfs does not support setattr. User setattr2. – hfhc2 Jan 3 at 23:57
  • That's the thing. Problem is with emulated filesystem. You can try direct path /data/media/0/Android/data/ch.threema.app/files/data.blob/ (ext4 or f2fs whatever) and it should work. Also try with short filename. Need to check sdcardfs source to see why it can't handle this filename. – Irfan Latif Jan 5 at 0:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.