Replacing encrypted drive prevents creating new recovery key...

Status
Not open for further replies.

SnakeByte

Explorer
Joined
Jul 10, 2015
Messages
53
I replaced two encrypted drives recently in an encrypted zraid2 pool. Silvering finished up, and the zpool shows as healthy again.

According to the docs, what should happen next is to re-do the encryption steps, I.E. assign a passphrase, and create a recovery key.

When assigning the passphrase, this error appears in /var/log/messages:
Code:
Feb  5 21:56:53 freenas manage.py: [middleware.exceptions:37] [MiddlewareError: Unable to set passphrase on gptid/5127d49a-3484-11e5-80f0-d050991b6355: geli: Cannot open gptid/5127d49a-3484-11e5-80f0-d050991b6355: No such file or directory.


This is the id of a drive that no longer exists.

One hopes that this step completed successfully anyway, but a cleanup step somewhere was missed. (Bug #1)

When attempting to create a recovery key from the web gui, I enter in my root password, but no subsequent download of a recovery key is offered.

/var/log/messaages shows this:
Code:
Feb  5 21:59:46 freenas manage.py: [middleware.exceptions:37] [MiddlewareError: Unable to set recovery key for 2 devices: [MiddlewareError: Unable to set passphrase on gptid/5127d49a-3484-11e5-80f0-d050991b6355: geli: Cannot open gptid/5127d49a-3484-11e5-80f0-d050991b6355: No such file or directory.
], [MiddlewareError: Unable to set passphrase on gptid/52093a8a-3484-11e5-80f0-d050991b6355: geli: Cannot open gptid/52093a8a-3484-11e5-80f0-d050991b6355: No such file or directory.


Again, it looks like something wasn't cleaned up as in this case, the id's of two non-existent drives were referenced. This time things are borked enough that the recovery key either isn't created, or just isn't offered via the web gui after creation (Bug #2)

Since the docs recommend doing both the passphrase and recovery key steps before reboot least the data become unavailable, it's possible the system is now in a fragile state.
 

SnakeByte

Explorer
Joined
Jul 10, 2015
Messages
53
Apparently, someone else (cyberjock) ran into this same issue two years ago:
https://forums.freenas.org/index.php?threads/can-drives-on-encrypted-zpools-ever-be-replaced.12827/
https://bugs.freenas.org/issues/2178

The "fix" was to create a new recovery key after silvering starts, however, what seems to have been missed is that the recover key cannot be generated due to the stale drive info in the sqlite db. It tries to work on drives that don't exist, and then silently fails (as far as the gui is concerned -- no key is given to download).
 
Status
Not open for further replies.
Top