yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #26656
[Bug 1408230] [NEW] name validate check is necessary for neutron-core
Public bug reported:
So far, the validate check of name when creating network subnet and port is not functional.
This is because the validate attribute of name in the RESOURCE_ATTRIBUTE_MAP of neutron/api/v2/attributes.py is set to "None".
When user inputs a more than 255 length name on purpose, an internal DB Error will return.
==========CLI result: network==========
$ neutron net-create 1234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678
Request Failed: internal server error while processing your request.
===================================
==========CLI result: subnet==========
$ neutron subnet-create hogehoge --name 1234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678 192.168.1.0/24
Request Failed: internal server error while processing your request.
===================================
==========CLI result: port==========
stack@neutron-ctrl:~/devstack$ neutron port-create hogehoge --name 1234567812345
67812345678123456781234567812345678123456781234567812345678123456781234567812345
67812345678123456781234567812345678123456781234567812345678123456781234567812345
67812345678123456781234567812345678123456781234567812345678123456781234567812345
678
Request Failed: internal server error while processing your request.
====================================
==========Trace log: network==========
2015-01-08 02:11:05.152 2469 TRACE neutron.api.v2.resource DBError: (DataError) (1406, "Data too long for column 'name' at row 1") 'INSERT INTO networks (tenant_id, id, name, status, admin_state_up, shared) VALUES (%s, %s, %s, %s, %s, %s)' ('ea398e22f5b74d8aa7ed19a41269690e', 'f9cd32ac-6fb6-4a2f-9fd9-d8c48df5ade0', '1234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678', 'ACTIVE', 1, 0)
====================================
==========Trace log: subnet==========
2015-01-08 01:54:56.821 2469 TRACE neutron.api.v2.resource DBError: (DataError) (1406, "Data too long for column 'name' at row 1") 'INSERT INTO subnets (tenant_id, id, name, network_id, ip_version, cidr, gateway_ip, enable_dhcp, shared, ipv6_ra_mode, ipv6_address_mode) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' ('ea398e22f5b74d8aa7ed19a41269690e', '3dde1013-8f9c-41f6-9d87-0a47bac77ab1', '1234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678', '5d61a7be-f0e0-4391-930a-62c100a4dcad', 4, '192.168.1.0/24', '192.168.1.1', 1, 0, None, None)
====================================
==========Trace log: port==========
2015-01-08 02:00:11.032 2469 TRACE neutron.api.v2.resource DBError: (DataError) (1406, "Data too long for column 'name' at row 1") 'INSERT INTO ports (tenant_id, id, name, network_id, mac_address, admin_state_up, status, device_id, device_owner) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)' ('ea398e22f5b74d8aa7ed19a41269690e', '983d6be6-987b-4eb7-94e7-a85518600b3c', '1234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678', '5d61a7be-f0e0-4391-930a-62c100a4dcad', 'fa:16:3e:1d:f6:cb', 1, 'DOWN', '', '')
===========================
It is better for neutron to return something like 400 Bad Request Error intend of internal DB Error.
The validate check of name length should be limited to 255.
** Affects: neutron
Importance: Undecided
Assignee: watanabe.isao (watanabe.isao)
Status: In Progress
** Tags: neutron-core
** Changed in: neutron
Assignee: (unassigned) => watanabe.isao (watanabe.isao)
** Changed in: neutron
Status: New => In Progress
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1408230
Title:
name validate check is necessary for neutron-core
Status in OpenStack Neutron (virtual network service):
In Progress
Bug description:
So far, the validate check of name when creating network subnet and port is not functional.
This is because the validate attribute of name in the RESOURCE_ATTRIBUTE_MAP of neutron/api/v2/attributes.py is set to "None".
When user inputs a more than 255 length name on purpose, an internal DB Error will return.
==========CLI result: network==========
$ neutron net-create 1234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678
Request Failed: internal server error while processing your request.
===================================
==========CLI result: subnet==========
$ neutron subnet-create hogehoge --name 1234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678 192.168.1.0/24
Request Failed: internal server error while processing your request.
===================================
==========CLI result: port==========
stack@neutron-ctrl:~/devstack$ neutron port-create hogehoge --name 1234567812345
67812345678123456781234567812345678123456781234567812345678123456781234567812345
67812345678123456781234567812345678123456781234567812345678123456781234567812345
67812345678123456781234567812345678123456781234567812345678123456781234567812345
678
Request Failed: internal server error while processing your request.
====================================
==========Trace log: network==========
2015-01-08 02:11:05.152 2469 TRACE neutron.api.v2.resource DBError: (DataError) (1406, "Data too long for column 'name' at row 1") 'INSERT INTO networks (tenant_id, id, name, status, admin_state_up, shared) VALUES (%s, %s, %s, %s, %s, %s)' ('ea398e22f5b74d8aa7ed19a41269690e', 'f9cd32ac-6fb6-4a2f-9fd9-d8c48df5ade0', '1234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678', 'ACTIVE', 1, 0)
====================================
==========Trace log: subnet==========
2015-01-08 01:54:56.821 2469 TRACE neutron.api.v2.resource DBError: (DataError) (1406, "Data too long for column 'name' at row 1") 'INSERT INTO subnets (tenant_id, id, name, network_id, ip_version, cidr, gateway_ip, enable_dhcp, shared, ipv6_ra_mode, ipv6_address_mode) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' ('ea398e22f5b74d8aa7ed19a41269690e', '3dde1013-8f9c-41f6-9d87-0a47bac77ab1', '1234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678', '5d61a7be-f0e0-4391-930a-62c100a4dcad', 4, '192.168.1.0/24', '192.168.1.1', 1, 0, None, None)
====================================
==========Trace log: port==========
2015-01-08 02:00:11.032 2469 TRACE neutron.api.v2.resource DBError: (DataError) (1406, "Data too long for column 'name' at row 1") 'INSERT INTO ports (tenant_id, id, name, network_id, mac_address, admin_state_up, status, device_id, device_owner) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)' ('ea398e22f5b74d8aa7ed19a41269690e', '983d6be6-987b-4eb7-94e7-a85518600b3c', '1234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678', '5d61a7be-f0e0-4391-930a-62c100a4dcad', 'fa:16:3e:1d:f6:cb', 1, 'DOWN', '', '')
===========================
It is better for neutron to return something like 400 Bad Request Error intend of internal DB Error.
The validate check of name length should be limited to 255.
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1408230/+subscriptions
Follow ups
References