)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"f82671871587f97d8d4a1034d0debf62fa7a9321","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"5eb8661f_09c761a1","updated":"2024-11-13 08:13:44.000000000","message":"Can you explain the rationale of this patch? Why should we don\u0027t fail in case of having a wrong formatted MAC address? From your unit tests, the address \"11:22:33:44\" cannot be accepted and must fail.","commit_id":"7d2b445a44936dcd860d6f42fe1515252ba0cda2"},{"author":{"_account_id":37479,"name":"Yusri Shaharin","display_name":"Mohamad Yusri Shaharin","email":"yusri.shaharin@gmail.com","username":"yusrishaharin"},"change_message_id":"86f8bb4c59ba2f2684e20a6eae0613e0f6f0dedf","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"0db65ff7_aad6ad4f","updated":"2024-11-14 07:50:29.000000000","message":"The issue can be reproduced as follows where netaddr.EUI(...) will throw IndexError:\n```\n# openstack --insecure port list --mac-address fa:16:3e:4e -c ID -c mac_address\nHttpException: 500: Server Error for url: https://compute-api.svc.vstoragedomain.:9697/v2.0/ports?fields\u003did\u0026fields\u003dname\u0026fields\u003dmac_address\u0026fields\u003dfixed_ips\u0026fields\u003dstatus\u0026mac_address\u003dfa%3A16%3A3e%3A4e, Request Failed: internal server error while processing your request.\n```\na successful query:\n```\n# openstack --insecure port list --mac-address fa:16:3e:4e:92:7a -c ID -c mac_address\n+--------------------------------------+-------------------+\n| ID                                   | MAC Address       |\n+--------------------------------------+-------------------+\n| daec4c55-6b83-4f6e-bc99-767ea7a63b51 | fa:16:3e:4e:92:7a |\n+--------------------------------------+-------------------+\n```\nan empty result query, where netaddr.EUI(..) will throw netaddr.core.AddrFormatError:\n```\n# openstack --insecure port list --mac-address fa:16:3e:4e:92 -c ID -c mac_address\n\n```","commit_id":"7d2b445a44936dcd860d6f42fe1515252ba0cda2"},{"author":{"_account_id":37479,"name":"Yusri Shaharin","display_name":"Mohamad Yusri Shaharin","email":"yusri.shaharin@gmail.com","username":"yusrishaharin"},"change_message_id":"49d69ae3886dd274cad891dc6fa7a7f5f4504ebe","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"86f4c005_a37ad373","updated":"2024-11-13 10:21:07.000000000","message":"There\u0027s no invalid mac address in database. Its just when doing a port query with mac_address filter parameter but mac address supplied in filter has 2 bytes missing (as in example trace); instead of returning a 200 and empty list it return 500 server error which I think it shouldn\u0027t.","commit_id":"7d2b445a44936dcd860d6f42fe1515252ba0cda2"},{"author":{"_account_id":37479,"name":"Yusri Shaharin","display_name":"Mohamad Yusri Shaharin","email":"yusri.shaharin@gmail.com","username":"yusrishaharin"},"change_message_id":"2a160df1f8c23bec6beada70b4a4567f9006c882","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":2,"id":"90999db3_6e98d9d0","in_reply_to":"5eb8661f_09c761a1","updated":"2024-11-13 09:07:51.000000000","message":"This is to prevent neutron from replying 500 to port query with an invalid mac address:\n\n```\n2024-10-22 12:05:06.639 24 ERROR neutron.pecan_wsgi.hooks.translation   File \"/usr/lib/python3.6/site-packages/neutron/db/db_base_plugin_v2.py\", line 1615, in _get_ports_query\n2024-10-22 12:05:06.639 24 ERROR neutron.pecan_wsgi.hooks.translation     for x in mac_address]                                                                                  \n2024-10-22 12:05:06.639 24 ERROR neutron.pecan_wsgi.hooks.translation   File \"/usr/lib/python3.6/site-packages/neutron/db/db_base_plugin_v2.py\", line 1615, in \u003clistcomp\u003e\n2024-10-22 12:05:06.639 24 ERROR neutron.pecan_wsgi.hooks.translation     for x in mac_address]                                                                                  \n2024-10-22 12:05:06.639 24 ERROR neutron.pecan_wsgi.hooks.translation   File \"/usr/lib/python3.6/site-packages/neutron_lib/api/converters.py\", line 332, in convert_to_sanitized_\nmac_address                                 \n2024-10-22 12:05:06.639 24 ERROR neutron.pecan_wsgi.hooks.translation     return str(netaddr.EUI(mac_address, dialect\u003dnetaddr.mac_unix_expanded))                                \n2024-10-22 12:05:06.639 24 ERROR neutron.pecan_wsgi.hooks.translation   File \"/usr/lib/python3.6/site-packages/netaddr/eui/__init__.py\", line 726, in __str__\n2024-10-22 12:05:06.639 24 ERROR neutron.pecan_wsgi.hooks.translation     return self._module.int_to_str(self._value, self._dialect)                                             \n2024-10-22 12:05:06.639 24 ERROR neutron.pecan_wsgi.hooks.translation   File \"/usr/lib/python3.6/site-packages/netaddr/strategy/eui64.py\", line 189, in int_to_str\n2024-10-22 12:05:06.639 24 ERROR neutron.pecan_wsgi.hooks.translation     words \u003d int_to_words(int_val, dialect)                                                                 \n2024-10-22 12:05:06.639 24 ERROR neutron.pecan_wsgi.hooks.translation   File \"/usr/lib/python3.6/site-packages/netaddr/strategy/eui64.py\", line 234, in int_to_words\n2024-10-22 12:05:06.639 24 ERROR neutron.pecan_wsgi.hooks.translation     return _int_to_words(int_val, dialect.word_size, dialect.num_words)                                    \n2024-10-22 12:05:06.639 24 ERROR neutron.pecan_wsgi.hooks.translation   File \"/usr/lib/python3.6/site-packages/netaddr/strategy/__init__.py\", line 73, in int_to_words\n2024-10-22 12:05:06.639 24 ERROR neutron.pecan_wsgi.hooks.translation     raise IndexError(\u0027integer out of bounds: %r!\u0027 % hex(int_val))                                          \n2024-10-22 12:05:06.639 24 ERROR neutron.pecan_wsgi.hooks.translation IndexError: integer out of bounds: \u00270xfa0016003e0092\u0027!                                                     \n2024-10-22 12:05:06.639 24 ERROR neutron.pecan_wsgi.hooks.translation                                                                                                            \n2024-10-22 12:05:06.642 24 INFO neutron.wsgi [req-73293463-018f-460e-a4f9-a35b4e63d1b6 req-12a9c437-0425-49e3-870b-fd4518c0f538 7811162ae2dd4282916f7aa54814c281 2b5c074140854bbf\na2343a010fdd827f - - default default] 192.168.16.240,127.0.0.1 \"GET /v2.0/ports?mac_address\u003dfa%3A16%3A3e%3A92\u0026limit\u003d1000 HTTP/1.0\" status: 500  len: 363 time: 0.0144787\n```","commit_id":"7d2b445a44936dcd860d6f42fe1515252ba0cda2"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"9103cce44b088cb8743082b00b7de0af4fe67bec","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":2,"id":"f30f0751_7cdbbec8","in_reply_to":"86f4c005_a37ad373","updated":"2024-11-13 12:31:26.000000000","message":"First of all, it is useful to provide a way to reproduce the issue, to know how this method is being called.\nIn any case, my answer is the same: the input should be validated first.","commit_id":"7d2b445a44936dcd860d6f42fe1515252ba0cda2"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"c51638d8a5c3ad3115d071cdd06236b2129eb191","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":2,"id":"1a3ce8c6_af5b073e","in_reply_to":"90999db3_6e98d9d0","updated":"2024-11-13 09:26:54.000000000","message":"There must not be an invalid MAC address in the database. If that passed first the API checks, you need to sanitize and fix it. But we are not going to relax this method to accept an invalid MAC value.","commit_id":"7d2b445a44936dcd860d6f42fe1515252ba0cda2"}]}
