install fails trying to create existing directory /var/lib/ceph/nss

Bug #1563667 reported by Trent Lloyd
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ceph-radosgw (Juju Charms Collection)
Fix Released
Undecided
Unassigned

Bug Description

The charm creates /var/lib/ceph/nss in multiple places, and these hooks may re-run or run in a different order if there are errors during install or relation-join(keystone).

We should always check if the directory exists before creating it, or catch the exception.

Tags: sts
Revision history for this message
Trent Lloyd (lathiat) wrote :

2016-03-30 04:44:47 INFO install Traceback (most recent call last):
2016-03-30 04:44:47 INFO install File "/var/lib/juju/agents/unit-ceph-radosgw-0/charm/hooks/install.real", line 460, in <module>
2016-03-30 04:44:47 INFO install hooks.execute(sys.argv)
2016-03-30 04:44:47 INFO install File "/var/lib/juju/agents/unit-ceph-radosgw-0/charm/hooks/charmhelpers/core/hookenv.py", line 717, in execute
2016-03-30 04:44:47 INFO install self._hooks[hook_name]()
2016-03-30 04:44:47 INFO install File "/var/lib/juju/agents/unit-ceph-radosgw-0/charm/hooks/install.real", line 133, in install
2016-03-30 04:44:47 INFO install os.makedirs(NSS_DIR)
2016-03-30 04:44:47 INFO install File "/usr/lib/python2.7/os.py", line 157, in makedirs
2016-03-30 04:44:47 INFO install mkdir(name, mode)
2016-03-30 04:44:47 INFO install OSError: [Errno 17] File exists: '/var/lib/ceph/nss'

tags: added: sts
Revision history for this message
Trent Lloyd (lathiat) wrote :

Patch submitted for review/merge: https://review.openstack.org/#/c/299128/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-ceph-radosgw (master)

Reviewed: https://review.openstack.org/299128
Committed: https://git.openstack.org/cgit/openstack/charm-ceph-radosgw/commit/?id=b0338f7283b7d2fb25471e23b8325147e7d9cb34
Submitter: Jenkins
Branch: master

commit b0338f7283b7d2fb25471e23b8325147e7d9cb34
Author: Trent Lloyd <email address hidden>
Date: Wed Mar 30 13:11:58 2016 +0800

    Check if /var/lib/ceph/nss exists before creation

    mkdir() throws an exception if the directory already exists, so we should check
    for it's existance before creation as hooks should be idempotent.

    This occurred in practice when the install hook had to be re-run, following a
    previous failure due to juju API timeout. It would also occur if the keystone
    relation was re-built, so that case is also fixed.

    Change-Id: I4052cda5bb20f76ab592ed7817bdc1e5b5b2138d
    Closes-Bug: #1563667

Changed in ceph-radosgw (Juju Charms Collection):
status: New → Fix Committed
James Page (james-page)
Changed in ceph-radosgw (Juju Charms Collection):
milestone: none → 16.04
James Page (james-page)
Changed in ceph-radosgw (Juju Charms Collection):
status: Fix Committed → 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.