SOLVED Replaced OS drive; can't download encrypt key or set encryption password

freedombacon

Dabbler
Joined
Jun 22, 2015
Messages
23
I had to replace my OS drive (USB drive) due to its failure. I installed a slightly a fresh copy of FreeNAS (might have been a slightly newer version than what I was originally using) and restored config. Everything seemed to go okay, but I wasn't able to import the pool with the encryption key or passphrase. I had to do it with the recovery key. Now when I try to download the encryption key, I get a 0B file. I tried on two different computers. It also doesn't matter if I use HTTP or HTTPS like was suggested on elsewhere by someone having a similar problem. When I tried on the legacy interface, I get an error message about a missing file. How do I fix this? Is this install messed up? I'm scared to take the latest update or reboot it while it's like this.

Error in legacy interface on attempt to download encrypt key:

Code:
Environment:

Software Version: FreeNAS-11.2-U6 (5acc1dec66)
Request Method: GET
Request URL: https://REDACTED/legacy/storage/volume/1/key/download/


Traceback:
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
  42.             response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _legacy_get_response
  249.             response = self._get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  178.             response = middleware_method(request, callback, callback_args, callback_kwargs)
File "./freenasUI/freeadmin/middleware.py" in process_view
  163.         return login_required(view_func)(request, *view_args, **view_kwargs)
File "/usr/local/lib/python3.6/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  23.                 return view_func(request, *args, **kwargs)
File "./freenasUI/storage/views.py" in volume_key_download
  1090.     with open(geli_keyfile, 'rb') as f:

Exception Type: FileNotFoundError at /legacy/storage/volume/1/key/download/
Exception Value: [Errno 2] No such file or directory: '/data/geli/3fe4720e-bc3d-49c7-941d-cccfc7aed68e.key'
 
Joined
Oct 18, 2018
Messages
969
Your encryption keys are not included in the config you restore from; you need to back those up separately. Have you tried rekeying and re-creating the recovery key? If you rekey the pool, readd your passphrase, AND re-add the recovery key that should get things all set for you. If it does, be sure to keep backups of both new keys.
 

freedombacon

Dabbler
Joined
Jun 22, 2015
Messages
23
I was able to rekey and download the encrypt key, add and download recovery key, but it still won't let me set a passphrase.

What log should I look in for the details? The UI just gives this meaningless error: "Error creating passphrase for pool r0"
 
Joined
Oct 18, 2018
Messages
969
When you say it won't let you, what do you mean? Can you provide a screenshot of the dropdown of the encryption options for the pool or can you provide a specific error?
 

freedombacon

Dabbler
Joined
Jun 22, 2015
Messages
23
I could, but it wouldn't show anything. That error is literally all I get. I searched here for it and found some threads that said the system data set can't be on an encrypted pool with a passphrase. I moved it to freenas-boot and set a passphrase. Hopefully system dataset doesn't contain anything to sensitive and it's safe to leave unencrypted.

Thanks for the help.
 
Top