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

Error: adb:preparesystemimage: Error: {"error":{"code":1,"cmd":"adb -P 5037 shell mkdir -p /cache/recovery"},"stderr":"mkdir: '/cache/recovery': Required key not available"} #2155

Open
strangeli opened this issue Sep 30, 2021 · 21 comments

Comments

@strangeli
Copy link

UBports Installer 0.8.9-beta (deb)
Environment: Ubuntu 18.04.6 LTS Bionic Beaver linux 5.4.0-84-generic x64 NodeJS v12.18.3
Device: FP3
Target OS: Ubuntu Touch
Settings: undefined
OPEN-CUTS run: N/A
Log: N/A

I don't know...

@luksus42
Copy link

luksus42 commented Oct 3, 2021

Hi, did you check the 'wipe' option in tje installer?
If not, please do it (it will reformat datapartion and delete possibly existing userdata) and try again.

@Fuseteam
Copy link

Fuseteam commented Oct 5, 2021

appearent according to https://forum.xda-developers.com/t/im-having-problems-with-twrp-and-orangefox-permission-errors-all-the-time.4203951/ this may be related to an encrypted data partition, perhaps you can boot into recovery and wipe that partition

@werA111
Copy link

werA111 commented Oct 6, 2021

same problem on OS Ubuntu 20.04.3 LTS, Device FP3
I had /e/ Android 10. Tried to wipe data in UBports recovery mode and checked UBports Recovery log "wipe failed"

@luksus42
Copy link

luksus42 commented Oct 6, 2021

@werA111 So, did you check the "wipe" option in the installer initially? Please answer under my comment and do not always edit yours.

@werA111
Copy link

werA111 commented Oct 6, 2021

Yes, I checked the wipe option.
Also tried from Ubuntu: adb shell recovery --wipe_data, got error on phone display

@luksus42
Copy link

luksus42 commented Oct 6, 2021

Ok.
So as I experienced, regardless of the wipe issue, booting UT on an FP3 with previously installed /e/ OS does not work.

Please download the latest Fairphone OS version here: https://fileshare.fairphone.com/link/i0qPDlRAisSkrxibkQyt13/download/FP3-REL-Q-3.A.0129-20210805.135600-user-fastbootimage.7z
They made a mistake on that package though: If the linux-x86 directory in it is still empty, download this https://www.androidfilehost.com/?fid=7161016148664813484 and replace it.

Then flash it (there is a flash script in it). (For further instructions see: https://support.fairphone.com/hc/en-us/articles/360048050332)

Then try Ubports-Installer again with wipe.

@strangeli
Copy link
Author

I used this one here last time to get Android 10 back on which worked fine (the link from the ubports-installer):

https://androidfilehost.com/?fid=7161016148664787652

(Still have not tried the wipe option though, will do in the coming days)

@luksus42
Copy link

luksus42 commented Oct 7, 2021

I used this one here last time to get Android 10 back on which worked fine (the link from the ubports-installer):

https://androidfilehost.com/?fid=7161016148664787652

I prepared this one to not reflash the userdata partition, so I think it won't help with the "Required key not available" issue. That is why I revommended the original Fairphone OS update package.
Though, if someone could check if my assumption is right, this would be much appreciated.

@werA111
Copy link

werA111 commented Oct 7, 2021

Ok. So as I experienced, regardless of the wipe issue, booting UT on an FP3 with previously installed /e/ OS does not work.

Please download the latest Fairphone OS version here: https://fileshare.fairphone.com/link/i0qPDlRAisSkrxibkQyt13/download/FP3-REL-Q-3.A.0129-20210805.135600-user-fastbootimage.7z They made a mistake on that package though: If the linux-x86 directory in it is still empty, download this https://www.androidfilehost.com/?fid=7161016148664813484 and replace it.

Then flash it (there is a flash script in it). (For further instructions see: https://support.fairphone.com/hc/en-us/articles/360048050332)

Then try Ubports-Installer again with wipe.

I'v got Fairphone OS and tried UBports again but same issue "Required key not available".
I think I have a problem with formating partitions...

@werA111
Copy link

werA111 commented Oct 7, 2021

This is my log from /tmp/last_kmsg in UBports Recovery menu:
IMG_20211007_125203
IMG_20211007_130802
Thank you for helping me.

@luksus42
Copy link

luksus42 commented Oct 7, 2021

Grrrr... ok, next try:

  • If don't have it already, please download TWRP recovery for FP3 (https://twrp.me/fairphone/fairphone3.html)
  • boot it temporarily with fastboot boot twrp-3.5.2_9-0-FP3.img
  • in twrp, wipe data and cache (also dalvik)

then try installer again...

@werA111
Copy link

werA111 commented Oct 12, 2021

Thanks everyone for help especially @luksus42 , it worked!

@luksus42
Copy link

@strangeli , is it solved for you too?

@strangeli
Copy link
Author

strangeli commented Oct 18, 2021

@luksus42
Since I am really new to smartphone stuff, I need to find out first how to use this twrp etc. I downloaded the installer so far but now I am still lost what to do next. But did not have the time to check it in more detail so far (since I need my phone regularly). Thank you for asking though. If I am really stuck I will let you know again.

Just to save some time: Since I still have /e/ OS now, I need to flash Android anyway before using TWRP? @werA111 did you?

@luksus42
Copy link

Just to save some time: Since I still have /e/ OS now, I need to flash Android anyway before using TWRP?

Yes, you should install latest fairphone OS (Android 10) before installing Ubuntu Touch. Maybe TWRP is not needed then anymore. Only if you run into the same issues like before, you should try the TWRP wipe way.

@strangeli
Copy link
Author

Without TWRP I tried several times (with Android 10), I always had that issue. I just wondered if I can skip the Android installation if I wipe with TWRP directly. But I will go the full path then...

@luksus42
Copy link

luksus42 commented Nov 7, 2021

This will be solved by:
ubports/installer-configs#152

@luksus42
Copy link

luksus42 commented Nov 7, 2021

@strangeli

I just wondered if I can skip the Android installation

No, it's needed to flash some partitions to it's "original" state.
As far as I know its mostly about the vendor partition. But that needs to be tested.

@NeoTheThird
Copy link
Member

looks like this is still happening in 0.9.3-beta:

stack trace: Error: {"error":{"code":1,"cmd":"adb -P 5037 shell mkdir -p /cache/recovery"},"stderr":"mkdir: '/cache/recovery': Required key not available"}
from https://ubports.open-cuts.org/run/6233865155cdf00008ffa3f9

Am i understanding https://github.com/ubports/installer-configs/pull/152/files correctly that the user simply needs to enable wipe and try again? In that case, we could just add some error handling for Required key not available and display an appropriate generic message. Would that make sense?

@NeoTheThird
Copy link
Member

we could also use a handler for this, see ubports/installer-configs#175

@luksus42
Copy link

@NeoTheThird

Am i understanding https://github.com/ubports/installer-configs/pull/152/files correctly that the user simply needs to enable wipe and try again? In that case, we could just add some error handling for Required key not available and display an appropriate generic message. Would that make sense?

It depends on how the installer-config is implementing the "wipe" option. In the case of the FP3, a simple reformatting was not sufficent, but a "fastboot:erase" of the userpartition beforehand did the trick...

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

5 participants