glance-api depends on the calling programs name

Bug #1194987 reported by Matthew Thode
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Medium
Mark Washenberger
glance (Gentoo Linux)
Fix Released
Medium

Bug Description

In Gentoo we name the actual installed python scripts suffixed with the python version they are installed for. glance-api becomes glance-api-python2.7. This causes glance-api to fail to start with the following error.

ERROR glance.common.config [-] Unable to load glance-api-python2.7 from configuration file /etc/glance/glance-api-paste.ini.

The fix for this is to not depend on the calling programs file name (the attached patch worksforme). I would appreciate review on this as I do not know if this is the best way to fix this issue.

Revision history for this message
In , Sp-f (sp-f) wrote :

glance-api failed to start, cause of python-exec wrapper in bin dir

glance-api --config-dir /etc/glance/
2013-06-21 14:44:13.624 10297 ERROR glance.common.config [-] Unable to load glance-api-python2.7-keystone from configuration file /etc/glance/glance-registry-paste.ini.
Got: LookupError("No section 'glance-api-python2.7-keystone' (prefixed by 'app' or 'application' or 'composite' or 'composit' or 'pipeline' or 'filter-app') found in config /etc/glance/glance-registry-paste.ini",)
ERROR: Unable to load glance-api-python2.7-keystone from configuration file /etc/glance/glance-registry-paste.ini.
Got: LookupError("No section 'glance-api-python2.7-keystone' (prefixed by 'app' or 'application' or 'composite' or 'composit' or 'pipeline' or 'filter-app') found

Revision history for this message
In , Matthew Thode (prometheanfire) wrote :

were you able to work around this?

Revision history for this message
In , Sp-f (sp-f) wrote :

work around is durty hack
remove symlink glance-api (point to python-exec) and rename glance-api-python27-keystone to glance-api

Revision history for this message
In , Matthew Thode (prometheanfire) wrote :

It looks like glance is inspecting the name of the file it was called from (obvious I know). I'm working with upstream to know if this is intended behavior.

Revision history for this message
Matthew Thode (prometheanfire) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/34630

Changed in glance:
assignee: nobody → Mark Washenberger (markwash)
status: New → In Progress
Revision history for this message
Mark Washenberger (markwash) wrote :

Hi Matt,

I think the change might need to be a bit higher up. See the fix I proposed in gerrit (at the link Openstack Hudson commented above) and see if it would work for you.

Thanks!

Changed in glance:
importance: Undecided → Medium
Changed in glance (Gentoo Linux):
importance: Unknown → Medium
Revision history for this message
Matthew Thode (prometheanfire) wrote :

patch is confirmed working :D

Revision history for this message
In , Matthew Thode (prometheanfire) wrote :

fix is in tree as r2 of both 2012.2.4 and 2013.1.2

Revision history for this message
In , Matthew Thode (prometheanfire) wrote :

Created attachment 352354
grizzly patch

Revision history for this message
In , Matthew Thode (prometheanfire) wrote :

Created attachment 352356
folsom patch

Revision history for this message
Matthew Thode (prometheanfire) wrote :

I've modified the patch to work against stable/grizzly and stable/folsom as well. (check the gentoo bug for the files).

Changed in glance (Gentoo Linux):
status: Unknown → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/34630
Committed: http://github.com/openstack/glance/commit/672e717ff15e018418d685077182108b65370d68
Submitter: Jenkins
Branch: master

commit 672e717ff15e018418d685077182108b65370d68
Author: Mark J. Washenberger <email address hidden>
Date: Wed Jun 26 15:41:25 2013 -0700

    Don't rely on prog.Name for paste app

    Relying on the name of the program breaks packagers who need to move
    glance executables around to other locations on the file system.

    Fixes bug 1194987

    Change-Id: I7721c5181b17b1f34adc279c055dfff5d17b57e5

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → havana-3
status: Fix Committed → Fix Released
Revision history for this message
Yang Yu (yuyangbj) wrote : I will be on vacation from 9/5 to 9/15, urgent call: 13811509950

I will be out of the office starting 2013-09-05 and will not return until
2013-09-15.

I will be on my marriage leave from 9/5 to 9/15, for any urgent issue
please call me before 9/7.

For daily work, please ask my scrum master Zhu Zhu for help.
For glance issue, please ask glance SME Feilong Wang for help.
For defect report, there will be no report next week.

Revision history for this message
Matthew Thode (prometheanfire) wrote :

hmm, this seems to have come back again...

2013-09-14 04:50:09.892 25815 ERROR glance.store.filesystem [-] Could not find filesystem_store_datadir in configuration options.

2013-09-14 04:50:09.893 25815 WARNING glance.store.base [-] Failed to configure store correctly: Store filesystem could not be configured correctly. Reason: Could not find filesystem_store_datadir in configuration options. Disabling add method.

2013-09-14 04:50:09.898 25815 WARNING glance.store.base [-] Failed to configure store correctly: Store s3 could not be configured correctly. Reason: Could not find s3_store_host in configuration options. Disabling add method.

2013-09-14 04:50:09.929 25815 ERROR glance.store.swift [-] Could not find swift_store_auth_address in configuration options.

2013-09-14 04:50:09.930 25815 WARNING glance.store.base [-] Failed to configure store correctly: Store swift could not be configured correctly. Reason: Could not find swift_store_auth_address in configuration options. Disabling add method.

2013-09-14 04:50:09.930 ERROR glance.store.filesystem [391818ed-c7bb-4619-8cde-86319f759d89 None None] Could not find filesystem_store_datadir in configuration options.

2013-09-14 04:50:09.931 WARNING glance.store.base [391818ed-c7bb-4619-8cde-86319f759d89 None None] Failed to configure store correctly: Store filesystem could not be configured correctly. Reason: Could not find filesystem_store_datadir in configuration options. Disabling add method.

ERROR: Unable to locate paste config file for glance-api-python2.7.

I'm going to see if I can find where to fix as well now

Revision history for this message
Matthew Thode (prometheanfire) wrote :

well, the issue is in common/config.py line 168, need to figure out how to fix
path = CONF.prog + '-paste.ini'

Revision history for this message
Matthew Thode (prometheanfire) wrote :

not pep8 compliant, but should be a more full fix.

I am still worried about anything that calls the 'parse_cache_args' function.

also, another bug (making a note here) related to files in the cache dir.

any file I touch in that dir causes this

/var/lib/glance/scrubber/asd

2013-09-14 05:56:10.478 CRITICAL glance [67cdbd73-8892-4bb9-bfdf-0daa13d4b36d None None] invalid literal for int() with base 10: ''
2013-09-14 05:56:10.478 31193 TRACE glance Traceback (most recent call last):
2013-09-14 05:56:10.478 31193 TRACE glance File "/usr/bin/glance-scrubber-python2.7", line 76, in <module>
2013-09-14 05:56:10.478 31193 TRACE glance scrubber = app.run(pool)
2013-09-14 05:56:10.478 31193 TRACE glance File "/usr/lib64/python2.7/site-packages/glance/store/scrubber.py", line 119, in run
2013-09-14 05:56:10.478 31193 TRACE glance uri, delete_time = read_queue_file(file_name)
2013-09-14 05:56:10.478 31193 TRACE glance File "/usr/lib64/python2.7/site-packages/glance/store/scrubber.py", line 208, in read_queue_file
2013-09-14 05:56:10.478 31193 TRACE glance delete_time = int(f.readline().strip())
2013-09-14 05:56:10.478 31193 TRACE glance ValueError: invalid literal for int() with base 10: ''
2013-09-14 05:56:10.478 31193 TRACE glance

we use dotfiles to track dirs we need to keep.
/var/lib/glance/scrubber/.keep_app-admin_glance-0

Thierry Carrez (ttx)
Changed in glance:
milestone: havana-3 → 2013.2
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.