Bug 1551574 - failed to attach network with missing address/netmask: they are sometimes stored in DB as empty string instead of NULL
Summary: failed to attach network with missing address/netmask: they are sometimes sto...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Network
Version: 4.2.1.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.2.3
: 4.2.3.2
Assignee: eraviv
QA Contact: Michael Burman
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-05 12:45 UTC by Rik Theys
Modified: 2018-05-10 06:34 UTC (History)
7 users (show)

Fixed In Version: ovirt-engine-4.2.3.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-10 06:34:12 UTC
oVirt Team: Network
Embargoed:
rule-engine: ovirt-4.2+
ylavi: exception+


Attachments (Terms of Use)
vdsm log on the host during attach of network (148.46 KB, text/plain)
2018-03-06 15:06 UTC, Rik Theys
no flags Details
engine log during create and attach of network (24.00 KB, text/plain)
2018-03-06 15:09 UTC, Rik Theys
no flags Details
screenshots (160.00 KB, application/x-tar)
2018-03-07 07:35 UTC, Rik Theys
no flags Details
engine log during setup network (15.06 KB, text/plain)
2018-03-12 08:23 UTC, Rik Theys
no flags Details
sql output of requested commands (23.58 KB, text/plain)
2018-03-12 08:24 UTC, Rik Theys
no flags Details
engine log from engine startup to trigger of issue (171.72 KB, text/plain)
2018-03-12 12:16 UTC, Rik Theys
no flags Details
screenshot that shows two extra (not used) interfaces (26.31 KB, image/png)
2018-03-12 12:49 UTC, Rik Theys
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 89447 0 master MERGED engine: network attachment - legacy empty strings failure 2020-03-12 15:39:22 UTC
oVirt gerrit 89992 0 master MERGED core: network attachment - empty string to null 2020-03-12 15:39:22 UTC
oVirt gerrit 90304 0 ovirt-engine-4.2 MERGED engine: network attachment - legacy empty strings failure 2020-03-12 15:39:22 UTC

Description Rik Theys 2018-03-05 12:45:40 UTC
Description of problem:

I've upgraded our engine (and hosts) to 4.2.1.

I've created a new VM network with a vlan id in the networks section.
When I try to add this network to a host ("setup host networks") and apply the settings, a dialog pops up that the netmask and ip address don't match the regular expression. But this network does not require an IP address on the hosts.

I've done this numerous times with previous oVirt releases and never experienced this issue.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Add a network to a datacenter with a VLAN id and no ip address
2. Select "setup host networks" for a host, drag the network onto an existing bond and press OK
3.

Actual results:
Error message that the ipaddress and netmask don't match a regex

Expected results:
Network added to the host

Additional info:
When I apply it, the engine log shows:

2018-03-05 13:33:13,428+01 WARN  [org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand] (default task-22) [bebce8e7-8547-45a7-8423-a66da8ee2ce7] Validation of action 'HostSetupNetworks' failed for user rtheys@esat-authz. Reasons: VAR__ACTION__SETUP,VAR__TYPE__NETWORKS,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@102a774f,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@5bda31ed,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].address,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@4b8ff9d7,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@3d9ffff0,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].gateway,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@4b8ff9d7,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@3d9ffff0,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].gateway,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@102a774f,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@5bda31ed,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].address,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@102a774f,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@5bda31ed,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].address,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@4b8ff9d7,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@3d9ffff0,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].gateway,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@4b8ff9d7,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@3d9ffff0,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].gateway,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@102a774f,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@5bda31ed,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].address,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@4b8ff9d7,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@3d9ffff0,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].gateway,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@102a774f,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@5bda31ed,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].address,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@4b8ff9d7,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@3d9ffff0,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].gateway,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@102a774f,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@5bda31ed,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].address,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@4b8ff9d7,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@3d9ffff0,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].gateway,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@4b8ff9d7,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@3d9ffff0,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].gateway,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@102a774f,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@5bda31ed,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].address,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@4b8ff9d7,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@3d9ffff0,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].gateway,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@102a774f,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@5bda31ed,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].address,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@4b8ff9d7,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@3d9ffff0,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].gateway,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@102a774f,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@5bda31ed,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].address,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@4b8ff9d7,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@3d9ffff0,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].gateway,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@102a774f,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@5bda31ed,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].address,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@4b8ff9d7,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@3d9ffff0,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].gateway,$validatedValue ,must match "^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)",$flags [Ljavax.validation.constraints.Pattern$Flag;@46c1af48,$regexp ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d),$groups [Ljava.lang.Class;@102a774f,$message {javax.validation.constraints.Pattern.message},$payload [Ljava.lang.Class;@5bda31ed,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path ipConfiguration.iPv4Addresses[0].address,$validatedValue

Comment 1 Michael Burman 2018-03-06 13:45:55 UTC
Hi Rik,

Please provide us more information and logs, vdsm and engine logs.
The described scenario is working as expected. 
Also the vdsm and engine versions. 

Thanks,

Comment 2 Rik Theys 2018-03-06 15:06:59 UTC
Created attachment 1404883 [details]
vdsm log on the host during attach of network

Comment 3 Rik Theys 2018-03-06 15:09:28 UTC
Created attachment 1404884 [details]
engine log during create and attach of network

Hi,

On the engine:
ovirt-engine-4.2.1.7-1.el7.centos.noarch

On the host:
vdsm-4.20.17-1.el7.centos.x86_64

I've attached a tail of the vdsm and engine log.

In the engine log it shows that I've added the 'ea-psi' network and that it fails to add the network to the host as the regex for the ip address and netmask does not match. There doesn't seem to be any relevant log on the host during this action (the engine does not contact the host but fails the validation before this step).


Regards,

Rik

Comment 4 Michael Burman 2018-03-06 15:12:34 UTC
(In reply to Rik Theys from comment #3)
> Created attachment 1404884 [details]
> engine log during create and attach of network
> 
> Hi,
> 
> On the engine:
> ovirt-engine-4.2.1.7-1.el7.centos.noarch
> 
> On the host:
> vdsm-4.20.17-1.el7.centos.x86_64
> 
> I've attached a tail of the vdsm and engine log.
> 
> In the engine log it shows that I've added the 'ea-psi' network and that it
> fails to add the network to the host as the regex for the ip address and
> netmask does not match. There doesn't seem to be any relevant log on the
> host during this action (the engine does not contact the host but fails the
> validation before this step).
> 
> 
> Regards,
> 
> Rik

Thank you, we will take a look

Comment 5 Michael Burman 2018-03-07 06:05:44 UTC
This is sounds like BZ 1528906 (same error), at least very similar.
Although it was verified on 4.2.1.1-0.1.el7 and you using ovirt-engine-4.2.1.7-1.el7.centos.noarch 

Alona would you agree this is the same issue?

Comment 6 Michael Burman 2018-03-07 06:08:51 UTC
Rik, 
Are you sure that the network attachment has no IP address nor netmask/prefix? Are you sure that the network has none of the IPconfigurations(prefix,IP, gateway) when trying to attach it to the host?

I can't reproduce this issue. Can you give me a clear steps to reproduce it? is it 100% reproducible for you?

Comment 7 Rik Theys 2018-03-07 07:35:32 UTC
Created attachment 1405171 [details]
screenshots

Hi,

Yes it is 100% reproducible on our installation.

I add a new logical network to our datacenter and the only change I make in the dialog is to enable vlan tagging and enter vlan 724.

I then go to one of the hosts in that datacenter and use the setup host network button. I drag the network from the unassigned list and drop in on the bond (where I have multiple other networks that were already there).

I don't make any changes to the settings of the network. As you can see from the screenshots, the IP configuration is set to None for ipv4 and ipv6.

When I click on OK, the message appears.

Regards,

Rik

Comment 8 Michael Burman 2018-03-07 07:57:48 UTC
Alona, see need info requested in comment 5#^^

Comment 9 Alona Kaplan 2018-03-08 11:30:09 UTC
Hi Rik,

Does it happen only on host 'amazone'?
Does it work for a vlan id other than '724'?
Are you able to attach the network 'ea-psi' to another nic?

Comment 10 Alona Kaplan 2018-03-08 11:31:52 UTC
(In reply to Michael Burman from comment #8)
> Alona, see need info requested in comment 5#^^

Hi Michael,

The bug here has two errors, gateway and address.
BZ 1528906 may fix the gateway error, it won't fix the address one.

Comment 11 Rik Theys 2018-03-08 11:53:48 UTC
(In reply to Alona Kaplan from comment #9)
> Does it happen only on host 'amazone'?
No, it also happens for the other host in that cluster.

> Does it work for a vlan id other than '724'?
No.

> Are you able to attach the network 'ea-psi' to another nic?

I tried to attach it to a physical nic that was not in use but this throws the same error.

But! I've configured the network in another datacenter that's managed by the same engine and there it works!?

When I look in the engine database, both networks look identical:

engine=# select * from network where name='ea-psi';
                  id                  |  name  |  description  | type | addr | subnet | gateway | vlan_id | stp |           storage_pool_id            | mtu | vm_network | provider_network_provider_id | provider_
network_external_id | free_text_comment | label | qos_id | vdsm_name | dns_resolver_configuration_id | provider_physical_network_id
--------------------------------------+--------+---------------+------+------+--------+---------+---------+-----+--------------------------------------+-----+------------+------------------------------+----------
--------------------+-------------------+-------+--------+-----------+-------------------------------+------------------------------
 c155cb16-3c89-419a-adca-a2a18fd82f0c | ea-psi | PSI A network |      |      |        |         |     724 | f   | 4c47403d-2815-484c-abc1-c279ff7a25b5 |   0 | t          |                              |
                    |                   |       |        | ea-psi    |                               |
 ae10e5a8-19ed-4d42-b962-6f4d2d374227 | ea-psi |               |      |      |        |         |     724 | f   | e7bdba88-e718-41a9-8d2b-0ca79c517630 |   0 | t          |                              |
                    |                   |       |        | ea-psi    |                               |
(2 rows)

the one with id that starts with c155 is the broken one.

engine=# select * from network_cluster where network_id='c155cb16-3c89-419a-adca-a2a18fd82f0c' or network_id='ae10e5a8-19ed-4d42-b962-6f4d2d374227';
              network_id              |              cluster_id              | status | is_display | required | migration | management | is_gluster | default_route
--------------------------------------+--------------------------------------+--------+------------+----------+-----------+------------+------------+---------------
 c155cb16-3c89-419a-adca-a2a18fd82f0c | 38ce6d46-5097-4d6e-9355-6903d84656ff |      0 | f          | t        | f         | f          | f          | f
 ae10e5a8-19ed-4d42-b962-6f4d2d374227 | 96b07d57-24cf-44dc-b067-4580fe3013c1 |      1 | f          | f        | f         | f          | f          | f
(2 rows)

engine=# select * from network_attachments where network_id='c155cb16-3c89-419a-adca-a2a18fd82f0c' or network_id='ae10e5a8-19ed-4d42-b962-6f4d2d374227';
                  id                  |              network_id              |                nic_id                | boot_protocol | address | netmask | gateway | custom_properties |         _create_date
  | _update_date | ipv6_boot_protocol | ipv6_address | ipv6_prefix | ipv6_gateway | dns_resolver_configuration_id
--------------------------------------+--------------------------------------+--------------------------------------+---------------+---------+---------+---------+-------------------+-----------------------------
--+--------------+--------------------+--------------+-------------+--------------+-------------------------------
 64321247-8d34-4804-ab9e-fe004c91d6d9 | ae10e5a8-19ed-4d42-b962-6f4d2d374227 | a12a5f16-2711-436c-9846-310def7648ad | NONE          |         |         |         |                   | 2018-03-08 12:48:49.751938+0
1 |              | NONE               |              |             |              |
(1 row)

How can I determine the differences between these two?

The bad datacenter is compat version 4.2, with one cluster in 4.2 level and two hosts (haswell-noTSX IBRS family).
The good datacenter is compat version 4.2, with one cluster in 4.2 level and one host (sandybridge family)

Regards,

Rik

Comment 12 Rik Theys 2018-03-08 11:56:33 UTC
Hi,

I think I know why it fails.

I get the same error when I click OK on the "setup host networks" with no changes. The reason is that this cluster has a dedicated migrate network where no gateway is configured as it is an isolated network.

So I get the error because the migrate network has not gateway (which should be an OK setup???)

Regards,

Rik

Comment 13 Alona Kaplan 2018-03-11 09:17:28 UTC
Hi Rik,

Thanks for the information.

Just to make sure I understand correctly -

1. The problematic cluster has more than one host. Opening the Setup Networks dialog, doing nothing and just clicking ok causes the error on all the cluster hosts. Right? (Can you please attach an engine log?) What about hosts in the same dc but different cluster?

2. Does performing Setup Networks on the problematic cluster/host via the rest api works fine?
 
3. Setup Networks on different data center works fine. Right?
 
4. The problematic cluster has a migration network which is configured with no gateway on all the cluster hosts. Right?
Does changing the migration network to another network (ovirtmgmt for example) solves the issue? (I couldn't reproduce the issue having on the host migration network with no gateway).

5. Please provide the output of -  
- select * from network_attachments where gateway = '' or address = '';
- select * from vds_interface where (addr = '' or gateway = '') and boot_protocol != 0;
- If possible, dump of the db.

Comment 14 Michael Burman 2018-03-11 09:22:12 UTC
I can't reproduce the issue a well :(

(I couldn't reproduce the issue having on the host migration network with no gateway).

Comment 15 Rik Theys 2018-03-12 08:19:31 UTC
(In reply to Alona Kaplan from comment #13)
> Just to make sure I understand correctly -
> 
> 1. The problematic cluster has more than one host. Opening the Setup
> Networks dialog, doing nothing and just clicking ok causes the error on all
> the cluster hosts. Right? (Can you please attach an engine log?) What about
> hosts in the same dc but different cluster?

Yes, it happens on all hosts in that cluster. The datacenter only has one cluster, so I can not test it with another cluster. I will attach a tail of the engine log while doing this.

> 2. Does performing Setup Networks on the problematic cluster/host via the
> rest api works fine?

Do you have any examples on how to do this?

>  
> 3. Setup Networks on different data center works fine. Right?

Yes. I have verified on another datacenter on the same engine that also has a migration network without gateway and there it works :-/.

>  
> 4. The problematic cluster has a migration network which is configured with
> no gateway on all the cluster hosts. Right?
Yes

> Does changing the migration network to another network (ovirtmgmt for
> example) solves the issue? (I couldn't reproduce the issue having on the
> host migration network with no gateway).
> 
> 5. Please provide the output of -  
> - select * from network_attachments where gateway = '' or address = '';
> - select * from vds_interface where (addr = '' or gateway = '') and
> boot_protocol != 0;
> - If possible, dump of the db.

I will attach the output from these commands.

Regards,

Rik

Comment 16 Rik Theys 2018-03-12 08:23:34 UTC
Created attachment 1407103 [details]
engine log during setup network

Comment 17 Rik Theys 2018-03-12 08:24:16 UTC
Created attachment 1407104 [details]
sql output of requested commands

Given that the issue does not happen in the other data center, I'm no longer convinced that the migrate network alone is the culprit.

Comment 18 Rik Theys 2018-03-12 12:16:59 UTC
Created attachment 1407159 [details]
engine log from engine startup to trigger of issue

This is the engine log from an engine start to when I've triggered the issue.

Comment 19 Rik Theys 2018-03-12 12:47:36 UTC
Hi,

The only differences I can find between datacenters that work and that don't are:

* The one that doesn't work also has two additional network cards that are not used and are down. They are not configured.

The ifcfg file is:

TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=em4
UUID=befec9ff-60be-4943-846f-125057b1b593
DEVICE=em4
ONBOOT=no

It does not show the 'created by vdsm' line in this file.

According to the supervdsm log during startup, the interface has the following configuration:

'em3': {'ipv6autoconf': False, 'addr': '', 'speed': 0, 'dhcpv6': False, 'ipv6addrs': [], 'mtu': '1500', 'dhcpv4': False, 'netmask': '', 'ipv4defaultroute': False, 'ipv4addrs': [], 'hwaddr': 'ec:f4:bb:d6:5f:0c', 'ipv6gateway': '::', 'gateway': ''},

'em4': {'ipv6autoconf': False, 'addr': '', 'speed': 0, 'dhcpv6': False, 'ipv6addrs': [], 'mtu': '1500', 'dhcpv4': False, 'netmask': '', 'ipv4defaultroute': False, 'ipv4addrs': [], 'hwaddr': 'ec:f4:bb:d6:5f:0d', 'ipv6gateway': '::', 'gateway': ''},

So according to this output, dhcp is disabled (but the ifcfg file says it is enabled). I can not configure these interfaces in the web interface (no pencil), see screen shot I will attach in a minute.

I don't know if this is relevant. Maybe the validator is also checking these values?

* When I compare the network_attachments table for the migration network of the working vs non-working datacenter, the working one has '{ }' in the custom_properties field, and the non-working one has nothing in this field. I don't see any other differences.

Regards,

Rik

Comment 20 Rik Theys 2018-03-12 12:49:05 UTC
Created attachment 1407174 [details]
screenshot that shows two extra (not used) interfaces

Comment 21 Rik Theys 2018-03-13 14:27:07 UTC
Eureka!

I was able to find the root cause of the issue. The issue was not that the address/netmask/gateway was incorrectly/not set, but that for older network_attachments the address/netmask/gateway are set to '' (empty string) in the database and for newer networks to NULL (for networks that have boot_protocol NONE).

When you use psql to list it there's no visual difference, but when I pulled the data using a python script I was able to tell that all my older networks had '' instead of NULL.

After manually updating the database (setting all those fields to NULL) and restarting the engine, I can save the network changes again.

I assume that during some previous upgrade oVirt started using NULL values instead of ''. The cluster on which I experienced the issue is several years old and many oVirt releases old (I believe it started at 3.3 or something).

So the fix would be to update the fields during an engine update.

It would be awesome if this could get fixed in an ovirt update. It may save others a lot of time.

Regards,

Rik

Comment 22 Alona Kaplan 2018-03-14 16:04:12 UTC
Thanks! We will add an upgrade script replace the empty string with null.

Comment 24 eraviv 2018-04-22 08:39:31 UTC
Putting empty string in the db in network_attachments#address field of one of the networks and then following the steps of the reporter should reproduce this.

Reporter is outside Redhat so I doubt they can verify...

Comment 25 Michael Burman 2018-04-22 11:01:39 UTC
Thanks, 

Verified on - 4.2.3.2-0.1.el7

Comment 26 Sandro Bonazzola 2018-05-10 06:34:12 UTC
This bugzilla is included in oVirt 4.2.3 release, published on May 4th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.3 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.