metadata update fails if preferered is null as the database schema doesn't allows null value

Bug #1703660 reported by David Hill
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Undecided
David Hill

Bug Description

metadata update fails if preferered is null as the database schema doesn't allows null value and here is a patch to fix in in sqlalchemy.

[root@lab-openstack01 sqlalchemy(keystone_admin)]# diff -u api.py.orig api.py
--- api.py.orig 2017-07-11 13:47:55.591859922 -0400
+++ api.py 2017-07-11 14:15:32.904711884 -0400
@@ -2546,6 +2546,8 @@
         # that will not take effect using one session and we will rewrite,
         # in that case, single record - first one added with this call.
         session = get_session()
+ if not meta_value:
+ meta_value = 'none'
         item = {"value": meta_value, "updated_at": timeutils.utcnow()}

         meta_ref = _export_location_metadata_get_query(

Revision history for this message
David Hill (david-hill-ubisoft) wrote :

Also, this is reproducable if we're not using clustering admin credentials to interface with the netapp appliance.

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

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

Changed in manila:
assignee: nobody → David Hill (david-hill-ubisoft)
status: New → In Progress
Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :

It seems like the driver should always set "preferred" metadata value to True or False, and not None.

Changed in manila:
milestone: none → pike-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.openstack.org/482672
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=4573826d361b44c367ca54c5d0f7943346666ade
Submitter: Jenkins
Branch: master

commit 4573826d361b44c367ca54c5d0f7943346666ade
Author: Dave Hill <email address hidden>
Date: Tue Jul 11 15:02:13 2017 -0400

    NetApp: Define 'preferred' to False instead of none

    Define preferred to false instead of none in the NetApp driver
    as setting it to none will trigger a traceback later on because
    the database doesn't allow null values to be inserted.
    "preferred" export location metadata must be set to true or
    false. warning logging is also added to the SQLAlchemy API
    if a none value is used to update the export location metadata.

    Change-Id: Ie7420c9286cc42eaa1361eeffe607b9b5b6b3fbd
    Closes-Bug: 1703660

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/485781

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/ocata)

Reviewed: https://review.openstack.org/485781
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=0a5d760ed5e49b0aef34ce909d4570585e1b4681
Submitter: Jenkins
Branch: stable/ocata

commit 0a5d760ed5e49b0aef34ce909d4570585e1b4681
Author: Dave Hill <email address hidden>
Date: Tue Jul 11 15:02:13 2017 -0400

    NetApp: Define 'preferred' to False instead of none

    Define preferred to false instead of none in the NetApp driver
    as setting it to none will trigger a traceback later on because
    the database doesn't allow null values to be inserted.
    "preferred" export location metadata must be set to true or
    false. warning logging is also added to the SQLAlchemy API
    if a none value is used to update the export location metadata.

    Change-Id: Ie7420c9286cc42eaa1361eeffe607b9b5b6b3fbd
    Closes-Bug: 1703660
    (cherry picked from commit 4573826d361b44c367ca54c5d0f7943346666ade)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (driverfixes/newton)

Fix proposed to branch: driverfixes/newton
Review: https://review.openstack.org/486666

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 5.0.0.0b3

This issue was fixed in the openstack/manila 5.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 4.0.1

This issue was fixed in the openstack/manila 4.0.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (driverfixes/newton)

Reviewed: https://review.openstack.org/486666
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=6dd4039a304061df122153c6f6f3a00a5e33db64
Submitter: Zuul
Branch: driverfixes/newton

commit 6dd4039a304061df122153c6f6f3a00a5e33db64
Author: Dave Hill <email address hidden>
Date: Tue Jul 11 15:02:13 2017 -0400

    NetApp: Define 'preferred' to False instead of none

    Define preferred to false instead of none in the NetApp driver
    as setting it to none will trigger a traceback later on because
    the database doesn't allow null values to be inserted.
    "preferred" export location metadata must be set to true or
    false. warning logging is also added to the SQLAlchemy API
    if a none value is used to update the export location metadata.

    Change-Id: Ie7420c9286cc42eaa1361eeffe607b9b5b6b3fbd
    Closes-Bug: 1703660
    (cherry picked from commit 4573826d361b44c367ca54c5d0f7943346666ade)
    (cherry picked from commit 0a5d760ed5e49b0aef34ce909d4570585e1b4681)

tags: added: in-driverfixes-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (driverfixes/mitaka)

Fix proposed to branch: driverfixes/mitaka
Review: https://review.openstack.org/514804

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on manila (driverfixes/mitaka)

Change abandoned by Goutham Pacha Ravi (<email address hidden>) on branch: driverfixes/mitaka
Review: https://review.openstack.org/514804
Reason: This patch suffers from the constraints issue; however, I don't see any value of back porting this fix to driverfixes/mitaka, since we are not cutting any releases from this branch. Rodrigo, Tiago: If you feel this needs to be revived, please feel free to restore. Thanks!

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.