TrungNguyen1909 / qemu-t8030

iPhone 11 emulated on QEMU
Other
2k stars 210 forks source link

Error handleConnectResult new session to port 62078 failed: 61 #75

Closed Duy-Thanh closed 2 years ago

Duy-Thanh commented 2 years ago

This is the next error I got after issue #73 where i got idevicerestore not working error because of Segmentation fault. (the patch in the comments worked for me, so you can use it. However, don't expect it to work with anything other than the N104AP i.e. iPhone 11. We'll need it. a general fix for idevicerestore to work with all devices)

When I restore iOS, when idevicerestore comes to the part:

About to send filesystem...

There will be two errors (these two are really random in different runs, but I believe there will be a common way to fix it, since they both point to the same error written in the program log after all iOS emulator):

idevicerestore log (attempt 1):

Using ApTicket found at root_ticket.der length 8931
idevicerestore 1.0.0-96-g610b186-dirty
progress: 0 0.000000
progress: 0 0.100000
Found device in Restore mode
INFO: device serial number is C39ZRMDEN72J
progress: 0 0.200000
Identified device as n104ap, iPhone12,1
progress: 0 0.600000
Extracting BuildManifest from IPSW
progress: 0 0.800000
Product Version: 14.0
Product Build: 18A5351d Major: 18
Device supports Image4: true
Variant: Research Developer Erase Install (IPSW)
ERROR: Unable to find RestoreBehavior node
################################ [ WARNING ] #################################
# You are about to perform an *ERASE* restore. ALL DATA on the target device #
# will be IRREVERSIBLY DESTROYED. If you want to update your device without  #
# erasing the user data, hit CTRL+C now and restart without -e or --erase    #
# command line switch.                                                       #
# If you want to continue with the ERASE, please type YES and press ENTER.   #
##############################################################################
> YES 
progress: 1 0.000000
Checking IPSW for required components...
All required components found in IPSW
Using cached filesystem from 'iPhone11,8,iPhone12,1_14.0_18A5351d_Restore/038-44337-083.dmg'
progress: 1 0.200000
progress: 1 0.250000
progress: 1 0.300000
progress: 1 0.500000
progress: 1 0.700000
progress: 1 0.900000
About to restore device... 
Connecting now...
Connected to com.apple.mobile.restored, version 15
Device 00008030-1122334455667788 has successfully entered restore mode
Hardware Information:
BoardID: 4
ChipID: 32816
UniqueChipID: 1234605616436508552
ProductionMode: true
Starting Reverse Proxy
progress: 1 1.000000
ReverseProxy[Ctrl]: (status=1) Ready
Checkpoint 1621 complete with code 0
Checkpoint 1540 complete with code 0
Checkpoint 1679 complete with code 0
Checkpoint 1544 complete with code 0
About to send RootTicket...
Sending RootTicket now...
Done sending RootTicket
Checkpoint 1547 complete with code 0
Waiting for NAND (28)
Checkpoint 1549 complete with code 0
Updating NAND Firmware (58)
Checkpoint 1550 complete with code 0
Checkpoint 1551 complete with code 0
Checkpoint 1628 complete with code 0
Checkpoint 1552 complete with code 0
Checkpoint 1555 complete with code 0
Checkpoint 1662 complete with code 0
Checkpoint 1545 complete with code 0
Checkpoint 1683 complete with code 0
Unmounting filesystems (29)
Unmounting filesystems (29)
Unmounting filesystems (29)
Unmounting filesystems (29)
Unmounting filesystems (29)
Checkpoint 1637 complete with code 0
Checkpoint 1556 complete with code 0
Checkpoint 1620 complete with code 0
Checkpoint 1557 complete with code 0
About to send FDR Trust data...
Sending FDR Trust data now...
Done sending FDR Trust Data
Checkpoint 1558 complete with code 0
Checkpoint 1559 complete with code 0
Checkpoint 1560 complete with code 0
Checkpoint 1561 complete with code 0
Checkpoint 1562 complete with code 0
Checkpoint 1563 complete with code 0
Checkpoint 1633 complete with code 0
Unmounting filesystems (29)
Unmounting filesystems (29)
Unmounting filesystems (29)
Unmounting filesystems (29)
Unmounting filesystems (29)
Checkpoint 1565 complete with code 0
Checkpoint 1614 complete with code 0
Checkpoint 1567 complete with code 0
Checkpoint 1674 complete with code 0
Creating partition map (11)
Checkpoint 1569 complete with code 0
Checkpoint 1632 complete with code 0
Checkpoint 1570 complete with code 0
Checkpoint 1629 complete with code 0
Checkpoint 5645 complete with code 0
Creating filesystem (12)
Checkpoint 1624 complete with code 0
Checkpoint 1625 complete with code 0
Checkpoint 1626 complete with code 0
About to send filesystem...
ERROR: Unable to connect to ASR client
ERROR: Unable to connect to ASR
ERROR: Unable to send filesystem
ERROR: Unable to successfully restore device
Checkpoint 1627 complete with code 14
ReverseProxy[Ctrl]: (status=2) Terminated
ERROR: Unable to restore device

iOS emulator log of two attempts: Untitled 2.odt

Both point to wdog errors, but above all, persistent disconnection errors in the iOS simulator logs

I initially thought it was because of poor connection quality between the two VMs. But I dismissed that thought because it was silly, because they use direct connections and don't use any real network cards on my Mac.

nstarke commented 2 years ago

Can you post the idevicerecovery command with its arguments?

Duy-Thanh commented 2 years ago

Thank you, I fixed it and got iOS restored. Simply recreate root-ticket.der and it works. I don't know why but it accepted to restore with root-ticket.der recreated from the same shsh file :)