network update_ip id error

Bug #1673707 reported by chenyb4
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack SDK
Invalid
Undecided
Unassigned

Bug Description

I use network update_ip but appear id error.

The python-openstacksdk error message:
Traceback (most recent call last):
  File "connection_subnet.py", line 52, in <module>
    add_ip_to_port(conn)
  File "connection_subnet.py", line 49, in add_ip_to_port
    res = conn.network.update_ip(ip, **kwargs)
  File "/usr/lib/python2.7/site-packages/openstack/network/v2/_proxy.py", line 542, in update_ip
    return self._update(_floating_ip.FloatingIP, floating_ip, **attrs)
  File "/usr/lib/python2.7/site-packages/openstack/proxy2.py", line 36, in check
    return method(self, expected, actual, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/openstack/proxy2.py", line 173, in _update
    return res.update(self.session)
  File "/usr/lib/python2.7/site-packages/openstack/resource2.py", line 663, in update
    json=request.body, headers=request.headers)
  File "/usr/lib/python2.7/site-packages/keystoneauth1/session.py", line 726, in put
    return self.request(url, 'PUT', **kwargs)
  File "/usr/lib/python2.7/site-packages/openstack/session.py", line 66, in map_exceptions_wrapper
    raise exceptions.from_exception(e)
openstack.exceptions.HttpException: HttpException: Bad Request, Cannot update read-only attribute id

The neutron server log message:
2017-03-17 05:00:58.069 3060 DEBUG routes.middleware [req-9c932e18-5f04-4aaf-9aeb-b117a21ff09f ] Matched PUT /floatingips/b1efc8e1-1d20-4b51-bb14-41fdf9f1db64 __call__ /usr/lib/python2.7/site-packages/routes/middleware.py:100
2017-03-17 05:00:58.070 3060 DEBUG routes.middleware [req-9c932e18-5f04-4aaf-9aeb-b117a21ff09f ] Route path: '/floatingips/:(id)', defaults: {'action': u'update', 'controller': <wsgify at 65818128 wrapping <function resource at 0x3ec5050>>} __call__ /usr/lib/python2.7/site-packages/routes/middleware.py:102
2017-03-17 05:00:58.070 3060 DEBUG routes.middleware [req-9c932e18-5f04-4aaf-9aeb-b117a21ff09f ] Match dict: {'action': u'update', 'controller': <wsgify at 65818128 wrapping <function resource at 0x3ec5050>>, 'id': u'b1efc8e1-1d20-4b51-bb14-41fdf9f1db64'} __call__ /usr/lib/python2.7/site-packages/routes/middleware.py:103
2017-03-17 05:00:58.091 3060 DEBUG neutron.api.v2.base [req-9c932e18-5f04-4aaf-9aeb-b117a21ff09f None] Request body: {u'floatingip': {u'port_id': u'5e3a96ba-aa2a-4209-a250-43498200d55f', u'id': u'b1efc8e1-1d20-4b51-bb14-41fdf9f1db64'}} prepare_request_body /usr/lib/python2.7/site-packages/neutron/api/v2/base.py:582
2017-03-17 05:00:58.092 3060 ERROR neutron.api.v2.resource [req-9c932e18-5f04-4aaf-9aeb-b117a21ff09f None] update failed
2017-03-17 05:00:58.092 3060 TRACE neutron.api.v2.resource Traceback (most recent call last):
2017-03-17 05:00:58.092 3060 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/neutron/api/v2/resource.py", line 87, in resource
2017-03-17 05:00:58.092 3060 TRACE neutron.api.v2.resource result = method(request=request, **args)
2017-03-17 05:00:58.092 3060 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/neutron/api/v2/base.py", line 501, in update
2017-03-17 05:00:58.092 3060 TRACE neutron.api.v2.resource allow_bulk=self._allow_bulk)
2017-03-17 05:00:58.092 3060 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/neutron/api/v2/base.py", line 623, in prepare_request_body
2017-03-17 05:00:58.092 3060 TRACE neutron.api.v2.resource raise webob.exc.HTTPBadRequest(msg)
2017-03-17 05:00:58.092 3060 TRACE neutron.api.v2.resource HTTPBadRequest: Cannot update read-only attribute id
2017-03-17 05:00:58.092 3060 TRACE neutron.api.v2.resource
2017-03-17 05:00:58.093 3060 INFO neutron.wsgi [req-9c932e18-5f04-4aaf-9aeb-b117a21ff09f None] 10.10.10.113 - - [17/Mar/2017 05:00:58] "PUT /v2.0/floatingips/b1efc8e1-1d20-4b51-bb14-41fdf9f1db64 HTTP/1.1" 400 332 0.065865
2017-03-17 05:01:02.530 3064 DEBUG neutron.context [req-95986d54-8e83-4271-972d-0f5baf64ba59 None] Arguments dropped when creating context: {u'project_name': None, u'tenant': None} __init__ /usr/lib/python2.7/site-packages/neutron/context.py:83
2017-03-17 05:01:02.530 1194 DEBUG neutron.context [req-95986d54-8e83-4271-972d-0f5baf64ba59 None] Arguments dropped when creating context: {u'project_name': None, u'tenant': None} __init__ /usr/lib/python2.7/site-packages/neutron/context.py:83

Revision history for this message
Brian Curtin (brian.curtin) wrote :

Based on the exception message it looks like you're trying to update the `id`, which you can't do.

Revision history for this message
chenyb4 (chenyb4) wrote :

Neutron floating_ip update api well to do port binding floating_ip address

Revision history for this message
chenyb4 (chenyb4) wrote :

Partial-bug: #1665495 has fix

chenyb4 (chenyb4)
Changed in python-openstacksdk:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.