tnakamur / android_manifest_google_sunfish

1 stars 1 forks source link

TWRP backup: failed to lookup fscrypt tar policy for '/data/bootchart' #2

Open strlcat opened 3 years ago

strlcat commented 3 years ago

I'm trying to use TWRP backup feature but it very shortly ends up with "createTarFork() process ended with ERROR: 255". Inside recovery.log in directory with failed backup I find this line: failed to lookup fscrypt tar policy for '/data/bootchart'. Do you have any idea how to quickly fix it? I have build tree ready to test. Branch is twrp-11. I am able to successfully decrypt the storage & data with my phone password and browse contents clearly.

tnakamur commented 3 years ago

Which FW, kernel and aosp version do you use? I'll test it with same version. Could you upload full recovery.log anywhere?

tnakamur commented 3 years ago

Maybe this gerrit source fix it. https://gerrit.twrp.me/c/android_bootable_recovery/+/4231

strlcat commented 3 years ago

@tnakamur ,

Which FW, kernel and aosp version do you use? I'll test it with same version. Could you upload full recovery.log anywhere?

I use LineageOS 18.1, kernel 4.14.212-g0b2dba64c29d-dirty (I have replaced yours kernel in repo with mine, but it works okay) and Android 11. I do fastboot boot twrp.img to not to interfere with stock recovery. I'll upload recovery.log shortly when I'll get back from work.

P.S. Both in TWRP and booted phone do have /data/bootchart as empty directories.

strlcat commented 3 years ago

Here is recovery.log

tnakamur commented 3 years ago

There is almost the same error at xda thread.

It says, "This error pertains to the parallel apps or multi user ID. If you are not sure if you have parallel apps running on your phone, you can do a quick check by going into your Root browser and look in these locations.

/storage/emulated /data/system/ data/system_ce/ data/system_de/ data/misc/ data/misc_ce/ data/misc_de/ data/user/ data/user_ce/ data/user_de/

If you see any folder named 999 then you have parallel apps enabled on your device. TWRP in it's current form will not allow you to create a backup or restore a backup with parallel apps enabled."

Could you check the above?

strlcat commented 3 years ago

Tested with following result:

/data/root # find /storage/emulated/ -type d -name 999                                                                                     
find: /storage/emulated/: Permission denied
/data/root # find /storage/emulated/0/ -type d -name 999
/data/root # find /data/system/ -type d -name 999                                                                                          
/data/root # find /data/system_ce/ -type d -name 999                                                                                       
/data/root # find /data/system_de/ -type d -name 999                                                                                       
/data/root # find /data/misc/ -type d -name 999                                                                                            
/data/root # find /data/misc_ce/ -type d -name 999                                                                                         
/data/root # find /data/misc_de/ -type d -name 999                                                                                         
/data/root # find /data/user/ -type d -name 999                                                                                            
/data/root # find /data/user_ce/ -type d -name 999                                                                                         
find: '/data/user_ce/': No such file or directory
/data/root # find /data/user_de/ -type d -name 999

No such directory exists. BTW ignore storage "permission denied", it's due to how fuse mntpoint resides here. I am also the only phone user and did not even attempt to create more users here. Is "999" a full name? Did I miss something?

strlcat commented 3 years ago
/data/root # pm list users                                                                                                                 
Users:
    UserInfo{0:Rys Andrej:c13} running
strlcat commented 3 years ago

Maybe this gerrit source fix it. https://gerrit.twrp.me/c/android_bootable_recovery/+/4231

Did build with this diff, still exact same result in recovery.log

akha666 commented 2 years ago

Any update regarding to this issue? I'm facing the same error for backing-up miui.eu and offical twrp twrp-3.6.1_11-0. The log ended with the same error

I:addFile '/data/extm' including root: 1
  ==> set selinux context: u:object_r:extm_data_file:s0
failed to lookup fscrypt tar policy for '/data/extm' - 'fb639a910019a846a829a193a5816404'
I:Closing tar
Splitting thread ID 0 into archive 7
I:addFile '/data/extm/tQDUsDAAAAQJugqoKlQVUsr6ebQCiz7W' including root: 1
  ==> set selinux context: u:object_r:extm_data_file:s0
I:Error adding file '/data/extm/tQDUsDAAAAQJugqoKlQVUsr6ebQCiz7W' to '/data/media/0/recovery/BACKUPS/410f5ead/2022-04-17--17-30-08/data.f2fs.win006'
Error creating backup.
I:ERROR tarList for thread ID 0
Error creating backup.
I:InfoManager saving '/data/media/0/recovery/BACKUPS/410f5ead/2022-04-17--17-30-08/data.info'
createTarFork() process ended with ERROR: 255
Backup Failed. Cleaning Backup Folder.
akha666 commented 2 years ago

I've found the fix. Actually I don't have multi accounts Also screen lock and finger print are removed. '/data/extm' is created by Xiaomi for second space feature, after deleted, the backup successfully completed. open terminal in twrp and excute this command >> # rm -Rf /data/extrm