TrueNAS incorrectly considers OpenZFS 2 datasets as locked

Description

I have a pool which is encrypted using OpenZFS 2 native encryption. However, recently when rebooting, it will not mount SMB shares because

SMB share "{name}" is unavailable because it uses a locked dataset.

Similarily, if I try to change the home directory of a user, it errors with

Path component for "Home Directory" is currently encrypted and locked

The pool automacitally unlocks upon boot.

Please let me know what I can do to help debug - I have no experience debugging FreeNAS/TrueNAS, but am happy to learn. I suspect the issue lies with pool.dataset.path_in_locked_datasets, or one of the related calls.

Problem/Justification

None

Impact

None

SmartDraw Connector

Katalon Manual Tests (BETA)

Activity

Waqar 
April 2, 2021 at 9:22 PM

can you please email me a debug of the system at waqar@ixsystems.com ?

Eric Johnson 
April 2, 2021 at 9:08 PM

I think I have the same issue that was had here. I have the same symptoms; TrueNAS claims every share I have is locked and won't let me create or edit users' home directories. In my case my main pool is unencrypted, but there are some datasets which are deliberately encrypted andn locked.

 

midclt call -job pool.dataset.encryption_summary pool1 says that my datasets under pool1/backups are encrypted and locked, and it says that *pool1/encrypted* is encrypted and unlocked (this encryption root has a couple other datasets beneath it, one of which I want to share)

 

I've ran *midclt call pool.dataset.path_in_locked_datasets ...* on various paths. I have a second pool (known as `scary`) that's just a single SSD. Every single path I've tried in both pools returns True; every path is considered Locked, even ones without encryption. The only path I've sen that isn't considered locked is /

 

I'm running 12.0-U2.1. I'm wondering if this was fixed by https://github.com/truenas/middleware/pull/6691.
I made this Forum post before discovering this bug. https://www.truenas.com/community/threads/all-shares-incorrectly-marked-locked.92207/

Waqar 
March 5, 2021 at 9:59 AM

i am not sure i follow, "Valhalla" was unlocked and it had a valid key present in TN database at the time you posted the output when the issue was present. The path "/mnt/Valhalla/Valhalla/Photos" comes under that dataset, so it should have been accessible as well ? Please let me know if i am missing something. Thank you

bcLCn5hS 
March 5, 2021 at 12:15 AM

 at least as of this moment, it appears the "issue" is not present, despite the aforementioned rpool and bpools being present and locked (that is to say everything is working as expected). I did not make any intentional changes since my previous comment where the issue was present, so it appears that I am not able to reproduce it 100%.

At the time of the previous comment, "the issue" of TrueNAS not allowing me access to the SMB shares was present, but "the issue" is no longer present currently.

For sake of completeness sake, and for future reference if "the issue" returns:

 

Waqar 
March 3, 2021 at 2:11 PM

can you please clarify what is not working in the current state it is in ? You did not had `Valhalla/NAME001/rpool` dataset as an encrypted root before which it is now and that's the one which has been affected by the replication, so it would be nice if you could clarify the issue we are seeing and we can troubleshoot it then

Need additional information

Details

Assignee

Reporter

Labels

Impact

Components

Fix versions

Affects versions

Priority

More fields

Katalon Platform

Created February 4, 2021 at 3:12 AM
Updated July 1, 2022 at 5:14 PM
Resolved February 24, 2021 at 9:01 AM