Bug 1305838 - When adding ceilometer to the pipeline, swift-proxy cannot start
Summary: When adding ceilometer to the pipeline, swift-proxy cannot start
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-swift
Version: 5.0 (RHEL 7)
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 5.0 (RHEL 7)
Assignee: Pete Zaitcev
QA Contact: nlevinki
URL:
Whiteboard:
: 1305840 1305841 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-09 11:31 UTC by Arx Cruz
Modified: 2016-08-01 01:04 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-20 16:58:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1269473 0 None None None 2016-02-09 11:31:17 UTC

Description Arx Cruz 2016-02-09 11:31:18 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:54:14 UTC
*** Bug 1305840 has been marked as a duplicate of this bug. ***

Comment 3 Sergey Gotliv 2016-02-09 11:57:11 UTC
*** Bug 1305841 has been marked as a duplicate of this bug. ***


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