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

Networking configuration error - with email configuration.. #2047

Open
carlbeech opened this issue May 24, 2019 · 7 comments
Open

Networking configuration error - with email configuration.. #2047

carlbeech opened this issue May 24, 2019 · 7 comments

Comments

@carlbeech
Copy link

Hi

I thought I'd give email alerting a go, as I think I have an issue with scheduled tasks... I tried to configure email, but when I clicked on verify I got a message that it had an error - I realised what the problem was - in that I'd only had 192.16.1.1 in my DNS, but the email config was for 'smtp.gmail.com'.

So I went back to the networking config, and edited it, so that it had 192.168.1.1,8.8.8.8 - however when I submitted the update, I got an error:

        Traceback (most recent call last):

File "/opt/rockstor/src/rockstor/rest_framework_custom/generic_view.py", line 41, in _handle_exception
yield
File "/opt/rockstor/src/rockstor/storageadmin/views/network.py", line 322, in put
device = nco.networkdevice_set.first().name
AttributeError: 'NoneType' object has no attribute 'name'

The network config I was updating to was:
Name * Wired connection 1
Connection Type * ethernet
Device * lo
Config Method * manual
MTU 1500
IP Address * 192.168.1.198/24
Gateway 192.168.1.1
DNS Servers 192.168.1.1,8.8.8.8
Search Domains

I used nmtui tool to make the necessary network changes (although I'm not sure if the rockstor screen makes other changes?)

I've worked through the email settings and got those to work - once I'd done the extra security settings associated with gmail...

So as far as I'm aware, things are functioning, however, I thought you may want to know about the error if you alter network settings...

I'm using rockstor 3-9-2-48 (stable), within a vmware 6.5 environment.

Please let me know if there's any extra / logs / config file information needed.

Cheers

Carl.

@FroggyFlox
Copy link
Member

Hi @carlbeech,
I'm glad you got this issue and the email configuration worked out!

I've been working around that area of the code lately so thanks a lot for your report! I'm curious to know what happened, and would like to be able to reproduce the issue. To this aim, would you be able to give more information on how you setup this connection before you observed this issue? If you used Rockstor's webUI for that, the settings used would be helpful.

The reason I'm asking this is that the error you observed results from the absence of a device information associated to this connection in Rockstor's database:

device = nco.networkdevice_set.first().name
AttributeError: 'NoneType' object has no attribute 'name'

As this association is made when the connection is created, I'm wondering if the issue originated there.

Alternatively, was there any "hardware" change (or VM configuration change) between the creation of this connection and when you got the error above?

In advance, thanks for your help,

@carlbeech
Copy link
Author

Hi

Not sure I can recall 100% whether I used the web-gui or nmtui - I suspect I may have used nmtui, as I needed a manual IP setting not DHCP - and I think I got a similar error when I first installed and tried to edit the settings through the GUI (but didn't have time to get into the detail at that point).

There's not been any changes in the hardware config from the VM side (apart from adding disks).

Is there a way to manually re-sync the Rockstor database with what the server actually has - I'd far prefer to use the web UI rather than having to go into the console and muck around with nmtui...

It would strike me that such a tool might be useful anyway, to periodically perform a re-sync...?

Cheers
Carl

@FroggyFlox
Copy link
Member

Thanks for the information,

Is there a way to manually re-sync the Rockstor database with what the server actually has - I'd far prefer to use the web UI rather than having to go into the console and muck around with nmtui...

This is actually exactly how Rockstor operates with network configuration: it uses nmcli to get the configurations of all devices and connections that Network Manager sees, and uses that to refresh its database. As this happens every time you access or refresh the "System > Network" page, this essentially performs the re-sync you are looking for.
Once this information in the database is thus refreshed/updated, it is gathered and displayed in the Network summary table. As a result, if you could share a screenshot of this page it would tell us what you have in your database. In particular, click on the connection name and a small accordeon-style table should display more information about the connection, including the device used.

@carlbeech
Copy link
Author

Hi

Ok - thanks for the info - that makes a bit more sense... as a matter of interest, it got mentioned on another github issue I raised that I should be raising this through the forums, not here? Let me know if that is better....

I spotted in the rockstor.log the following:
[25/May/2019 22:01:30] ERROR [storageadmin.views.network:157] get() returned more than one NetworkConnection -- it returned 2!
Traceback (most recent call last):
File "/opt/rockstor/src/rockstor/storageadmin/views/network.py", line 154, in update_connection
name=dconfig['connection'])
File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/models/manager.py", line 127, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/models/query.py", line 338, in get
(self.model._meta.object_name, num)
MultipleObjectsReturned: get() returned more than one NetworkConnection -- it returned 2!

And NMCLI outputs are:

[root@rockstor_home log]# nmcli
ens192: connected to Wired connection 1
"VMware VMXNET3"
ethernet (vmxnet3), 00:0C:29:6B:BD:3B, hw, mtu 1500
ip4 default
inet4 192.168.1.198/24
route4 192.168.1.0/24
route4 0.0.0.0/0
inet6 fda4:caa0:e838:ad00:53b5:6a56:ab30:d767/64
inet6 fe80::6467:2c7f:8da5:fd3f/64
route6 fe80::/64
route6 fda4:caa0:e838:ad00::/64
route6 ff00::/8

lo: unmanaged
"lo"
loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536

DNS configuration:
servers: 192.168.1.1 8.8.8.8
interface: ens192

Use "nmcli device show" to get complete information about known devices and
"nmcli connection show" to get an overview on active connection profiles.

Consult nmcli(1) and nmcli-examples(5) manual pages for complete usage details.
[root@rockstor_home log]# nmcli device show
GENERAL.DEVICE: ens192
GENERAL.TYPE: ethernet
GENERAL.HWADDR: 00:0C:29:6B:BD:3B
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.CONNECTION: Wired connection 1
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/2
WIRED-PROPERTIES.CARRIER: on
IP4.ADDRESS[1]: 192.168.1.198/24
IP4.GATEWAY: 192.168.1.1
IP4.ROUTE[1]: dst = 192.168.1.0/24, nh = 0.0.0.0, mt = 100
IP4.ROUTE[2]: dst = 0.0.0.0/0, nh = 192.168.1.1, mt = 100
IP4.DNS[1]: 192.168.1.1
IP4.DNS[2]: 8.8.8.8
IP6.ADDRESS[1]: fda4:caa0:e838:ad00:53b5:6a56:ab30:d767/64
IP6.ADDRESS[2]: fe80::6467:2c7f:8da5:fd3f/64
IP6.GATEWAY: --
IP6.ROUTE[1]: dst = fe80::/64, nh = ::, mt = 100
IP6.ROUTE[2]: dst = fda4:caa0:e838:ad00::/64, nh = ::, mt = 100
IP6.ROUTE[3]: dst = ff00::/8, nh = ::, mt = 256, table=255

GENERAL.DEVICE: lo
GENERAL.TYPE: loopback
GENERAL.HWADDR: 00:00:00:00:00:00
GENERAL.MTU: 65536
GENERAL.STATE: 10 (unmanaged)
GENERAL.CONNECTION: --
GENERAL.CON-PATH: --
IP4.ADDRESS[1]: 127.0.0.1/8
IP4.GATEWAY: --
IP6.ADDRESS[1]: ::1/128
IP6.GATEWAY: --

rockstor_network

However, as you can see above, the issue is tying in with two 'wired connection 1' entries... so I need to delete one - I'm guessing I need to use the NMCLI/NMTUI to do that...
Not sure how another one got created though...

Cheers
Carl

@carlbeech
Copy link
Author

I tell a lie - I hadn't spotted the 'bin' icon - I've clicked on it, and it deleted it :-)
I'll keep an eye on the logs and close in a couple of days if I don't see any more messages...

Many thanks

Carl.

@phillxnet
Copy link
Member

phillxnet commented May 26, 2019

@carlbeech @FroggyFlox

it got mentioned on another github issue I raised that I should be raising this through the forums, not here?

Yes that was me. I'd stick with what we have here now as it looks like we are getting to the nub of it. The forum can be useful to initially whittle down whats going on and then we tease out the individual issues to be as concise as possible in the GitHub issues, and identify if we already have existing issues open for the same base cause. But now worries as your contribution by way of reporting is welcome anywhere. And thanks for taking the time and effort to work through this. Much appreciated.

@FroggyFlox This to me looks very much like an existing issue we already have in GitHub:
"Install in KVM VM with virtio network results in having two eth0 interfaces" #1997
which incidentally grew from a forum thread, linking thread here also for convenience:
https://forum.rockstor.com/t/can-not-start-replication-service/5477
So this may be a duplicate of that issue, ie re:
"MultipleObjectsReturned: get() returned more than one NetworkConnection – it returned 2!"

@FroggyFlox
Copy link
Member

This to me looks very much like an existing issue we already have in GitHub:
"Install in KVM VM with virtio network results in having two eth0 interfaces" #1997

Thanks a lot for the reference, @phillxnet, that does look very similar indeed. It seems we have some improvement to make on how to handle this situation. I remember the issue you just referenced now (I had forgotten about it), and given there seems to be a reproducer, I see if I can actually reproduce it and maybe address the problem.

Thanks for all the additional information and help @carlbeech!

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

3 participants