multi-node setup fails to create glance cache directory

Bug #1441198 reported by Daniel Gonzalez Nothnagel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
devstack
Fix Released
Undecided
Daniel Gonzalez Nothnagel

Bug Description

When creating a multi-node setup (as explained in the readme) the stack.sh run fails because g-api fails to start:

+ service_check
+ local service
+ local failures
+ SCREEN_NAME=stack
+ SERVICE_DIR=/opt/stack/status
+ [[ ! -d /opt/stack/status/stack ]]
++ ls /opt/stack/status/stack/g-api.failure
+ failures=/opt/stack/status/stack/g-api.failure
+ for service in '$failures'
++ basename /opt/stack/status/stack/g-api.failure
+ service=g-api.failure
+ service=g-api
+ echo 'Error: Service g-api is not running'
Error: Service g-api is not running
+ '[' -n /opt/stack/status/stack/g-api.failure ']'
+ die 1376 'More details about the above errors can be found with screen, with ./rejoin-stack.sh'
+ local exitcode=0
+ set +o xtrace
[Call Trace]
./stack.sh:1338:service_check
/home/vagrant/devstack/functions-common:1376:die
[ERROR] /home/vagrant/devstack/functions-common:1376 More details about the above errors can be found with screen, with ./rejoin-stack.sh
Error on exit
World dumping... see /opt/stack/logs/worlddump-2015-04-07-143233.txt for details

In the g-api screen session the following stack trace is printed:

2015-04-07 14:32:26.500 CRITICAL glance [-] OSError: [Errno 13] Permission denied: '/var/cache/glance'

2015-04-07 14:32:26.500 TRACE glance Traceback (most recent call last):
2015-04-07 14:32:26.500 TRACE glance File "/usr/local/bin/glance-api", line 10, in <module>
2015-04-07 14:32:26.500 TRACE glance sys.exit(main())
2015-04-07 14:32:26.500 TRACE glance File "/opt/stack/glance/glance/cmd/api.py", line 87, in main
2015-04-07 14:32:26.500 TRACE glance server.start(config.load_paste_app('glance-api'), default_port=9292)
2015-04-07 14:32:26.500 TRACE glance File "/opt/stack/glance/glance/common/config.py", line 268, in load_paste_app
2015-04-07 14:32:26.500 TRACE glance app = deploy.loadapp("config:%s" % conf_file, name=app_name)
2015-04-07 14:32:26.500 TRACE glance File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
2015-04-07 14:32:26.500 TRACE glance return loadobj(APP, uri, name=name, **kw)
2015-04-07 14:32:26.500 TRACE glance File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
2015-04-07 14:32:26.500 TRACE glance return context.create()
2015-04-07 14:32:26.500 TRACE glance File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 710, in create
2015-04-07 14:32:26.500 TRACE glance return self.object_type.invoke(self)
2015-04-07 14:32:26.500 TRACE glance File "/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 207, in invoke
2015-04-07 14:32:26.500 TRACE glance app = filter(app)
2015-04-07 14:32:26.500 TRACE glance File "/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token/__init__.py", line 1122, in auth_filter
2015-04-07 14:32:26.500 TRACE glance return AuthProtocol(app, conf)
2015-04-07 14:32:26.500 TRACE glance File "/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token/__init__.py", line 521, in __init__
2015-04-07 14:32:26.500 TRACE glance directory_name=self._conf_get('signing_dir'), log=self._LOG)
2015-04-07 14:32:26.500 TRACE glance File "/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token/_signing_dir.py", line 38, in __init__
2015-04-07 14:32:26.500 TRACE glance self._verify_signing_dir()
2015-04-07 14:32:26.500 TRACE glance File "/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token/_signing_dir.py", line 83, in _verify_signing_dir
2015-04-07 14:32:26.500 TRACE glance os.makedirs(self._directory_name, stat.S_IRWXU)
2015-04-07 14:32:26.500 TRACE glance File "/usr/lib/python2.7/os.py", line 150, in makedirs
2015-04-07 14:32:26.500 TRACE glance makedirs(head, mode)
2015-04-07 14:32:26.500 TRACE glance File "/usr/lib/python2.7/os.py", line 157, in makedirs
2015-04-07 14:32:26.500 TRACE glance mkdir(name, mode)
2015-04-07 14:32:26.500 TRACE glance OSError: [Errno 13] Permission denied: '/var/cache/glance'
2015-04-07 14:32:26.500 TRACE glance
g-api failed to start

I think the problem is that the init_glance function (which creates the cache directory) only gets called if g-reg is enabled, but not if g-api is enabled.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to devstack (master)

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

Changed in devstack:
assignee: nobody → Daniel Gonzalez Nothnagel (dgonzalez)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to devstack (master)

Reviewed: https://review.openstack.org/171239
Committed: https://git.openstack.org/cgit/openstack-dev/devstack/commit/?id=e53e15845144533debc48b32620d420d9f0ece4e
Submitter: Jenkins
Branch: master

commit e53e15845144533debc48b32620d420d9f0ece4e
Author: Daniel Gonzalez <email address hidden>
Date: Tue Apr 7 16:44:54 2015 +0200

    Fix readme for multi-node setup

    The readme currently states that a compute node in a multi-node setup
    requires the glance-api service to be enabled. But actually
    the glance-api service is only required on the controller node where
    glance-registry is running.
    Running the glance-api service on a node without glance-registry will
    even lead to a failure of glance-api, as the glance cache directory
    will not be created without enabling glance-registry.

    Change-Id: Ie92533f3333f3fe3e2d747762e60f2f42a233e79
    Closes-bug: #1441198

Changed in devstack:
status: In Progress → Fix Released
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.