[One (M9) Q&A, Help & Troubleshooting] pleuhockle:
Dear all:

I would like to open this Q&A thread as I am experiencing the same behaviour described in this post.

When I select the menu option "Encrypt phone" in the Security menu, confirm the device pin, and confirm that the encryption should start (in all tests, the battery was at 95+ % at this point), the device restarts, briefly displays the twisted Android logo, then the LineageOS boot animation for less than one minute, and then restarts again.

This second restart leads to a boot loop where only the white HTC/powered by Android screen (including the red warning text) is displayed for a few seconds before the device briefly vibrates and restarts. I can break this boot loop only by holding the volume up, volume down, and power buttons until the device enters the bootloader. I can then boot to recovery and restore the backup I had created before attempting to encrypt the device.

This issue has only occurred since I changed from the last available CyanogenMod 13.0 nightly (cm-13.0-20161218-NIGHTLY-himaul) to the first LineageOS 14.1 nightly (lineage-14.1-20170411-nightly-himaul-signed). It also occurs using the latest LineageOS 14.1 nightly (lineage-14.1-20170418-nightly-himaul-signed).

My configuration is as follows:

HTC One M9 (himaul), bootloader unlocked, S-ON

Recovery: TWRP 3.1.0.0 (twrp-3.1.0-0-hima.img)

LineageOS versions affected: lineage-14.1-20170411-nightly-himaul-signed and lineage-14.1-20170418-nightly-himaul-signed

Device PIN: 8 digits, digits only, no other characters

External SD card: present

Prior to upgrading from CyanogenMod 13.0 to LineageOS 14.1, my device was on HTC firmware 3.35.401.32. The recovery was also TWRP 3.1.0.0. TWRP was able to decrypt my data partition.

In preparation for the upgrade from CyanogenMod 13.0 to LineageOS 14.1, I prepared my device as follows:

Full device wipe, including formatting of data partition.

Installation of HTC firmware 4.14.401.7 (through 0PJAIMG.zip, not RUU).

Completion of HTC device setup using HTC firmware.

Successful OTA update to HTC firmware 4.28.401.3.

Installation of TWRP 3.1.0.0.

Full device wipe, including formatting of data partition.

Installation of LineageOS Nightly of 11 April.

Installation of OpenGApps Nano of 11 April.

In order to potentially exclude various factors that I thought might possibly contribute to the error, I tried the following:

Not selecting a lock screen PIN at all.

Using a simple 4-digit lockscreen PIN (1234).

Removing the external SD card prior to encryption.

Trying encryption with and without LineageOS SU addon.

Encrypting the device directly after the first LineageOS boot without any further setup or app installation.

Enabling and not enabling the developer options.

Removing the USB cable during first restart after encryption had begun.

I'm afraid I don't quite know what I could try next. Does anyone have any ideas, or is there some kind of troubleshooting I could attempt to help locate the cause of this behaviour?

I have converted several other devices (not owned by me) to LineageOS 14.1, mostly Samsung Galaxy SIII (GT-I9300) and Samsung Ace 3 LTE (GT-7275R), and none of them have exhibited a similar error.

Since reverting to CynogenMod 13.0 is not a real option, and I am quite uncomfortable leaving the device unencrypted, I would greatly appreciate any help or hint you may have. If you need any further information on my device or setup, please let me know. Thanks very much in advance.

Best regards,

Markus