[BGPCEP-678] Karaf4 Unable to push configuration due to missing yang models Created: 20/Jun/17  Updated: 03/Mar/19  Resolved: 05/Aug/17

Status: Resolved
Project: bgpcep
Component/s: BGP
Affects Version/s: Bugzilla Migration
Fix Version/s: Bugzilla Migration

Type: Bug
Reporter: Claudio David Gasparini Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: File k.log.gz     Text File karaf.log     File log.tar.gz     File odl1_karaf.log.gz    
Issue Links:
Blocks
blocks BGPCEP-667 Failure bringing karaf 4 feature odl-... Resolved
blocks ODLPARENT-23 Milestone: Upgrade karaf to 4.0.1 or ... Resolved
Duplicate
is duplicated by BGPCEP-667 Failure bringing karaf 4 feature odl-... Resolved
External issue ID: 8722

 Description   

2017-06-20 18:33:20,190 | ERROR | config-pusher | ConfigPusherImpl | 214 - org.opendaylight.controller.config-persister-impl - 0.7.0.SNAPSHOT | Unable to push configuration due to missing yang models. Yang models that are missing, but required by the configuration: [urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl?module=odl-bgp-rib-impl-cfg&revision=2016-03-30]. For each mentioned model check: 1. that the mentioned yang model namespace/name/revision is identical to those in the yang model itself 2. the yang file is present in the system 3. the bundle with that yang file is present in the system and active 4. the yang parser did not fail while attempting to parse that model
java.lang.IllegalStateException: Unable to push configuration due to missing yang models. Required yang models that are missing: [urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl?module=odl-bgp-rib-impl-cfg&revision=2016-03-30]
Caused by: org.opendaylight.controller.config.persist.impl.ConfigPusherImpl$NotEnoughCapabilitiesException: Not enough capabilities for 31-bgp.xml(odl-bgpcep-bgp,odl-bgpcep-bgp). Expected but not found: [urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl?module=odl-bgp-rib-impl-cfg&revision=2016-03-30]



 Comments   
Comment by Claudio David Gasparini [ 20/Jun/17 ]

Steps

execute
feature:install odl-restconf odl-bgpcep-bgp

Comment by Claudio David Gasparini [ 21/Jun/17 ]

same issue is observed with bmp feature

2017-06-21 12:22:29,678 | ERROR | config-pusher | ConfigPusherImpl | 213 - org.opendaylight.controller.config-persister-impl - 0.7.0.SNAPSHOT | Unable to push configuration due to missing yang models. Yang models that are missing, but required by the configuration: [urn:opendaylight:params:xml:ns:yang:controller:bmp:impl?module=odl-bmp-impl-cfg&revision=2015-05-18]. For each mentioned model check: 1. that the mentioned yang model namespace/name/revision is identical to those in the yang model itself 2. the yang file is present in the system 3. the bundle with that yang file is present in the system and active 4. the yang parser did not fail while attempting to parse that model
2017-06-21 12:22:29,680 | ERROR | config-pusher | ConfigPusherImpl | 213 - org.opendaylight.controller.config-persister-impl - 0.7.0.SNAPSHOT | Failed to apply configuration snapshot: 32-bmp.xml(odl-bgpcep-bmp,odl-bgpcep-bmp)
java.lang.IllegalStateException: Unable to push configuration due to missing yang models. Required yang models that are missing: [urn:opendaylight:params:xml:ns:yang:controller:bmp:impl?module=odl-bmp-impl-cfg&revision=2015-05-18]
at org.opendaylight.controller.config.persist.impl.ConfigPusherImpl.waitForCapabilities(ConfigPusherImpl.java:204)[213:org.opendaylight.controller.config-persister-impl:0.7.0.SNAPSHOT]
at org.opendaylight.controller.config.persist.impl.ConfigPusherImpl.pushConfigWithConflictingVersionRetries(ConfigPusherImpl.java:154)[213:org.opendaylight.controller.config-persister-impl:0.7.0.SNAPSHOT]
at org.opendaylight.controller.config.persist.impl.ConfigPusherImpl.internalPushConfigs(ConfigPusherImpl.java:124)[213:org.opendaylight.controller.config-persister-impl:0.7.0.SNAPSHOT]
at org.opendaylight.controller.config.persist.impl.ConfigPusherImpl.processSingle(ConfigPusherImpl.java:78)[213:org.opendaylight.controller.config-persister-impl:0.7.0.SNAPSHOT]
at org.opendaylight.controller.config.persist.impl.ConfigPusherImpl.process(ConfigPusherImpl.java:70)[213:org.opendaylight.controller.config-persister-impl:0.7.0.SNAPSHOT]
at org.opendaylight.controller.config.persist.impl.osgi.ConfigPersisterActivator$2.run(ConfigPersisterActivator.java:131)[213:org.opendaylight.controller.config-persister-impl:0.7.0.SNAPSHOT]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]
Caused by: org.opendaylight.controller.config.persist.impl.ConfigPusherImpl$NotEnoughCapabilitiesException: Not enough capabilities for 32-bmp.xml(odl-bgpcep-bmp,odl-bgpcep-bmp). Expected but not found: [urn:opendaylight:params:xml:ns:yang:controller:bmp:impl?module=odl-bmp-impl-cfg&revision=2015-05-18]
at org.opendaylight.controller.config.persist.impl.ConfigPusherImpl.waitForCapabilities(ConfigPusherImpl.java:184)[213:org.opendaylight.controller.config-persister-impl:0.7.0.SNAPSHOT]
... 6 more

Comment by Claudio David Gasparini [ 21/Jun/17 ]

found in logs

2017-06-21 17:14:23,730 | ERROR | pool-2-thread-1 | ModuleInfoBundleTracker | 208 - org.opendaylight.controller.config-manager - 0.7.0.SNAPSHOT | Failed to process bundleentry://196.fwk596706728/META-INF/services/org.opendaylight.yangtools.yang.binding.YangModelBindingProvider for bundle org.opendaylight.bgpcep.bgp-rib-impl_0.8.0.SNAPSHOT [196]
java.lang.IllegalStateException: Error while executing getModuleInfo on org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bgp.rib.impl.rev160330.$YangModelBindingProvider@726b7f4
at org.opendaylight.controller.config.manager.impl.osgi.mapping.ModuleInfoBundleTracker.retrieveModuleInfo(ModuleInfoBundleTracker.java:149)
at org.opendaylight.controller.config.manager.impl.osgi.mapping.ModuleInfoBundleTracker.addingBundle(ModuleInfoBundleTracker.java:86)
at org.opendaylight.controller.config.manager.impl.osgi.mapping.ModuleInfoBundleTracker.addingBundle(ModuleInfoBundleTracker.java:31)
at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:469)[org.osgi.core-6.0.0.jar:]
at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:415)[org.osgi.core-6.0.0.jar:]
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[org.osgi.core-6.0.0.jar:]
at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[org.osgi.core-6.0.0.jar:]
at org.osgi.util.tracker.BundleTracker.open(BundleTracker.java:156)[org.osgi.core-6.0.0.jar:]
at org.opendaylight.controller.config.manager.impl.osgi.mapping.ModuleInfoBundleTracker.open(ModuleInfoBundleTracker.java:55)
at org.opendaylight.controller.config.manager.impl.osgi.ConfigManagerActivator.start(ConfigManagerActivator.java:84)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_131]
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:941)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:318)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.container.Module.doStart(Module.java:571)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.container.Module.start(Module.java:439)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:392)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:411)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1287)[9:org.apache.karaf.features.core:4.0.9]
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:860)[9:org.apache.karaf.features.core:4.0.9]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1176)[9:org.apache.karaf.features.core:4.0.9]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:1074)[9:org.apache.karaf.features.core:4.0.9]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bgp.rib.spi.rev131115.$YangModuleInfoImpl
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bgp.rib.impl.rev160330.$YangModuleInfoImpl.<init>($YangModuleInfoImpl.java:27)
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bgp.rib.impl.rev160330.$YangModuleInfoImpl.<clinit>($YangModuleInfoImpl.java:10)
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bgp.rib.impl.rev160330.$YangModelBindingProvider.getModuleInfo($YangModelBindingProvider.java:6)
at org.opendaylight.controller.config.manager.impl.osgi.mapping.ModuleInfoBundleTracker.retrieveModuleInfo(ModuleInfoBundleTracker.java:147)
... 28 more

Comment by Claudio David Gasparini [ 21/Jun/17 ]

Attachment karaf.log has been added with description: log

Comment by Claudio David Gasparini [ 21/Jun/17 ]

Attachment log.tar.gz has been added with description: fullLogs

Comment by Peter Gubka [ 04/Jul/17 ]

This is also applicable for bmp

2017-07-04 13:49:10,232 | ERROR | config-pusher | ConfigPusherImpl | 237 - org.opendaylight.controller.config-persister-impl - 0.7.0.SNAPSHOT | Failed to apply configuration snapshot: 31-bgp.xml(odl-bgpcep-bmp,odl-bgpcep-bmp)
java.lang.IllegalStateException: Unable to push configuration due to missing yang models. Required yang models that are missing: [urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl?module=odl-bgp-rib-impl-cfg&revision=2016-03-30]
at org.opendaylight.controller.config.persist.impl.ConfigPusherImpl.waitForCapabilities(ConfigPusherImpl.java:204)[237:org.opendaylight.controller.config-persister-impl:0.7.0.SNAPSHOT]
at org.opendaylight.controller.config.persist.impl.ConfigPusherImpl.pushConfigWithConflictingVersionRetries(ConfigPusherImpl.java:154)[237:org.opendaylight.controller.config-persister-impl:0.7.0.SNAPSHOT]
at org.opendaylight.controller.config.persist.impl.ConfigPusherImpl.internalPushConfigs(ConfigPusherImpl.java:124)[237:org.opendaylight.controller.config-persister-impl:0.7.0.SNAPSHOT]

log in attachment.

Comment by Peter Gubka [ 04/Jul/17 ]

Attachment odl1_karaf.log.gz has been added with description: bmp log

Comment by Peter Gubka [ 04/Jul/17 ]

because the https://jenkins.opendaylight.org/releng/view/bgpcep/job/bgpcep-csit-1node-userfeatures-only-nitrogen/ performs badly, i increased the importance to major

Comment by Claudio David Gasparini [ 05/Jul/17 ]

seems to be some packaging issue

Caused by: java.lang.IllegalStateException: Resource '/META-INF/yang/odl-bgp-rib-spi-cfg.yang' is missing

compiled and tested today's distribution and it worked fine, but I see that today's test failed.
I will recheck it tomorrow, to check whether this is intermittent or whether has been solved somewhere else.

Comment by Claudio David Gasparini [ 10/Jul/17 ]

Issue still present

2017-07-10 10:40:08,185 | ERROR | pool-2-thread-1 | ModuleInfoBundleTracker | 209 - org.opendaylight.controller.config-manager - 0.7.0.SNAPSHOT | Failed to process bundleentry://177.fwk1088872417/META-INF/services/org.opendaylight.yangtools.yang.binding.YangModelBindingProvider for bundle org.opendaylight.bgpcep.bgp-bmp-impl_0.8.0.SNAPSHOT [177]
java.lang.IllegalStateException: Error while executing getModuleInfo on org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bmp.impl.rev150518.$YangModelBindingProvider@62d385d0
at org.opendaylight.controller.config.manager.impl.osgi.mapping.ModuleInfoBundleTracker.retrieveModuleInfo(ModuleInfoBundleTracker.java:149)
at org.opendaylight.controller.config.manager.impl.osgi.mapping.ModuleInfoBundleTracker.addingBundle(ModuleInfoBundleTracker.java:86)
at org.opendaylight.controller.config.manager.impl.osgi.mapping.ModuleInfoBundleTracker.addingBundle(ModuleInfoBundleTracker.java:31)
at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:469)[org.osgi.core-6.0.0.jar:]
at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:415)[org.osgi.core-6.0.0.jar:]
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[org.osgi.core-6.0.0.jar:]
at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[org.osgi.core-6.0.0.jar:]
at org.osgi.util.tracker.BundleTracker.open(BundleTracker.java:156)[org.osgi.core-6.0.0.jar:]
at org.opendaylight.controller.config.manager.impl.osgi.mapping.ModuleInfoBundleTracker.open(ModuleInfoBundleTracker.java:55)
at org.opendaylight.controller.config.manager.impl.osgi.ConfigManagerActivator.start(ConfigManagerActivator.java:84)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_131]
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:941)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:318)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.container.Module.doStart(Module.java:571)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.container.Module.start(Module.java:439)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:392)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:411)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1287)[9:org.apache.karaf.features.core:4.0.9]
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:860)[9:org.apache.karaf.features.core:4.0.9]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1176)[9:org.apache.karaf.features.core:4.0.9]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:1074)[9:org.apache.karaf.features.core:4.0.9]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]
Caused by: java.lang.ExceptionInInitializerError
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bmp.impl.rev150518.$YangModuleInfoImpl.<init>($YangModuleInfoImpl.java:31)
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bmp.impl.rev150518.$YangModuleInfoImpl.<clinit>($YangModuleInfoImpl.java:10)
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bmp.impl.rev150518.$YangModelBindingProvider.getModuleInfo($YangModelBindingProvider.java:6)
at org.opendaylight.controller.config.manager.impl.osgi.mapping.ModuleInfoBundleTracker.retrieveModuleInfo(ModuleInfoBundleTracker.java:147)
... 28 more
Caused by: java.lang.IllegalStateException: Resource '/META-INF/yang/odl-bgp-rib-spi-cfg.yang' is missing
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bgp.rib.spi.rev131115.$YangModuleInfoImpl.<init>($YangModuleInfoImpl.java:30)
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bgp.rib.spi.rev131115.$YangModuleInfoImpl.<clinit>($YangModuleInfoImpl.java:10)
... 32 more

Comment by Claudio David Gasparini [ 10/Jul/17 ]

yang file is seen inside the bundle as expected

Comment by Peter Gubka [ 24/Jul/17 ]

The exception is present in the logs and the overall job has a very bad pass rate.

https://logs.opendaylight.org/releng/jenkins092/bgpcep-csit-1node-userfeatures-only-nitrogen/90/odl1_karaf.log.gz

Comment by Vratko Polak [ 28/Jul/17 ]

I tried to narrow this down. The error happens when installing (on Karaf with no ODL features in featuresBoot):
feature:install odl-bgpcep-bgp-rib-impl

And it does not happen in either install in this order:
feature:install odl-bgpcep-bgp-rib-api
feature:install odl-bgpcep-bgp-rib-impl

Here are the two final causes again:

Caused by: java.lang.ExceptionInInitializerError
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bgp.rib.impl.rev160330.$YangModuleInfoImpl.<init>($YangModuleInfoImpl.java:41)
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bgp.rib.impl.rev160330.$YangModuleInfoImpl.<clinit>($YangModuleInfoImpl.java:10)
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bgp.rib.impl.rev160330.$YangModelBindingProvider.getModuleInfo($YangModelBindingProvider.java:6)
at org.opendaylight.controller.config.manager.impl.osgi.mapping.ModuleInfoBundleTracker.retrieveModuleInfo(ModuleInfoBundleTracker.java:147)
... 28 more
Caused by: java.lang.IllegalStateException: Resource '/META-INF/yang/odl-bgp-rib-spi-cfg.yang' is missing
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bgp.rib.spi.rev131115.$YangModuleInfoImpl.<init>($YangModuleInfoImpl.java:30)
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bgp.rib.spi.rev131115.$YangModuleInfoImpl.<clinit>($YangModuleInfoImpl.java:10)
... 32 more

bgp.rib.spi.rev131115.$YangModuleInfoImpl implies the bundle was loaded enough for the class to be executing, but apparently not enough for locating resource present there.

Assigning to Mdsal/bindingv1 as that (as opposed to config subsystem) is the part of code which does not work as expected.

Comment by Robert Varga [ 28/Jul/17 ]

So from infrastructure (controller-and-below) perspective what happens is:

Compile-time:

  • the resource is bundled by yang-maven-plugin
  • the code requesting it is generated by mdsal binding-v1
  • the result is packaged into a bundle

Run-time:

  • the bundle is deployed into OSGi
  • the bundle enters RESOLVED state. binding-v1-generated code is structured in a way that ensures all the model's dependencies have been previously RESOLVED
  • the bundle is picked up by mdsal's binding runtime (listenining on OSGi events), identified as having model
  • the bundle is determined to contain a binding-v1-generated model provider
  • the bundle is added to a YANG parser reactor
  • SchemaContext assembly is attempted
  • the reactor requests the model source file from the generated code
  • Class.getResource() fails to find the file located in the same jar as the class

The only explanation for this is that something at-or-below OSGi is happening, probably involving karaf's bundle cache location.

Check that the bundle is present in only a single feature, no bundle refreshes/reinstalls are happening. I suspect a reinstall, as that would involve erasing things from the filesystem...

Comment by Robert Varga [ 28/Jul/17 ]

Right, and:

Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bgp.rib.spi.rev131115.$YangModuleInfoImpl
at

should never happen, either.

Comment by Vratko Polak [ 01/Aug/17 ]

> Check that the bundle is present in only a single feature,

It is, only odl-bgpcep-bgp-rib-api feature depends directly on bgp-rib-spi bundle.

But odl-bgpcep-bgp-rib-api feature also depends on bundles bgp-parser-api and bgp-parser-spi, which are also among dependencies of odl-bgpcep-bgp-parser feature. And both of those features are dependencies of odl-bgpcep-bgp feature, which is in featuresBoot.

Is "the bundle is present in only a single feature" a Nitrogen requirement for all bundles (with bundled resources)?
If yes, multiple projects would need to restructure their features.

> no bundle refreshes/reinstalls are happening.

There is this segment, but it does not seem to be related:

2017-08-01 12:17:01,688 | INFO | pool-2-thread-1 | FeaturesServiceImpl | 6 - org.apache.karaf.features.core - 4.0.9 | Stopping bundles:
2017-08-01 12:17:01,689 | INFO | pool-2-thread-1 | FeaturesServiceImpl | 6 - org.apache.karaf.features.core - 4.0.9 | org.ops4j.pax.jdbc.config/1.0.1
2017-08-01 12:17:01,691 | INFO | pool-2-thread-1 | FeaturesServiceImpl | 6 - org.apache.karaf.features.core - 4.0.9 | org.apache.servicemix.bundles.jasypt/1.9.2.1
2017-08-01 12:17:01,691 | INFO | pool-2-thread-1 | FeaturesServiceImpl | 6 - org.apache.karaf.features.core - 4.0.9 | Refreshing bundles:
2017-08-01 12:17:01,691 | INFO | pool-2-thread-1 | FeaturesServiceImpl | 6 - org.apache.karaf.features.core - 4.0.9 | org.apache.servicemix.bundles.jasypt/1.9.2.1 (Should be wired to: javax.servlet-api/3.1.0 (through [org.apache.servicemix.bundles.jasypt/1.9.2.1] osgi.wiring.package; filter:="(osgi.wiring.package=javax.servlet)"; resolution:=optional))
2017-08-01 12:17:01,691 | INFO | pool-2-thread-1 | FeaturesServiceImpl | 6 - org.apache.karaf.features.core - 4.0.9 | org.ops4j.pax.jdbc.config/1.0.1 (Wired to org.apache.servicemix.bundles.jasypt/1.9.2.1 which is being refreshed)

> I suspect a reinstall

Not visible in karaf.log (at INFO level).

Comment by Vratko Polak [ 02/Aug/17 ]

> which are also among dependencies

I tried to extract the two bundles to a separate feature [1]. But it had no effect on the test behavior. Both "resource is missing" and "could not initialize class" error are still present in the karaf log [2].

> the reactor requests the model source file from the generated code

Not sure about that. I mean, I think this Bug hits already in the "the bundle is determined to contain a binding-v1-generated model provider" step. Line numbers in the stack traces show the exception comes from the constructor (line generated here [3], called from downstream constructor line generated here [4]), as opposed to coming from getModuleSourceStream (line generated here [5]).

[1] https://git.opendaylight.org/gerrit/#/c/61036/2
[2] https://logs.opendaylight.org/sandbox/jenkins091/bgpcep-csit-1node-userfeatures-only-nitrogen/2/odl1_karaf.log.gz
[3] https://git.opendaylight.org/gerrit/gitweb?p=mdsal.git;a=blob;f=binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/YangModuleInfoTemplate.xtend;h=5b791a57a69ca829b95ba6cf1649a1ffc2652603;hb=refs/heads/master#l140
[4] https://git.opendaylight.org/gerrit/gitweb?p=mdsal.git;a=blob;f=binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/YangModuleInfoTemplate.xtend;h=5b791a57a69ca829b95ba6cf1649a1ffc2652603;hb=refs/heads/master#l123
[5] https://git.opendaylight.org/gerrit/gitweb?p=mdsal.git;a=blob;f=binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/YangModuleInfoTemplate.xtend;h=5b791a57a69ca829b95ba6cf1649a1ffc2652603;hb=refs/heads/master#l168

Comment by Robert Varga [ 04/Aug/17 ]

Enabled traces on org.opendaylight.controller.config.manager.impl.osgi show that the bundle events are firing in an order which is not making complete sense:

2017-08-04 17:31:43,832 | DEBUG | pool-2-thread-1 | ModuleInfoBundleTracker | 117 - org.opendaylight.controller.config-manager - 0.7.0.Nitrogen | Got addingBundle(org.opendaylight.bgpcep.bgp-rib-api_0.8.0.Nitrogen [107]) with YangModelBindingProvider resource bundleentry://107.fwk521960438/META-INF/service
s/org.opendaylight.yangtools.yang.binding.YangModelBindingProvider
2017-08-04 17:31:43,837 | DEBUG | pool-2-thread-1 | ModuleInfoBundleTracker | 117 - org.opendaylight.controller.config-manager - 0.7.0.Nitrogen | Got addingBundle(org.opendaylight.bgpcep.bgp-rib-impl_0.8.0.Nitrogen [108]) with YangModelBindingProvider resource bundleentry://108.fwk521960438/META-INF/services/org.opendaylight.yangtools.yang.binding.YangModelBindingProvider
2017-08-04 17:31:43,861 | DEBUG | pool-2-thread-1 | ModuleInfoBundleTracker | 117 - org.opendaylight.controller.config-manager - 0.7.0.Nitrogen | Got addingBundle(org.opendaylight.bgpcep.bgp-rib-spi_0.8.0.Nitrogen [109]) with YangModelBindingProvider resource bundleentry://109.fwk521960438/META-INF/services/org.opendaylight.yangtools.yang.binding.YangModelBindingProvider

I.e. bgp-rib-impl is reported as resolved just before bgp-rib-spi on which it depends. The exception is thrown during processing of bgp-rib-impl.

Comment by Robert Varga [ 04/Aug/17 ]

Attachment k.log.gz has been added with description: logs with tracing enabled

Comment by Robert Varga [ 04/Aug/17 ]

This is a bug in ModuleInfoBundleTracker, as it is reacting to wrong events.

Comment by Robert Varga [ 04/Aug/17 ]

The issue is that we are starting scanning the bundle when it is first reported, which is usually with no event at all – hence we are reacting to bundles even before they are actually ordered by their dependencies and before they are actually resolved.

Comment by Robert Varga [ 04/Aug/17 ]

After prototyping a patch, https://git.opendaylight.org/gerrit/61194, which does not help one bit, I got struck with the tail end of the log message:

Caused by: java.lang.IllegalStateException: Resource '/META-INF/yang/odl-bgp-rib-spi-cfg.yang' is missing
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bgp.rib.spi.rev131115.$YangModuleInfoImpl.<init>($YangModuleInfoImpl.java:30)[108:org.opendaylight.bgpcep.bgp-rib-impl:0.8.0.Nitrogen]
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bgp.rib.spi.rev131115.$YangModuleInfoImpl.<clinit>($YangModuleInfoImpl.java:10)[108:org.opendaylight.bgpcep.bgp-rib-impl:0.8.0.Nitrogen]
... 33 more

Note how spi.rev131115 YangModuleInfoImpl resides in bgp-rib-impl – and it should be in bgp-rib-spi. Rebuilding bgpcep shows that the resulting jar file in fact contains these files – hence we are dealing with a split package, which leads to this grief.

Comment by Robert Varga [ 04/Aug/17 ]

This regression was introduced by https://git.opendaylight.org/gerrit/39808 and just happened to work.

https://git.opendaylight.org/gerrit/61211 fixes it up.

Comment by Kevin Wang [ 04/Aug/17 ]

Hi Robert,

I am confused about the cause. Is it due to wrong order of "export-package" or what? I see my patch only exported more packages. I am not very clear what your patch actually fixes.
I am also wondering why this is considered as regression as the patched was merged 1 year ago. Do we have similar issue in Boron/Carbon before?

Please help me understand the problem. Thanks.

Comment by Robert Varga [ 04/Aug/17 ]

Compare the resulting MANIFEST.MF and .jar contents vs. the contents of things like bgp-rib-api.

Your change caused packages from dependencies to be re-exported, leading to them being merged in bgp-rib-impl.

Comment by Kevin Wang [ 04/Aug/17 ]

To be clear org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bgp.rib.spi.rev131115
is re-exported by org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.bgp.* and caused the problem?

Is this problem tight to karaf4? I never see such issue before.

Comment by Robert Varga [ 04/Aug/17 ]

Compare the results as I mentioned, google for 'osgi split package'. If what is happening and why is not clear, use 'karaf debug' and attach a debugger to under what is going on.

Generated at Wed Feb 07 19:13:48 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.