setting manual IP address fails

Brief description of the problem

Went to change from DHCP to manual and got the following error. Oddly enough if I go back in to do the same steps then the original DHCP IP address is in the IP field followed by the IP address I tried to manually assign:

image

Detailed step by step instructions to reproduce the problem

drill down to system → network → wired connection 1 then click the

Web-UI screenshot

Error Traceback provided on the Web-UI

Traceback (most recent call last): File "/opt/rockstor/src/rockstor/rest_framework_custom/generic_view.py", line 40, in _handle_exception yield File "/opt/rockstor/src/rockstor/storageadmin/views/network.py", line 534, in put return Response(NetworkConnectionSerializer(nco).data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/rockstor/.venv/lib/python3.11/site-packages/rest_framework/serializers.py", line 571, in data ret = super().data ^^^^^^^^^^^^ File "/opt/rockstor/.venv/lib/python3.11/site-packages/rest_framework/serializers.py", line 249, in data self._data = self.to_representation(self.instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/rockstor/.venv/lib/python3.11/site-packages/rest_framework/serializers.py", line 525, in to_representation attribute = field.get_attribute(instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/rockstor/.venv/lib/python3.11/site-packages/rest_framework/fields.py", line 437, in get_attribute return get_attribute(instance, self.source_attrs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/rockstor/.venv/lib/python3.11/site-packages/rest_framework/fields.py", line 104, in get_attribute instance = getattr(instance, attr) ^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/rockstor/src/rockstor/storageadmin/models/network_interface.py", line 81, in ctype if self.ethernetconnection_set.count() > 0: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/models/manager.py", line 87, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^ File "/opt/rockstor/.venv/lib/python3.11/site-packages/django/db/models/fields/related_descriptors.py", line 718, in get_queryset raise ValueError( ValueError: 'NetworkConnection' instance needs to have a primary key value before this relationship can be used.

@hush-dingy welcome to the Rockstor community. I believe we have an issue opened for this one:

which was based on this forum report:

As a workaround you could use the nmtui at the command line, where you can also edit connections as the above author did.

2 Likes