[NEUTRON-72] Null pointer exception at org.opendaylight.neutron.spi.NeutronNetwork.addSubnet Created: 29/Sep/15  Updated: 30/Sep/15  Resolved: 30/Sep/15

Status: Resolved
Project: neutron
Component/s: neutron-spi
Affects Version/s: master
Fix Version/s: None

Type: Bug
Reporter: Rijil Abraham Assignee: Ravindra Kenchappa
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File tempest_log.txt    
Issue Links:
Duplicate
duplicates NEUTRON-63 null pointer exception in NeutronSubn... Resolved
External issue ID: 4365

 Description   

When a tempest test for UPDATE NETWORK is executed, the test fails with the following exception. Few subnets will not be deleted

2015-09-28 08:40:32,999 | WARN | qtp133087245-648 | ServletHandler | 165 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.15.v20140411 | /controller/nb/v2/neutron/subnets
java.lang.NullPointerException
at org.opendaylight.neutron.spi.NeutronNetwork.addSubnet(NeutronNetwork.java:197)[155:org.opendaylight.neutron.spi:0.6.0.SNAPSHOT]
at org.opendaylight.neutron.transcriber.NeutronSubnetInterface.addSubnet(NeutronSubnetInterface.java:118)
at org.opendaylight.neutron.northbound.api.NeutronSubnetsNorthbound.createSubnets(NeutronSubnetsNorthbound.java:218)[219:org.opendaylight.neutron.northbound-api:0.6.0.SNAPSHOT]
at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_79]
at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_79]
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)[218:com.sun.jersey.jersey-server:1.17.0]
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)[218:com.sun.jersey.jersey-server:1.17.0]
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)[218:com.sun.jersey.jersey-server:1.17.0]
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)[218:com.sun.jersey.jersey-server:1.17.0]
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)[218:com.sun.jersey.jersey-server:1.17.0]
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)[218:com.sun.jersey.jersey-server:1.17.0]
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)[218:com.sun.jersey.jersey-server:1.17.0]
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)[218:com.sun.jersey.jersey-server:1.17.0]
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)[218:com.sun.jersey.jersey-server:1.17.0]
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)[218:com.sun.jersey.jersey-server:1.17.0]
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)[218:com.sun.jersey.jersey-server:1.17.0]
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)[216:com.sun.jersey.servlet:1.17.0]
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)[216:com.sun.jersey.servlet:1.17.0]
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)[216:com.sun.jersey.servlet:1.17.0]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)[159:org.apache.geronimo.specs.geronimo-servlet_3.0_spec:1.0.0]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)[165:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]



 Comments   
Comment by Rijil Abraham [ 29/Sep/15 ]

Attachment tempest_log.txt has been added with description: Tempest log

Comment by Ravindra Kenchappa [ 30/Sep/15 ]

This issue is because when a network is modified the existing network is read from MD and here the new instance of NeutronNetwork is created and will be populate with the values read form MD. When the Network is created the SUBNET list is initialized (subnets []) but when the network is read from the MD the SUBET list is set to NULL. So what we have to do is, when the new instance of NeutronNetwork is created in NeutronNetworkInterface.fromMd(Network) call its init() method to set its members to default value, so the SUBNET will be empty list instead of NULL. If for some reason when we read the network info fromMd() the subnet is null then network.subnet[] list will be empty.

With the above two fix/ code changes most of the tempest API test suite (around 250 test cases) are passing. If all of the testcases in API suite pass then only we can move on next test suite where we test end-to-end.

Generated at Wed Feb 07 20:25:29 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.