[NEUTRON-129] Null pointer on port creation Created: 13/Jun/16  Updated: 19/Oct/17  Resolved: 18/Aug/16

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

Type: Bug
Reporter: Wojciech Dec Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 6053

 Description   

The following Null Pointer Exception is thrown when creating a Neutron Port as specified below:

<p>Problem accessing /controller/nb/v2/neutron/ports. Reason:
<pre> Server Error</pre></p><h3>Caused by:</h3><pre>java.lang.NullPointerException
at org.opendaylight.neutron.transcriber.NeutronPortInterface.toMd(NeutronPortInterface.java:288)
at org.opendaylight.neutron.transcriber.NeutronPortInterface.toMd(NeutronPortInterface.java:55)
at org.opendaylight.neutron.transcriber.AbstractNeutronInterface.updateMd(AbstractNeutronInterface.java:119)
at org.opendaylight.neutron.transcriber.AbstractNeutronInterface.addMd(AbstractNeutronInterface.java:102)
at org.opendaylight.neutron.transcriber.AbstractNeutronInterface.add(AbstractNeutronInterface.java:283)
at org.opendaylight.neutron.transcriber.AbstractNeutronInterface.add(AbstractNeutronInterface.java:293)

"port": [
{
"binding:host_id": "overcloud-novacompute-1",
"description": "",
"allowed_address_pairs": [],
"extra_dhcp_opts": [],
"updated_at": "2016-06-10T17:15:19",
"device_owner": "",
"port_security_enabled": true,
"binding:profile": {},
"qos_policy_id": null,
"fixed_ips": [

{ "subnet_id": "9eb9d4f7-1446-42e9-aa4d-f90b0c09919a", "ip_address": "10.100.1.48" }

],
"id": "06bbd0b0-fda8-4c40-a793-99fcc0aaa746",
"security_groups": [
{
"tenant_id": "0b18aae5ad924a01a594bd5148fc95df",
"description": "Default security group",
"id": "9d3c207a-3d2a-488d-9be1-cf6387bc59af",
"security_group_rules": [

{ "direction": "egress", "protocol": null, "description": "", "port_range_max": null, "id": "1c105dc5-36f6-4a3a-94fe-3ef666bf2356", "remote_group_id": null, "remote_ip_prefix": null, "security_group_id": "9d3c207a-3d2a-488d-9be1-cf6387bc59af", "tenant_id": "0b18aae5ad924a01a594bd5148fc95df", "port_range_min": null, "ethertype": "IPv4" }

,

{ "direction": "ingress", "protocol": null, "description": "", "port_range_max": null, "id": "31832742-5d34-49b9-bddb-dc4a56c98eb6”, "remote_group_id": "9d3c207a-3d2a-488d-9be1-cf6387bc59af", "remote_ip_prefix": null, "security_group_id": "9d3c207a-3d2a-488d-9be1-cf6387bc59af", "tenant_id": "0b18aae5ad924a01a594bd5148fc95df", "port_range_min": null, "ethertype": "IPv6" }

,

{ "direction": "egress", "protocol": null, "description": "", "port_range_max": null, "id": "d65814dd-d57f-4471-96b7-28003f792629", "remote_group_id": null, "remote_ip_prefix": null, "security_group_id": "9d3c207a-3d2a-488d-9be1-cf6387bc59af", "tenant_id": "0b18aae5ad924a01a594bd5148fc95df", "port_range_min": null, "ethertype": "IPv6" }

,

{ "direction": "ingress", "protocol": null, "description": "", "port_range_max": null, "id": "eec6078c-e9a1-409c-84e7-fa6d675c4fa4", "remote_group_id": "9d3c207a-3d2a-488d-9be1-cf6387bc59af", "remote_ip_prefix": null, "security_group_id": "9d3c207a-3d2a-488d-9be1-cf6387bc59af", "tenant_id": "0b18aae5ad924a01a594bd5148fc95df", "port_range_min": null, "ethertype": "IPv4" }

],
"name": "default"
}



 Comments   
Comment by Ed Warnicke [ 13/Jun/16 ]

Try removing fields that have a 'null' value, example:

"qos_policy_id": null,

When I remove those fields, everything works fine.

Please also note, qos_policy_id isn't even a supported field, but apparently
a value 'null' is confusing JAXB in some way.

Comment by Ed Warnicke [ 14/Jun/16 ]

This should fix the NPE:

https://git.opendaylight.org/gerrit/#/c/40272/

Comment by Isaku Yamahata [ 14/Jun/16 ]

You hit MOXy bug.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=475475
networking-odl has already the bug workaround.
https://review.openstack.org/#/c/281621/

I uploaded a new patch to add qos_policy_id to its bug workaround at
https://review.openstack.org/#/c/329596/

If it works for you, I'll merge the patch for networking-odl.

Comment by Isaku Yamahata [ 15/Jun/16 ]

I merged tha patch https://review.openstack.org/#/c/329596/ into networking-odl.
Can you please test it?

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