glance api doesn't abort start up on Store configuration errors

Bug #1422699 reported by Gorka Eguileor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Medium
Gorka Eguileor
Kilo
New
Undecided
Unassigned
glance_store
Fix Released
Medium
Gorka Eguileor

Bug Description

Glance api service does not abort start up when errors in glance-api.cfg file are encountered.
It would make sense to abort service start up when a BadStoreConfiguration exception is encountered, instead of just sending the error to the logs and disabling adding images to that Store.

For example if a Filesystem Storage Backend with multiple store is configured with a duplicate directory:
filesystem_store_datadirs=/mnt/nfs1/images/:200
filesystem_store_datadirs=/mnt/nfs1/images/:100

Logs will have the error:
ERROR glance_store._drivers.filesystem [-] Directory /mnt/nfs1/image specified multiple times in filesystem_store_datadirs option of filesystem configuration
TRACE glance_store._drivers.filesystem None
TRACE glance_store._drivers.filesystem
WARNING glance_store.driver [-] Failed to configure store correctly: None Disabling add method.

Service will start and when client tries to add an image he will receive a 410 Gone error saying: Error in store configuration. Adding images to store is disabled.

This affects not only the filesystem storage backend but all glance-storage drivers that encounter an error in the configuration and raise a BadStoreConfiguration exception.

How reproducible:
Every time

Steps to Reproduce:
1. Configure Glance to use Filesystem Storage Backend with multiple store and duplicate a filesystem_storage_datadirs.
2. Run glance api

Expected behavior:
Glance api service should not have started and should have reported that the directory was specified multiple times.

Ramaraja (ramaraja-r)
Changed in glance-store:
assignee: nobody → Ramaraja (ramaraja-r)
Changed in glance-store:
assignee: Ramaraja (ramaraja-r) → Gorka Eguileor (gorka)
Changed in glance:
assignee: nobody → Gorka Eguileor (gorka)
status: New → Triaged
Changed in glance-store:
status: New → Triaged
Changed in glance:
importance: Undecided → Medium
Changed in glance-store:
importance: Undecided → Medium
Changed in glance:
status: Triaged → In Progress
Gorka Eguileor (gorka)
Changed in glance-store:
status: Triaged → In Progress
Revision history for this message
Nikhil Komawar (nikhil-komawar) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/156580
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=107811f0de242d89a90302ce4b258ebbfdc91857
Submitter: Jenkins
Branch: master

commit 107811f0de242d89a90302ce4b258ebbfdc91857
Author: Gorka Eguileor <email address hidden>
Date: Tue Feb 17 14:17:59 2015 +0100

    Add BadStoreConfiguration handling to glance-api

    Glace-api now handles BadStoreConfiguration exceptions from glance-store
    library.

    create_stores method will raise BadStoreConfiguration exception on
    driver configuration errors on start up so we can abort service start
    for the user to fix those errors.

    Change-Id: Ifc038874aa0388b036729790a883ae1e1efd323d
    Partial-Bug: #1422699

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

Reviewed: https://review.openstack.org/156573
Committed: https://git.openstack.org/cgit/openstack/glance_store/commit/?id=63fcfd55c0dcb9d8b642fadf9dc2e98d82adef26
Submitter: Jenkins
Branch: master

commit 63fcfd55c0dcb9d8b642fadf9dc2e98d82adef26
Author: Gorka Eguileor <email address hidden>
Date: Mon Mar 16 13:20:02 2015 +0100

    Propagate BadStoreConfiguration to library user

    Propagate BadStoreConfiguration exceptions to library user on start up
    (on create_stores call) instead of just logging them as ERRORs.

    Until logic to handle runtime BadStoreConfiguration exceptions from
    configure and get_store_from_schema is added to Glance we'll keep just
    logging those exceptions at runtime.

    Closes-Bug: #1422699
    Depends-On: Ifc038874aa0388b036729790a883ae1e1efd323d
    Change-Id: I1d4f95cba47d21f1eb7e580314d01ac8d3481586

Changed in glance:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to glance_store (master)

Reviewed: https://review.openstack.org/157013
Committed: https://git.openstack.org/cgit/openstack/glance_store/commit/?id=774d9acb1593f181eef199922411c7ae51fd72e6
Submitter: Jenkins
Branch: master

commit 774d9acb1593f181eef199922411c7ae51fd72e6
Author: Gorka Eguileor <email address hidden>
Date: Wed Feb 18 15:24:00 2015 +0100

    Only warn on duplicate path on fs backend

    Currently if the same path is used in two filesystem_store_datadirs a
    BadStoreConfiguration exception is raised in the filesystem driver.

    This is the desired behavior if the same path appears with different
    priorities, as we don't know which one is correct, but if it appears
    with the same priority (it is an exact duplicate) a warning in the log
    should be enough.

    DocImpact
    Related-Bug: #1422699
    Closes-Bug: #1428257
    Change-Id: I4b0685f3c74851de6a47f1fdfdb6109b3eceb8ef

Revision history for this message
Ian Cordasco (icordasc) wrote :

I'm pretty sure both of these have been released, but I'll hold off until someone else can confirm.

Changed in glance-store:
status: In Progress → Fix Committed
Changed in glance-store:
milestone: none → 0.5.0
Changed in glance-store:
status: Fix Committed → Fix Released
Changed in glance:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to glance_store (stable/kilo)

Related fix proposed to branch: stable/kilo
Review: https://review.openstack.org/199136

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to glance_store (stable/kilo)

Reviewed: https://review.openstack.org/199136
Committed: https://git.openstack.org/cgit/openstack/glance_store/commit/?id=847e612190275da4c49c04459c75d1b70ec2d65d
Submitter: Jenkins
Branch: stable/kilo

commit 847e612190275da4c49c04459c75d1b70ec2d65d
Author: Gorka Eguileor <email address hidden>
Date: Wed Feb 18 15:24:00 2015 +0100

    Only warn on duplicate path on fs backend

    Currently if the same path is used in two filesystem_store_datadirs a
    BadStoreConfiguration exception is raised in the filesystem driver.

    This is the desired behavior if the same path appears with different
    priorities, as we don't know which one is correct, but if it appears
    with the same priority (it is an exact duplicate) a warning in the log
    should be enough.

    DocImpact
    Related-Bug: #1422699
    Closes-Bug: #1428257
    Change-Id: I4b0685f3c74851de6a47f1fdfdb6109b3eceb8ef
    (cherry picked from commit 774d9acb1593f181eef199922411c7ae51fd72e6)

tags: added: in-stable-kilo
Thierry Carrez (ttx)
Changed in glance:
milestone: liberty-1 → 11.0.0
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.