Bug 1305841

Summary: When adding ceilometer to the pipeline, swift-proxy cannot start
Product: Red Hat OpenStack Reporter: Arx Cruz <acruz>
Component: openstack-swiftAssignee: Pete Zaitcev <zaitcev>
Status: CLOSED DUPLICATE QA Contact: nlevinki <nlevinki>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.0 (RHEL 7)CC: derekh, sgotliv, tkammer, yeylon, zaitcev
Target Milestone: ---   
Target Release: 8.0 (Liberty)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-09 11:57:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Arx Cruz 2016-02-09 11:33:20 UTC
Description of problem:
When adding ceilometer to the pipeline, swift-proxy cannot start as it cannot read /etc/ceilometer/ceilometer.conf or create the swift-proxy log file in /var/log/ceilometer 


usermod -g ceilometer -G swift swift


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

python-swiftclient-2.1.0-3.el7ost.noarch
openstack-swift-object-1.13.1-8.el7ost.noarch
openstack-swift-container-1.13.1-8.el7ost.noarch
openstack-swift-account-1.13.1-8.el7ost.noarch
openstack-swift-proxy-1.13.1-8.el7ost.noarch
openstack-swift-1.13.1-8.el7ost.noarch
openstack-swift-plugin-swift3-1.7-3.el7ost.noarch

How reproducible:


Steps to Reproduce:
1. Install packstack
2. Configure swift-proxy editing /etc/swift/proxy-server.conf
3. Add ceilometer in the pipeline before proxy-server
4. Add the following filter:

[filter:ceilometer]
use = egg:ceilometer#swift
5. Restart openstack-swift-proxy service

Actual results:
openstack-swift-proxy service fails

Expected results:
openstack-swift-proxy service start successfully

Additional info:
If there's no access to /var/log/ceilometer, this is the error that happens:

Traceback (most recent call last):
  File "/usr/bin/swift-proxy-server", line 23, in <module>
    sys.exit(run_wsgi(conf_file, 'proxy-server', default_port=8080, **options))
  File "/usr/lib/python2.7/site-packages/swift/common/wsgi.py", line 389, in run_wsgi
    loadapp(conf_path, global_conf=global_conf)
  File "/usr/lib/python2.7/site-packages/swift/common/wsgi.py", line 323, in loadapp
    return ctx.create()
  File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
    return self.object_type.invoke(self)
  File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 207, in invoke
    app = filter(app)
  File "/usr/lib/python2.7/site-packages/ceilometer/objectstore/swift_middleware.py", line 194, in ceilometer_filter
    return CeilometerMiddleware(app, conf)
  File "/usr/lib/python2.7/site-packages/ceilometer/objectstore/swift_middleware.py", line 79, in __init__
    service.prepare_service([])
  File "/usr/lib/python2.7/site-packages/ceilometer/service.py", line 147, in prepare_service
    log.setup('ceilometer')
  File "/usr/lib/python2.7/site-packages/ceilometer/openstack/common/log.py", line 440, in setup
    _setup_logging_from_conf(product_name, version)
  File "/usr/lib/python2.7/site-packages/ceilometer/openstack/common/log.py", line 504, in _setup_logging_from_conf
    filelog = logging.handlers.WatchedFileHandler(logpath)
  File "/usr/lib64/python2.7/logging/handlers.py", line 392, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib64/python2.7/logging/__init__.py", line 902, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib64/python2.7/logging/__init__.py", line 925, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/var/log/ceilometer/swift-proxy-server.log'

Also swift need to have access to /etc/ceilometer/ceilometer.conf

As workaround to make it works, I change the permissions on /var/log/ceilometer  to group rw, /etc/ceilometer to group rwx and add swift user in ceilometer group with the command:

usermod -g ceilometer -G swift swift

After that, the service starts successfully.

Notice that this issue was already fixed upstream, launchpad bug id attached.

Comment 2 Sergey Gotliv 2016-02-09 11:57:11 UTC

*** This bug has been marked as a duplicate of bug 1305838 ***