Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt net interface delete to 'rockstor' service null config default #2819

Closed
phillxnet opened this issue Mar 26, 2024 · 2 comments
Closed
Assignees

Comments

@phillxnet
Copy link
Member

Almost all services have a default config of null: including the Web-UI service known as 'rockstor'. However when deleting an existing interface, with a default null config for the 'rockstor' service: we get the following log entry indicating a silent failure in our fencing to guard against inadvertent removal of the Web-UI associated 'management' interface.

[26/Mar/2024 14:56:39] ERROR [storageadmin.views.network:564] the JSON object must be str, bytes or bytearray, not NoneType
Traceback (most recent call last):
  File "/opt/rockstor/src/rockstor/storageadmin/views/network.py", line 560, in delete
    config = json.loads(so.config)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/json/__init__.py", line 339, in loads
    raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType


See the following reproducer comment that arouse while testing a recent fix for network interface removal via Web-UI:
#2817 (comment)

And the following contextual issues/design directions:

@phillxnet
Copy link
Member Author

phillxnet commented Mar 26, 2024

It is proposed that, given the current default of null for the 'rockstor' service, and via the above detailed aims to have this as the service norm: that we accommodate appropriately and simple circumvent this check when there is no definition of a management interface yet available. A spin-off dedicated issue could be created to address the need to auto-establish a non-null config for the Web-UI/management interface but that is outside the scope of this issue. And given our stated context of approaching a system-wide null config capability: we should similarly not fail in the current manner indicated by the quoted log entry (post merge of #2817 which then clears the way for a reproducer here).

@phillxnet phillxnet self-assigned this Mar 26, 2024
phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 27, 2024
…ockstor#2819

Block non-rocknet interface deletions for the default/no management/Web-UI
interface configuration. Raising a user visible exception explaining
the interface delete rejection, and advising the need to configure the
'rockstor' service first. This way, for default/no 'rockstor'/Web-UI service
configurations (no management interface defined) we avoid inadvertent
Web-UI outage. Once a non default 'rockstor' service/Web-UI Network
interface is established, only that interface will be bared from delete.

Fixes Web-UI silent but logged failure to properly process/fence an interface
delete request with default 'rockstor'/Web-UI configuration.
@phillxnet phillxnet added this to the 5.1.X-X Stable release milestone Mar 27, 2024
phillxnet added a commit that referenced this issue Mar 27, 2024
…te-to-'rockstor'-service-null-config-default

Adapt net interface delete to 'rockstor' service null config #2819
@phillxnet
Copy link
Member Author

Closing as:
Fixed by #2822

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant