pruner caches raised NoneType exception

Bug #1039854 reported by Zhou ShaoYu on 2012-08-22
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Brian Waldon

Bug Description

Set image_cache_max_size = 1 and cache some images which size bigger than image_cache_max_size,
and then run command glance-cache-pruner.
It raised exception NoneType:
Traceback (most recent call last):
  File "/usr/local/bin/glance-cache-pruner", line 7, in <module>
  File "/root/glance-2012.2/bin/glance-cache-pruner", line 54, in <module>
  File "/root/glance-2012.2/glance/image_cache/", line 28, in run
  File "/root/glance-2012.2/glance/image_cache/", line 186, in prune
    entry = self.driver.get_least_recently_accessed()
  File "/root/glance-2012.2/glance/image_cache/drivers/", line 275, in get_least_recently_accessed
    image_id = cur.fetchone()[0]
TypeError: 'NoneType' object has no attribute '__getitem__'

It's not fixed in folsom.

By the way,does it have config option for auto pruner image cache when glance cache a new image?I can cache images without max_size restricted.

Zhou ShaoYu (hzzhoushaoyu) wrote :
Brian Waldon (bcwaldon) on 2012-08-30
Changed in glance:
assignee: nobody → Brian Waldon (bcwaldon)
Brian Waldon (bcwaldon) on 2012-08-30
Changed in glance:
status: New → In Progress
milestone: none → folsom-rc1
importance: Undecided → Medium

Submitter: Jenkins
Branch: master

commit abcff5b5f5b2b89bf788f6e5447a85c320e5a26c
Author: Brian Waldon <email address hidden>
Date: Wed Aug 29 21:17:46 2012 -0700

    Catch pruner exception when no images are cached

    This handles a situation where the pruner would raise an exception when
    the image_cache_max_size was set lower than the size of the last image.

    Fixes bug 1039854

    Change-Id: I4a6c164e9f821f1250314974f829f058fbd02863

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2012-09-11
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-09-27
Changed in glance:
milestone: folsom-rc1 → 2012.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers