Bug 1574191 - SyncNetworkProviderCommand fails on NPE if Provider is DNP of a Cluster with no DC
Summary: SyncNetworkProviderCommand fails on NPE if Provider is DNP of a Cluster with ...
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Network
Version: future
Hardware: x86_64
OS: Unspecified
Target Milestone: ovirt-4.2.4
: ---
Assignee: Dominik Holler
QA Contact: Michael Burman
Depends On:
TreeView+ depends on / blocked
Reported: 2018-05-02 19:11 UTC by Elad
Modified: 2018-06-26 08:45 UTC (History)
3 users (show)

Fixed In Version: ovirt-engine-4.2.4
Doc Type: Bug Fix
Doc Text:
Cause: If there is a cluster without a data center, but with a default network provider, network synchronization of the provider fails. Consequence: Automatic network synchronization fails. Fix: Clusters without a data center are skipped during network synchronization. Result: Automatic network synchronization does not fails, if there is a cluster without a data center, but with a default network provider.
Clone Of:
Last Closed: 2018-06-26 08:45:11 UTC
oVirt Team: Network
rule-engine: ovirt-4.2+

Attachments (Terms of Use)
engine and server logs (205.46 KB, application/x-gzip)
2018-05-02 19:11 UTC, Elad
no flags Details

System ID Private Priority Status Summary Last Updated
oVirt gerrit 90878 0 master MERGED core: Fix handling of clusters without dc on auto-sync 2018-05-07 12:08:36 UTC
oVirt gerrit 90974 0 ovirt-engine-4.2 MERGED core: Fix handling of clusters without dc on auto-sync 2018-05-08 08:39:26 UTC

Description Elad 2018-05-02 19:11:30 UTC
Created attachment 1430253 [details]
engine and server logs

Description of problem:
SyncNetworkProviderCommand fails on NPE for the default ovirt-provider-ovn external network provider

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

How reproducible:

Steps to Reproduce:
1. Have a RHV setup with the default ovirt-provider-ovn external network provider

Actual results:
Every 5 minutes:

2018-05-02 21:43:49,997+03 INFO  [org.ovirt.engine.core.bll.provider.network.SyncNetworkProviderCommand] (EE-ManagedThreadFactory-engineScheduled-Thread-56) [41a075c4] Lock Acquired to object 'EngineLock:{exclus
iveLocks='[4f5111ff-99a4-40fa-a164-84c9c7b7b6cf=PROVIDER]', sharedLocks=''}'
2018-05-02 21:43:50,018+03 INFO  [org.ovirt.engine.core.bll.provider.network.SyncNetworkProviderCommand] (EE-ManagedThreadFactory-engineScheduled-Thread-56) [41a075c4] Running command: SyncNetworkProviderCommand
 internal: true.
2018-05-02 21:43:50,252+03 INFO  [org.ovirt.engine.core.sso.utils.AuthenticationUtils] (default task-11) [] User admin@internal successfully logged in with scopes: ovirt-app-api ovirt-ext=token-info:authz-search
 ovirt-ext=token-info:public-authz-search ovirt-ext=token-info:validate ovirt-ext=token:password-access
2018-05-02 21:43:50,511+03 ERROR [org.ovirt.engine.core.bll.provider.network.SyncNetworkProviderCommand] (EE-ManagedThreadFactory-engineScheduled-Thread-56) [41a075c4] Command 'org.ovirt.engine.core.bll.provider
.network.SyncNetworkProviderCommand' failed: null
2018-05-02 21:43:50,511+03 ERROR [org.ovirt.engine.core.bll.provider.network.SyncNetworkProviderCommand] (EE-ManagedThreadFactory-engineScheduled-Thread-56) [41a075c4] Exception: java.lang.NullPointerException
        at org.ovirt.engine.core.bll.provider.network.SyncNetworkProviderCommand.lambda$executeCommand$3(SyncNetworkProviderCommand.java:152) [bll.jar:]
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) [rt.jar:1.8.0_161]
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) [rt.jar:1.8.0_161]
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) [rt.jar:1.8.0_161]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) [rt.jar:1.8.0_161]
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) [rt.jar:1.8.0_161]
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [rt.jar:1.8.0_161]
        at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) [rt.jar:1.8.0_161]
        at org.ovirt.engine.core.bll.provider.network.SyncNetworkProviderCommand.executeCommand(SyncNetworkProviderCommand.java:154) [bll.jar:]

Additional info:
engine and server logs attached, please ask for more info if needed.

Comment 1 Michael Burman 2018-05-03 08:38:51 UTC
I don't see this on my environments

Comment 2 Dominik Holler 2018-05-03 09:00:12 UTC
Hi  Elad,
would you share please the output of
sudo su - postgres -c "psql -U postgres engine -c  'select  cluster_id,name,storage_pool_id,default_network_provider_id from cluster;'"
sudo su - postgres -c "psql -U postgres engine -c  'select id,name,provider_type,auto_sync from providers;'"

Comment 3 Elad 2018-05-03 09:17:29 UTC
[root@storage-ge-02 ~]# sudo su - postgres -c "psql -U postgres engine -c  'select  cluster_id,name,storage_pool_id,default_network_provider_id from cluster;'"
              cluster_id              |        name        |           storage_pool_id            |     default_network_provider_id      
 8d6ffbb0-e975-4ace-adc3-def0af5ce972 | golden_env_mixed_2 | 49c00996-950e-46e0-af83-e76fcb8b2184 | 
 05d68095-9e6c-4661-bdf3-dfb945a2bf5c | golden_env_mixed_1 | 49c00996-950e-46e0-af83-e76fcb8b2184 | 
 12597888-4ae1-11e8-a876-001a4a16972d | Default            |                                      | 4f5111ff-99a4-40fa-a164-84c9c7b7b6cf
(3 rows)

Comment 4 Dominik Holler 2018-05-03 09:51:31 UTC
Thanks, the problem is that the cluster default has no storage_pool_id / data center. From my point of view, this should be not allowed, but the db allows this. I will do some research on this.

Comment 5 Dominik Holler 2018-05-03 12:01:55 UTC
It is allowed for clusters to have no data center, so SyncNetworkProviderCommand should handle this.

Comment 6 Michael Burman 2018-05-03 12:51:38 UTC
Dominik, can you please update then the summary of this report?

Comment 7 Michael Burman 2018-05-27 14:35:21 UTC
Verified on - 4.2.4-0.1.el7

Comment 8 Sandro Bonazzola 2018-06-26 08:45:11 UTC
This bugzilla is included in oVirt 4.2.4 release, published on June 26th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.4 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.