User page broken with email ending in .local in Fangtooth

One of the TrueNAS users had an email ending in .local, which completely broke parsing of the email and with it the user page down to the cli. This worked fine before the upgrade

The only solution to fix this was dropping down to the sqlite database and rewriting the email address there.

The stack trace for reference:

nas-backup# midclt call user.query
4 validation errors for UserQueryResult
result.list[UserQueryResultItem].17.email
  value is not a valid email address: The part after the @-sign is a special-use or reserved name that cannot be used with email. [type=value_error, input_value='admin@gw.*****.local', input_type=str]
result.list[UserQueryResultItem].53.email
  value is not a valid email address: The part after the @-sign is a special-use or reserved name that cannot be used with email. [type=value_error, input_value='admin@gw.*****.local', input_type=str]
result.UserQueryResultItem
  Input should be a valid dictionary or instance of UserQueryResultItem [type=model_type, input_value=[{'id': 1, 'uid': 0, 'use...s': [], 'api_keys': []}], input_type=list]
    For further information visit https://errors.pydantic.dev/2.9/v/model_type
result.int
  Input should be a valid integer [type=int_type, input_value=[{'id': 1, 'uid': 0, 'use...s': [], 'api_keys': []}], input_type=list]
    For further information visit https://errors.pydantic.dev/2.9/v/int_type
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/middlewared/api/base/server/ws_handler/rpc.py", line 323, in process_method_call
    result = await method.call(app, params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/api/base/server/method.py", line 49, in call
    return await self._dump_result(app, methodobj, result)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/api/base/server/method.py", line 52, in _dump_result
    return self.middleware.dump_result(self.serviceobj, methodobj, app, result)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 791, in dump_result
    return serialize_result(new_style_returns_model, result, expose_secrets)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/api/base/handler/result.py", line 13, in serialize_result
    return model(result=result).model_dump(
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pydantic/main.py", line 212, in __init__
    validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 4 validation errors for UserQueryResult
result.list[UserQueryResultItem].17.email
  value is not a valid email address: The part after the @-sign is a special-use or reserved name that cannot be used with email. [type=value_error, input_value='admin@gw.*****.local', input_type=str]
result.list[UserQueryResultItem].53.email
  value is not a valid email address: The part after the @-sign is a special-use or reserved name that cannot be used with email. [type=value_error, input_value='admin@gw.*****.local', input_type=str]
result.UserQueryResultItem
  Input should be a valid dictionary or instance of UserQueryResultItem [type=model_type, input_value=[{'id': 1, 'uid': 0, 'use...s': [], 'api_keys': []}], input_type=list]
    For further information visit https://errors.pydantic.dev/2.9/v/model_type
result.int
  Input should be a valid integer [type=int_type, input_value=[{'id': 1, 'uid': 0, 'use...s': [], 'api_keys': []}], input_type=list]
    For further information visit https://errors.pydantic.dev/2.9/v/int_type

This bug is being fixed in NAS-135429 and is targeted for 25.04.1

1 Like