Open andreas1288 opened 5 years ago
I just came here to report this bug after finally arriving at the same conclusion after hours. You beat me by 6 hours. I don't use multiple profiles on my phone. However, I recently started using OnePlus' parallel apps feature which as far as I can see creates another user. My log includes this:
Invalid encryption mode 'ice:aes-256-cts'
Backing up Data (excl. storage)...
Backups of Data do not include any files in internal storage such as pictures or downloads.
Invalid encryption mode 'ice:aes-256-cts'
Breaking backup file into multiple archives...
I:Creating backup...
I:Creating tar file '/data/media/0/TWRP/BACKUPS/d926a0db/2018-11-29--13-46-42/data.ext4.win000'
I:addFile '/data/app-private' including root: 1
==> set selinux context: u:object_r:apk_private_data_file:s0
found policy '/data/app-private' - '1DK' - 'c3e7e70d67523c6b'
I:addFile '/data/mdm' including root: 1
==> set selinux context: u:object_r:oem_data_file:s0
found policy '/data/mdm' - '1DK' - 'c3e7e70d67523c6b'
I:addFile '/data/misc_ce' including root: 1
==> set selinux context: u:object_r:system_data_file:s0
I:addFile '/data/misc_ce/999' including root: 1
==> set selinux context: u:object_r:system_data_file:s0
failed to lookup tar policy for '/data/misc_ce/999' - '02df517b96db30dd'
I:Error adding file '/data/misc_ce/999' to '/data/media/0/TWRP/BACKUPS/d926a0db/2018-11-29--13-46-42/data.ext4.win000'
Error creating backup.
I:ERROR tarList for thread ID 0
Error creating backup.
I:InfoManager saving '/data/media/0/TWRP/BACKUPS/d926a0db/2018-11-29--13-46-42/data.info'
createTarFork() process ended with ERROR: 255
Backup Failed. Cleaning Backup Folder.
Device: OnePlus 6
TWRP version: 3.2.3-1 (installed the official twrp-installer-enchilada-3.2.3-1.zip
)
Well, I have to assume that these devices use FBE, as full logs weren't posted. I don't personally have this issue on my device (I use 3 separate user profiles), but I assume that's because my device uses FDE. It would be helpful if the beginning of the recovery logs were posted as well - they provide all of these details so I wouldn't have to ask...
I only posted the end of my log because I read that the important information is in the ending. Furthermore, it's 14 700 lines long and checking that many lines of text for privacy-relevant information is rather difficult.
I don't really know what part of the log you need. If you describe it (e.g. by means of approximate line number or by specific strings that occur in the log), I can check that part for privacy-relevant information and post the snippet.
Because you mentioned FBE:
$ grep -i -C 2 fbe recovery.log
I:Set page: 'trydecrypt'
I:operation_start: 'Decrypt'
I:Decrypting FBE for user 0
password filename is '/data/system/gatekeeper.password.key'
get_ce_key_directory_path 0: /data/misc/vold/user_keys/ce/0
--
I:addFile '/system/system/fonts/NotoSansPhoenician-Regular.ttf' including root: 1
==> set selinux context: u:object_r:system_file:s0
I:addFile '/system/system/fonts/NotoSerifBengali-Regular.ttf' including root: 1
==> set selinux context: u:object_r:system_file:s0
I:addFile '/system/system/fonts/DroidSansMono.ttf' including root: 1
--
I:addFile '/system/system/fonts/MYingHeiPRC-W7.ttf' including root: 1
==> set selinux context: u:object_r:system_file:s0
I:addFile '/system/system/fonts/NotoSerifBengali-Bold.ttf' including root: 1
==> set selinux context: u:object_r:system_file:s0
I:addFile '/system/system/fonts/NotoSerifLao-Bold.ttf' including root: 1
--
==> set selinux context: u:object_r:vendor_file:s0
I:addFile '/vendor/bin/init.qti.qseecomd.sh' including root: 0
==> set selinux context: u:object_r:init-qti-fbe-sh_exec:s0
I:addFile '/vendor/bin/log' including root: 0
==> set selinux context: u:object_r:vendor_file:s0
Thank for the reply. My device uses FBE as well. Sorry for the log. It was quite big (>1MB) and most people are glad if not megabytes of logs are posted. Unfortunately I don't have the full log any more. And I removed the user to be able to go on. I have successful logs from the same device which should answer all questions. However I would prefer not post it complete for privacy reasons.
I use the OnePlus 6T which has this issue. It uses FBE and the sdcard directory can be decrypted successfully with TWRP (based on device tree from https://github.com/TWINNFAMOUS/android_device_oneplus_fajita or https://github.com/mauronofrio/android_device_oneplus_fajita_TWRP). The OxygenOS "Parallel Apps" feature is implemented by creating a user with UID 999, apparently also using FBE encryption. In TWRP, files in /data/system_ce/999
have names like 952m2L0iiAVtOryyWHpECA and LbRor16iDIHzybmjNpUo4Ai8pfJ but are properly decrypted in OxygenOS.
The same problem occurs when using a Work Profile (similar to parallel apps), as referenced in the post above by @Mygod.
It would be nice if there were an option to simply ignore files that weren't owned by the primary user or, more generically, to simply ignore all errors and make a best-effort backup.
Please ignore that files on backup AND restore. So that the other user of profile will not be touched at all.
How could this issue be still open? I had the same problem and are very scared to update my phone because I am not able to do backups, because I setup a work profile. Are there only a few userswhich are affected by this problem?
Device: enchilada (Oneplus 6) Oxygen Stock-ROM... TWRP 3.3.1-2
@Manuel1948 I have the same problem. I haven't updated my OnePlus 6 in ages because I'm afraid of having to spend a lot of time restoring everything should something go wrong while updating or while rooting again. I can only do half-arsed backups because TWRP Backup stopped working.
Same issue here, but I have no idea if phone is using FBE, and if it is how to stop it using FBE.
These issues are all concerning, earlier I had a backup fail to restore, and its a 2 year old bug closed by a developer, I then find today I cannot make a backup either. A backup integrity bug in a backup program you would think is an urgent thing to fix.
I:Thread id 0 tarList done, 1 archives. I:Thread ID 0 finished successfully. I:InfoManager saving '/data/media/TWRP/BACKUPS/ceb3c546/1970-01-01--03-16-43/system.info' I:createTarFork() process ended with RC=0 I:Partition Backup time: 34 Invalid encryption mode 'ice:aes-256-cts' Backing up Data (excl. storage)... Backups of Data do not include any files in internal storage such as pictures or downloads. Invalid encryption mode 'ice:aes-256-cts' I:Creating backup... I:Creating tar file '/data/media/TWRP/BACKUPS/ceb3c546/1970-01-01--03-16-43/data.f2fs.win' I:addFile '/data/misc' including root: 0 ==> set selinux context: u:object_r:system_data_file:s0 found policy '/data/misc' - '1DK' - '2e6851d6ff7126d7' I:addFile '/data/misc/XdB,xdVLGAZ,o3uK0hYVTD' including root: 0 ==> set selinux context: u:object_r:recovery_data_file:s0 found policy '/data/misc/XdB,xdVLGAZ,o3uK0hYVTD' - '1DK' - '2e6851d6ff7126d7' I:addFile '/data/misc/XdB,xdVLGAZ,o3uK0hYVTD/Dv6sc2iE0QYHvAr+gS1nDCT9MYN' including root: 0 ==> set selinux context: u:object_r:recovery_data_file:s0 I:Error adding file '/data/misc/XdB,xdVLGAZ,o3uK0hYVTD/Dv6sc2iE0QYHvAr+gS1nDCT9MYN' to '/data/media/TWRP/BACKUPS/ceb3c546/1970-01-01--03-16-43/data.f2fs.win' Error creating backup. I:ERROR tarList for thread ID 0 Error creating backup. I:InfoManager saving '/data/media/TWRP/BACKUPS/ceb3c546/1970-01-01--03-16-43/data.info' createTarFork() process ended with ERROR: 255 Backup Failed. Cleaning Backup Folder. I:Copying file /tmp/recovery.log to /data/media/TWRP/BACKUPS/ceb3c546/1970-01-01--03-16-43/recovery.log
Thinking about this some more and given the restore bug problem, I think twrp should move to using dd dumps for backups. dd shouldnt care about encryption either so would mean as long as android stick to conventional partitioning it will be future proof.
--edit--
I have confirmed without FBE backup works.
Thinking about this some more and given the restore bug problem, I think twrp should move to using dd dumps for backups. dd shouldnt care about encryption either so would mean as long as android stick to conventional partitioning it will be future proof.
--edit--
I have confirmed without FBE backup works.
It's not as simple. The encryption, i.e saving of encryption keys is handled by TEE, it's a secured area in CPU. If you just copy the partition with dd and then restore it after reinstall of Android - it will not be decrypted even with a correct password, because the TEE will not trust the new Android anymore, I.e the keys in TEE will be erased during reinstall of Android. I tried it, unfortunately it is so.
@Senliast Can't you dd
the contents of the partition after decryption? I know too little about how it works in Android but usually on Linux if you have an entire encrypted partition, decrypting it yields a block device that is then mounted to gain access to the files. You can just start the decryption service and then dd
the plain text block device.
@Senliast Can't you
dd
the contents of the partition after decryption? I know too little about how it works in Android but usually on Linux if you have an entire encrypted partition, decrypting it yields a block device that is then mounted to gain access to the files. You can just start the decryption service and thendd
the plain text block device.
Hm, didnt noticed this in Android... Before entering the password in TWRP and after it, the userdata is still the same device.
The Error adding file '/data/misc_ce/999' to
error is related to the second profile can also be known as second/private/guest space/users and Dual/Twin/Parallel apps on your device and they must be disabled and related folders must be removed in order to backup successfully.
You can delete these folders manually or you can execute some commands to delete them. Depends on your choice.
If you can't disable second space-related settings, you can execute the following command as last resort pm remove-user 999
Open CMD or bash on your pc and connect to your phone via ADB and then execute the following command
adb shell
If you can't connect to a pc, you can install a terminal app from the play store.
Once you run adb shell
or open a terminal app, execute the following commands and they will remove the paths instantly.
su
pm remove-user 999
rm -rf /storage/emulated/999
rm -rf /data/system/999
rm -rf /data/system_ce/999
rm -rf /data/system_de/999
rm -rf /data/misc/999
rm -rf /data/misc_ce/999
rm -rf /data/misc_de/999
rm -rf /data/user/999
rm -rf /data/user_ce/999
rm -rf /data/user_de/999
rm -rf /data/vendor_ce/999
rm -rf /data/vendor_de/999
Similar error on my Samsung S9+:
I:Creating tar file '/external_sd/TWRP/BACKUPS/24cb2ddca30d7ece/2023-08-22--23-28-09_evolution_star2lte-userdebug_13_TQ3C2308050/data.ext4.win000' I:addFile '/data/mediadrm' including root: 1 ==> set selinux context: u:object_r:media_data_file:s0 I:addFile '/data/drm' including root: 1 ==> set selinux context: u:object_r:drm_data_file:s0 I:addFile '/data/drm/+yqYBP8PK6,8b9MJdSFutA' including root: 1 ==> set selinux context: u:object_r:drm_data_file:s0 I:addFile '/data/drm/+yqYBP8PK6,8b9MJdSFutA/EMii6GaOv7Xl02XGUxmAbD' including root: 1 ==> set selinux context: u:object_r:drm_data_file:s0 I:Error adding file '/data/drm/+yqYBP8PK6,8b9MJdSFutA/EMii6GaOv7Xl02XGUxmAbD' to '/external_sd/TWRP/BACKUPS/24cb2ddca30d7ece/2023-08-22--23-28-09_evolution_star2lte-userdebug_13_TQ3C2308050/data.ext4.win000' Error creating backup. I:ERROR tarList for thread ID 0 Error creating backup.
Device codename: payton TWRP version: twrp-3.2.3-1-payton.img
Backup of Userdata fails with error code 255 after a new profile was created. Before the creation it worked properly and could be restored.
WHAT STEPS WILL REPRODUCE THE PROBLEM?
Create a 2nd user profile on the phone.
WHAT IS THE EXPECTED RESULT?
Backup works and preferably includes the data of the other user profile.
WHAT HAPPENS INSTEAD?
The backup of user date exits with error code 255.
ADDITIONAL INFORMATION
The problem seams to be that the files of the other user profile are encrypted with a different key and cannot be read. There was no password nor pattern set on the new user profile/account.
/tmp/recovery.log
: Tail of logfile:==> set selinux context: u:object_r:system_data_file:s0 I:addFile '/data/system_ce/0/recent_images/811_task_thumbnail.png' including root: 1 ==> set selinux context: u:object_r:system_data_file:s0 I:addFile '/data/system_ce/0/recent_images/959_task_thumbnail.png' including root: 1 ==> set selinux context: u:object_r:system_data_file:s0 I:addFile '/data/system_ce/0/recent_images/960_task_thumbnail.png' including root: 1 ==> set selinux context: u:object_r:system_data_file:s0 I:addFile '/data/system_ce/0/recent_images/965_task_thumbnail.png' including root: 1 ==> set selinux context: u:object_r:system_data_file:s0 I:addFile '/data/system_ce/10' including root: 1 ==> set selinux context: u:object_r:system_data_file:s0 failed to lookup tar policy for '/data/system_ce/10' - '8b10156f1669aad3' I:Error adding file '/data/system_ce/10' to '/external_sd/TWRP/BACKUPS/ZY224KLBT9/2018-10-06--07-30-29/data.ext4.win001' Error creating backup. I:ERROR tarList for thread ID 0 Error creating backup. I:InfoManager saving '/external_sd/TWRP/BACKUPS/ZY224KLBT9/2018-10-06--07-30-29/data.info' createTarFork() process ended with ERROR: 255 Backup Failed. Cleaning Backup Folder. I:Copying file /tmp/recovery.log to /external_sd/TWRP/BACKUPS/ZY224KLBT9/2018-10-06--07-30-29/recovery.log
dmesg
: