Bug 1396794 - Glance-manage db purge not remove rows that was created less then one day
Summary: Glance-manage db purge not remove rows that was created less then one day
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-glance
Version: 10.0 (Newton)
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: Upstream M3
: 11.0 (Ocata)
Assignee: Cyril Roelandt
QA Contact: Avi Avraham
URL:
Whiteboard:
Depends On: 1416494
Blocks: 1412622
TreeView+ depends on / blocked
 
Reported: 2016-11-20 09:49 UTC by Avi Avraham
Modified: 2019-05-29 14:57 UTC (History)
13 users (show)

Fixed In Version: openstack-glance-14.0.0-0.20170106023234.922a2d7.el7ost
Doc Type: Enhancement
Doc Text:
With this enhancement, `glance-manage db purge` can now remove rows that are less than one day old. This was added because operators may need to run this operation on a regular basis. As a result, the value of the `age_in_days` option can be set to `0`.
Clone Of:
: 1412622 (view as bug list)
Environment:
Last Closed: 2017-05-17 19:47:28 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1245 normal SHIPPED_LIVE Red Hat OpenStack Platform 11.0 Bug Fix and Enhancement Advisory 2017-05-17 23:01:50 UTC
OpenStack gerrit 407177 None None None 2016-12-12 18:18:07 UTC
Launchpad 1643287 None None None 2016-11-20 09:49:15 UTC
Red Hat Knowledge Base (Solution) 4179471 None None None 2019-05-29 14:57:49 UTC

Description Avi Avraham 2016-11-20 09:49:16 UTC
Description of problem:
The value of glance-manage db purge --age_in_days can not be 0.
A request for Adding an option --age_in_days=0 will allow to remove rows from db of deleted images that took place less then 1 day ago, The motivation to add this ability will allow testing db purge other functionalities.

Version-Release number of selected component (if applicable):

python-glance-tests-13.0.0-1.el7ost.noarch
python-glanceclient-2.5.0-1.el7ost.noarch
python-glance-store-0.18.1-0.20161003180701.4e144bb.el7ost.noarch
openstack-glance-13.0.0-1.el7ost.noarch


How reproducible:


Steps to Reproduce:
glance-manage db purge --age_in_days 0

Comment 2 Christian Schwede (cschwede) 2016-12-21 09:52:40 UTC
Upstream patch merged, moving to POST

Comment 8 Avi Avraham 2017-03-16 11:53:36 UTC
The following command is failed to run on overcloud and undercloud
glance-manage db <Any sub command>
due to configuration file permission denied error 

Option "verbose" from group "DEFAULT" is deprecated for removal.  Its value may be silently ignored in the future.
Traceback (most recent call last):
  File "/bin/glance-manage", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/glance/cmd/manage.py", line 439, in main
    config.parse_args(default_config_files=cfg_files)
  File "/usr/lib/python2.7/site-packages/glance/common/config.py", line 680, in parse_args
    default_config_files=default_config_files)
  File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 2359, in __call__
    self._namespace._files_permission_denied)
oslo_config.cfg.ConfigFilesPermissionDeniedError: Failed to open some config files: /etc/glance/glance-registry.conf,/etc/glance/glance-api.conf

python-glance-14.0.1-0.20170222152138.13f96bf.el7ost.noarch
puppet-glance-10.3.0-0.20170220180438.4ec5c5c.el7ost.noarch
python-glanceclient-2.6.0-0.20170208132836.9afb56c.el7ost.noarch
python-glance-store-0.20.1-0.20170210090113.3646e91.el7ost.noarch
openstack-glance-14.0.1-0.20170222152138.13f96bf.el7ost.noarch

Comment 9 Christian Schwede (cschwede) 2017-03-16 12:19:00 UTC
@Avi: did you also test with a different user (ie root or using sudo)?

On the overcloud this might be related to the fact that the default "heat-admin" user is not allowed to read the Glance config files because they are owned by the glance user. Same for the undercloud and the stack user.

Can you please retry with "sudo glance-manage db ..."?

Comment 10 Avi Avraham 2017-03-16 12:43:13 UTC
(In reply to Christian Schwede (cschwede) from comment #9)
> @Avi: did you also test with a different user (ie root or using sudo)?
> 
> On the overcloud this might be related to the fact that the default
> "heat-admin" user is not allowed to read the Glance config files because
> they are owned by the glance user. Same for the undercloud and the stack
> user.
> 
> Can you please retry with "sudo glance-manage db ..."?

[stack@undercloud-0 ~]$ . overcloudrc 
[stack@undercloud-0 ~]$ sudo glance-manage db version 
Option "verbose" from group "DEFAULT" is deprecated for removal.  Its value may be silently ignored in the future.
/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:1241: OsloDBDeprecationWarning: EngineFacade is deprecated; please use oslo_db.sqlalchemy.enginefacade
  expire_on_commit=expire_on_commit, _conf=conf)
BTW there is a separate bug for this issue that I opened few weeks ago 
https://bugzilla.redhat.com/show_bug.cgi?id=1416494

Comment 12 errata-xmlrpc 2017-05-17 19:47:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:1245


Note You need to log in before you can comment on or make changes to this bug.