Thanks for using the TrueNAS Community Edition issue tracker! TrueNAS Enterprise users receive direct support for their reports from our support portal.

CLONE - Error (traceback) when editing unrelated properties on dataset with certain zstd (zstandard) compression levels

Description

The TrueNAS 12.0 WebUI allows a user to choose from 3-4 different levels of zstd compression on a dataset, but ZFS itself offers many more. A dataset might have a zstd compression level set on it that isn't offered by the WebUI, whether set through the command line or set on a different system and then imported into TrueNAS.

When a dataset has a zstd compression level set that isn't available in the WebUI, it becomes impossible to edit any of the dataset's properties in the WebUI, even if those properties are completely unrelated to compression. TrueNAS throws an error, does not save any changes made in the WebUI, and displays the following traceback:

Error: Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 137, in call_method result = await self.middleware._call(message['method'], serviceobj, methodobj, params, app=self, File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1191, in _call return await methodobj(*prepared_call.args) File "/usr/local/lib/python3.8/site-packages/middlewared/service.py", line 463, in update rv = await self.middleware._call( File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1191, in _call return await methodobj(*prepared_call.args) File "/usr/local/lib/python3.8/site-packages/middlewared/schema.py", line 972, in nf args, kwargs = clean_and_validate_args(args, kwargs) File "/usr/local/lib/python3.8/site-packages/middlewared/schema.py", line 930, in clean_and_validate_args value = attr.clean(args[args_index + i]) File "/usr/local/lib/python3.8/site-packages/middlewared/schema.py", line 607, in clean data[key] = attr.clean(value) File "/usr/local/lib/python3.8/site-packages/middlewared/schema.py", line 167, in clean value = super(Str, self).clean(value) File "/usr/local/lib/python3.8/site-packages/middlewared/schema.py", line 53, in clean raise Error(self.name, f'Invalid choice: {value}') middlewared.schema.Error: [compression] Invalid choice: ZSTD-19

Steps to reproduce:

  1. Create a new dataset in the WebUI using default values

  2. At the commandline, set a zstd compression level not available in the WebUI. For example:

    zfs set compression=zstd-19 testPool/zstd-test
  1. Back in the WebUI, select "Edit Options" on the dataset

  2. Change a property unrelated to compression, e.g. change "Enable atime" to "off"

  3. Attempt to save the changes

Observed results:
The WebUI pops up with a traceback error and the change to the dataset is not saved.

Expected results:
The change to the dataset is saved without error. Even if the WebUI does not offer a particular compression setting, it shouldn't choke on saving completely unrelated changes to the dataset when such a compression setting happens to already exist on a dataset.

Problem/Justification

None

Impact

None

SmartDraw Connector

Katalon Manual Tests (BETA)

Activity

Show:

Bug Clerk 
December 23, 2020 at 2:27 PM

William Gryzbowski 
December 8, 2020 at 2:46 PM

12.0 PR will be merged after freeze is lifted.

Bug Clerk 
December 8, 2020 at 2:46 PM

Complete

Details

Assignee

Reporter

Labels

Impact

Components

Affects versions

Priority

More fields

Katalon Platform

Created December 1, 2020 at 11:39 AM
Updated December 23, 2020 at 2:27 PM
Resolved December 8, 2020 at 2:47 PM