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

TypeError when deleting unused Rocknet #2814 #2817

Merged

Conversation

phillxnet
Copy link
Member

@phillxnet phillxnet commented Mar 26, 2024

Fix type error by checking db query _set existence using build-in .exists(). It is proposed that the intention here was .count() > 0, but a simple .exists() serves us here.

Fixes #2814
Fixes #2775

Check for db query _set existence using build-in .exists().
@phillxnet
Copy link
Member Author

phillxnet commented Mar 26, 2024

Testing this PR for #2814 works as intended.

Testing for the suspected related #2775, using the deletion of an existing network interface as a tangential reproducer: as per the following comment in: #2775 (comment), we again have a fix in-that the network interface is successfully removed and there is now Web-UI errors: but we do have the following log artifact there-after:

[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


[EDIT] This log indicated failure, surfaced by the similarly located - but different Web-UI failure addressed specifically by this PR, has now been detailed in the following dedicated issue:

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

And relates to managing, system-wide, our emerging null config for all service defaults.

@phillxnet phillxnet merged commit 86ca548 into rockstor:testing Mar 26, 2024
@phillxnet phillxnet deleted the 2814-TypeError-when-deleting-a-Rocknet branch March 26, 2024 17:16
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

Successfully merging this pull request may close these issues.

1 participant