openstack user create fails without --domain option

Bug #2080600 reported by Takashi Kajinami
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Critical
Unassigned

Bug Description

Since the new openstackclient 7.1.0 release was created, user creation by openstack user create consistently fails because of 400 returned by keystone.

BadRequestException: 400: Client Error for url: http://127.0.0.1/identity/v3/users, Invalid input for field 'domain_id': None is not of type 'string'
Failed validating 'type' in schema['properties']['domain_id']:
     {'maxLength': 64,
      'minLength': 1,
      'pattern': '^[a-zA-Z0-9-]+$',
      'type': 'string'}

This issue is caught in storlets functional test. The command being executed is

$ openstack user create --project $SWIFT_DEFAULT_PROJECT --password $SWIFT_DEFAULT_USER_PWD $SWIFT_DEFAULT_USER

with the following environment variables exported.

    export OS_IDENTITY_API_VERSION=3
    export OS_AUTH_URL="http://$KEYSTONE_IP/identity/v3"
    export OS_REGION_NAME=RegionOne
    export OS_USERNAME=$ADMIN_USER
    export OS_USER_DOMAIN_ID=$STORLETS_DEFAULT_USER_DOMAIN_ID
    export OS_PASSWORD=$ADMIN_PASSWORD
    export OS_PROJECT_NAME=$ADMIN_USER
    export OS_PROJECT_DOMAIN_ID=$STORLETS_DEFAULT_PROJECT_DOMAIN_ID

It seems the problem is resolved if ``--domain`` option is added (or probably OS_DOMAIN_ID environment is set).

This usage hasn't been changed for a while so this is considered as a regression in 7.1.0 (or probably 7.0.0 because the one used in the last successful run was 6.6.0)

Changed in python-openstackclient:
status: New → Triaged
importance: Undecided → Critical
description: updated
Revision history for this message
Dr. Jens Harbott (j-harbott) wrote :

Did confirm the issue locally, it seems to be present in 7.0.0 already, <7 is not affected. It also isn't related to using environment variables, same effect happens when just using some cloud config with "--os-cloud"/OS_CLOUD being set.

Revision history for this message
Takashi Kajinami (kajinamit) wrote :

Further digging into osc changes revealed that this is the change made by https://review.opendev.org/c/openstack/python-openstackclient/+/909030

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-openstackclient (master)
Changed in python-openstackclient:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-openstackclient (master)

Reviewed: https://review.opendev.org/c/openstack/python-openstackclient/+/929456
Committed: https://opendev.org/openstack/python-openstackclient/commit/033793aa0e96e3b8c8e729ff8fa67a9a37029e55
Submitter: "Zuul (22348)"
Branch: master

commit 033793aa0e96e3b8c8e729ff8fa67a9a37029e55
Author: Stephen Finucane <email address hidden>
Date: Mon Sep 16 12:43:04 2024 +0100

    identity: Don't pass unset options when creating user

    In change I06f3848812bce60c65909f1311f36b70eba427d4, we migrated the
    'user *' commands from keystoneclient to SDK. One side effect of this is
    that we are no longer able to rely on keystoneclient's 'filter_none'
    helper method that filters out parameters that are set to None. As such,
    we now need to do this ourselves. Eventually, it would be nice if SDK
    provided such functionality itself.

    The same change also introduced a bug where the '--domain' argument was
    being used to lookup a project rather than the '--project-domain'
    argument. This is also corrected.

    Change-Id: I1204ca611a74d134c879467d6c2b73f16e043213
    Signed-off-by: Stephen Finucane <email address hidden>
    Closes-bug: #2080600

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

Reviewed: https://review.opendev.org/c/openstack/python-openstackclient/+/930412
Committed: https://opendev.org/openstack/python-openstackclient/commit/54b4f45829ff49419e468eb5153dc5251562cb74
Submitter: "Zuul (22348)"
Branch: stable/2024.2

commit 54b4f45829ff49419e468eb5153dc5251562cb74
Author: Stephen Finucane <email address hidden>
Date: Mon Sep 16 12:43:04 2024 +0100

    identity: Don't pass unset options when creating user

    In change I06f3848812bce60c65909f1311f36b70eba427d4, we migrated the
    'user *' commands from keystoneclient to SDK. One side effect of this is
    that we are no longer able to rely on keystoneclient's 'filter_none'
    helper method that filters out parameters that are set to None. As such,
    we now need to do this ourselves. Eventually, it would be nice if SDK
    provided such functionality itself.

    The same change also introduced a bug where the '--domain' argument was
    being used to lookup a project rather than the '--project-domain'
    argument. This is also corrected.

    Change-Id: I1204ca611a74d134c879467d6c2b73f16e043213
    Signed-off-by: Stephen Finucane <email address hidden>
    Closes-bug: #2080600
    (cherry picked from commit 033793aa0e96e3b8c8e729ff8fa67a9a37029e55)

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

This issue was fixed in the openstack/python-openstackclient 7.1.3 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-openstackclient (master)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-openstackclient 7.2.0

This issue was fixed in the openstack/python-openstackclient 7.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-openstackclient (master)

Change abandoned by "Stephen Finucane <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/python-openstackclient/+/931858
Reason: This looks stalled. I'm going to abandon it until we have time to pick it up again.

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.