cinderclient against wallaby fails to create snapshot

Bug #1995883 reported by Walt Boring
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-cinderclient
Status tracked in Zed
Xena
New
Undecided
Unassigned
Yoga
In Progress
Undecided
Unassigned
Zed
Fix Released
Low
Unassigned

Bug Description

Using the latest cinderclient 9.1.0 calling cinder wallaby release, fails to create snapshot.

└─> cinder snapshot-create --name walt-wallaby 6ba26261-6f02-4cab-8d96-6febcbbd89b3
WARNING:cinderclient.shell:API version 3.70 requested,
WARNING:cinderclient.shell:downgrading to 3.64 based on server support.
Sending1 {'snapshot': {'volume_id': '6ba26261-6f02-4cab-8d96-6febcbbd89b3', 'force': None, 'name': 'walt-wallaby', 'description': None, 'metadata': {}}}
ERROR: Invalid input for field/attribute force. Value: None. None is not of type 'boolean', 'string' (HTTP 400) (Request-ID: req-8f756aea-b95d-434d-9cad-bc95f57833f2)

The API LOG

Action: 'create', calling method: create, body: {"snapshot": {"volume_id": "6ba26261-6f02-4cab-8d96-6febcbbd89b3", "force": null, "name": "walt-wallaby", "description": null, "metadata": {}}}

http://volume-3.qa-de-3.cloud.sap/v3/7db511c1805f4a7ba57abc822c7b8835/snapshots returned with HTTP 400

Looks like the default in the cinderclient is set to nothing.

https://github.com/openstack/python-cinderclient/blob/master/cinderclient/v3/shell.py#L2268-L2270

and the get for the args value defaults to None here:
https://github.com/openstack/python-cinderclient/blob/master/cinderclient/v3/shell.py#L2309

Changed in cinder:
importance: Undecided → Low
Changed in python-cinderclient:
importance: Undecided → Low
tags: added: api snapshot
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to python-cinderclient (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/python-cinderclient/+/864027

no longer affects: cinder
Changed in python-cinderclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-cinderclient (master)

Change abandoned by "Walt <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/python-cinderclient/+/863923
Reason: https://review.opendev.org/c/openstack/python-cinderclient/+/864027 fixes the issue

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

Reviewed: https://review.opendev.org/c/openstack/python-cinderclient/+/864027
Committed: https://opendev.org/openstack/python-cinderclient/commit/9df653571d4da06c25222189be27e87a6da75628
Submitter: "Zuul (22348)"
Branch: master

commit 9df653571d4da06c25222189be27e87a6da75628
Author: Brian Rosmaita <email address hidden>
Date: Tue Nov 8 11:58:38 2022 -0500

    Handle downgraded client for snapshot-create

    When a CLI user specifies --os-volume api-version 3.66, the shell
    will execute the appropriate shell code, but if the server only
    supports < 3.66, the client is automatically downgraded and correctly
    uses the pre-3.66 SnapshotManager.create() method.

    In that case, the 'force' parameter, which is technically not allowed
    in mv 3.66 (but which silently accepts a True value for backward
    compatibility), will have a value of None, which the pre-3.66 code
    happily passes to cinder as '"force": null' in the request body, and
    which then fails the Block Storage API request-schema check.

    Handle this situation by detecting a None 'force' value and setting
    it to its pre-3.66 default value of False.

    Change-Id: I3ad8283c2a9aaac58c8d2b50fa7ac86b617e5dd3
    Closes-bug: #1995883

Changed in python-cinderclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-cinderclient (stable/zed)
Revision history for this message
Brian Rosmaita (brian-rosmaita) wrote :

Removing wallaby ... the problem isn't in cinderclient wallaby, it's a problem with cinderclient since Xena being used with a Wallaby-era Block Storage API service.

no longer affects: python-cinderclient/wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-cinderclient (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/python-cinderclient/+/864047
Committed: https://opendev.org/openstack/python-cinderclient/commit/bc3072318fe3780f9d10e9e94add51ab02328a23
Submitter: "Zuul (22348)"
Branch: stable/zed

commit bc3072318fe3780f9d10e9e94add51ab02328a23
Author: Brian Rosmaita <email address hidden>
Date: Tue Nov 8 11:58:38 2022 -0500

    Handle downgraded client for snapshot-create

    When a CLI user specifies --os-volume api-version 3.66, the shell
    will execute the appropriate shell code, but if the server only
    supports < 3.66, the client is automatically downgraded and correctly
    uses the pre-3.66 SnapshotManager.create() method.

    In that case, the 'force' parameter, which is technically not allowed
    in mv 3.66 (but which silently accepts a True value for backward
    compatibility), will have a value of None, which the pre-3.66 code
    happily passes to cinder as '"force": null' in the request body, and
    which then fails the Block Storage API request-schema check.

    Handle this situation by detecting a None 'force' value and setting
    it to its pre-3.66 default value of False.

    Change-Id: I3ad8283c2a9aaac58c8d2b50fa7ac86b617e5dd3
    Closes-bug: #1995883
    (cherry picked from commit 9df653571d4da06c25222189be27e87a6da75628)

tags: added: in-stable-zed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-cinderclient (stable/yoga)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-cinderclient 9.2.0

This issue was fixed in the openstack/python-cinderclient 9.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-cinderclient 9.1.1

This issue was fixed in the openstack/python-cinderclient 9.1.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-cinderclient (stable/yoga)

Change abandoned by "Brian Rosmaita <email address hidden>" on branch: stable/yoga
Review: https://review.opendev.org/c/openstack/python-cinderclient/+/865399
Reason: The stable/yoga branch is now in Unmaintained status, and is in the process of being tagged end-of-maintenance and deleted by change I99a8120217aa. If you want to continue with this patch, please propose it to the unmaintained/yoga branch.

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.