AttributeError: 'ImmutableImageProxy' object has no attribute 'deactivate'

Bug #1494366 reported by Kuo-tung Kao (jelly)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Invalid
Undecided
Kuo-tung Kao (jelly)

Bug Description

When you use the following way to get token,
"""
curl -i \
  -H "Content-Type: application/json" \
  -d '
{ "auth": {
    "identity": {
      "methods": ["password"],
      "password": {
        "user": {
          "name": "admin",
          "domain": { "id": "default" },
          "password": "password"
        }
      }
    }
  }
}' \
  http://localhost:5000/v3/auth/tokens ; echo
"""

And use the token to deactivate images, the glance will raise the following exception.

2015-09-10 14:06:53.513 DEBUG eventlet.wsgi.server [-] (12570) accepted ('10.0.2.15', 55773) from (pid=12570) server /usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py:826
2015-09-10 14:06:53.516 DEBUG glance.api.middleware.version_negotiation [-] Determining version of request: POST /v2/images/48465a7e-5c84-42ce-b05e-d9c4c41fa5e7/actions/deactivate Accept: */* from (pid=12570) process_request /opt/stack/glance/glance/api/middleware/version_negotiation.py:47
2015-09-10 14:06:53.517 DEBUG glance.api.middleware.version_negotiation [-] Using url versioning from (pid=12570) process_request /opt/stack/glance/glance/api/middleware/version_negotiation.py:60
2015-09-10 14:06:53.517 DEBUG glance.api.middleware.version_negotiation [-] Matched version: v2 from (pid=12570) process_request /opt/stack/glance/glance/api/middleware/version_negotiation.py:72
2015-09-10 14:06:53.517 DEBUG glance.api.middleware.version_negotiation [-] new path /v2/images/48465a7e-5c84-42ce-b05e-d9c4c41fa5e7/actions/deactivate from (pid=12570) process_request /opt/stack/glance/glance/api/middleware/version_negotiation.py:73
2015-09-10 14:06:53.544 ERROR glance.common.wsgi [req-4e45a2f8-8af5-4148-b57e-99ea1292839b f96b81dbf2fe4e5eb0a90e984a26a732 None] Caught error: 'ImmutableImageProxy' object has no attribute 'deactivate'
2015-09-10 14:06:53.544 TRACE glance.common.wsgi Traceback (most recent call last):
2015-09-10 14:06:53.544 TRACE glance.common.wsgi File "/opt/stack/glance/glance/common/wsgi.py", line 879, in __call__
2015-09-10 14:06:53.544 TRACE glance.common.wsgi request, **action_args)
2015-09-10 14:06:53.544 TRACE glance.common.wsgi File "/opt/stack/glance/glance/common/wsgi.py", line 907, in dispatch
2015-09-10 14:06:53.544 TRACE glance.common.wsgi return method(*args, **kwargs)
2015-09-10 14:06:53.544 TRACE glance.common.wsgi File "/opt/stack/glance/glance/common/utils.py", line 504, in wrapped
2015-09-10 14:06:53.544 TRACE glance.common.wsgi return func(self, req, *args, **kwargs)
2015-09-10 14:06:53.544 TRACE glance.common.wsgi File "/opt/stack/glance/glance/api/v2/image_actions.py", line 49, in deactivate
2015-09-10 14:06:53.544 TRACE glance.common.wsgi image.deactivate()
2015-09-10 14:06:53.544 TRACE glance.common.wsgi AttributeError: 'ImmutableImageProxy' object has no attribute 'deactivate'
2015-09-10 14:06:53.544 TRACE glance.common.wsgi
2015-09-10 14:06:53.546 INFO eventlet.wsgi.server [req-4e45a2f8-8af5-4148-b57e-99ea1292839b f96b81dbf2fe4e5eb0a90e984a26a732 None] 10.0.2.15 - - [10/Sep/2015 14:06:53] "POST /v2/images/48465a7e-5c84-42ce-b05e-d9c4c41fa5e7/actions/deactivate HTTP/1.1" 500 430 0.030960

Changed in glance:
assignee: nobody → jelly (coding1314)
description: updated
Revision history for this message
Kairat Kushaev (kkushaev) wrote :

I can't reproduce this issue with the latest devstack.
I executed the following scenarios:
1) Request admin token:
source openrc admin admin
keystone token-get
curl -g -i -X POST -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'User-Agent: python-glanceclient' -H 'Connection: keep-alive' -H 'X-Auth-Token: xxxxx' -H 'Content-Type: application/json' http://xxxx:9292/v2/images/2fa8d2de-2cc6-4641-a9f9-a91b3216f0d3/actions/deactivate
I succeed to deactivate an image.
2) Request demo token
Execute steps from 1)
As a result I succeed to de-activate an image.
I think that you have some problems with specific OS version.
Could you please specify it? After that I can try to reproduce it again.

Changed in glance:
status: New → Incomplete
Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

I could not reproduce this bug either:

$ source openrc admin admin

$ glance image-list | grep cirros
| e8771510-90b3-4921-994a-a0c39ef7c426 | cirros-0.5.2-x86_64-disk |

$ glance image-deactivate e8771510-90b3-4921-994a-a0c39ef7c426

$ glance image-show e8771510-90b3-4921-994a-a0c39ef7c426 | grep status
| status | deactivated

$ glance image-reactivate e8771510-90b3-4921-994a-a0c39ef7c426

$ glance image-show e8771510-90b3-4921-994a-a0c39ef7c426 | grep status
| status | active

Changed in glance:
status: Incomplete → 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.