Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore problem: error looking up proper e4crypt policy #4

Open
r4in31337 opened this issue Aug 24, 2018 · 1 comment
Open

Restore problem: error looking up proper e4crypt policy #4

r4in31337 opened this issue Aug 24, 2018 · 1 comment

Comments

@r4in31337
Copy link

Hello,

I have a fully working backup - I conclude that, because I can easily extract it on my PC. I am unable to restore this backup on my phone (Oneplus 5t) with TWRP.

I always get the error above when I try to restore the data partition of my backup - I have also described the problem in detail on XDA in this post: https://forum.xda-developers.com/showpost.php?p=77343788&postcount=180 and in this issue post: TeamWin/Team-Win-Recovery-Project#1302

Other partitions can be restored jut fine. As I said, I am reasonably sure that the backup is not corrupted, since I can untar it with ease.

Since there are many threads on XDA (but none with a working solution), I tried to restore the backup manually on the device using tar. For this, I ran these commands using adb shell in order to manually extract /data and have the remaining partitions recovered by the TWRP restore function in order to hopefully get a fully working device again:

tar -xvf ./data.ext4.win000 -C /
tar -xvf ./data.ext4.win001 -C /
...
tar -xvf ./data.ext4.win010 -C /

This does extract the data partiion but seems to somehow corrupt /system. After that, /system cannot be mounted anymore (only read only).

Do I need to run commands other than these untar-commands above in order to make the restore process work? When I reboot my phone with /system corrupted (I get "failed to mount /system ( structure needs cleaning)" after my manual attempts from before.

Here is the relevant part of my log file:

......
did not find newline char in expected location, continuing anyway...
==> extracting: //data/local/ (mode 40751, directory)
restoring policy 1DK > '9651c6d66c70984e' to '//data/local/'
did not find newline char in expected location, continuing anyway...
==> extracting: //data/local/tmp/ (mode 40771, directory)
restoring policy 1DK > '9651c6d66c70984e' to '//data/local/tmp/'
did not find newline char in expected location, continuing anyway...
==> extracting: //data/data/ (mode 40771, directory)
Cannot find key for 0error looking up proper e4crypt policy for '//data/data/' - 1CE0
tar_extract_file(): failed to extract //data/data/ !!!
I:Unable to extract tar archive '/data/media/TWRP/BACKUPS/860fb61e/endlich/data.ext4.win000'
Error during restore process.
I:TWFunc::Set_Brightness: Setting brightness control to 0
I:TWFunc::Set_Brightness: Setting brightness control to 255

Thanks a lot.

@akorn
Copy link

akorn commented Jan 3, 2022

I hit a similar issue. Apparently a guest user (id 10) had been created on the phone before the backup was taken, and while there was no warning during the backup, the backup can't be restored due to the "error looking up proper e4crypt policy" issue.

I would be great if it were possible to ignore these errors and just proceed with the restore.

I tried to delete the affected files (directories) from the archive using tar --delete, but that doesn't work either due to the nonstandard headers TWRP inserts into the file. Now restoring fails with

restoring policy 1DE0 > 'b8615c1b2fc6c2b9' to '//data/user_de/0/com.google.android.inputmethod.latin/cache/BundledEmojiListLoader/BundledEmojiListLo'
  ==> extracting: //data/user_de/0/com.google.android.inputmethod.latin/cache/BundledEmojiListLoader/BundledEmojiListLo (file size 536 bytes)
tar_extract_file(): failed to extract //data/user_de/0/com.google.android.inputmethod.latin/cache/BundledEmojiListLoader/BundledEmojiListLo !!!
I:Unable to extract tar archive '/data/media/0/TWRP/BACKUPS/d03974b7/2021-12-27--08-23-35/data.ext4.win013'
Error during restore process.

Additionally, I believe TWRP should warn about this problem during backup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants