issue token with project-scope get error: "object of type 'NoneType' has no len()"

Bug #1784536 reported by Bi wei
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Low
Bi wei

Bug Description

/v3/auth/tokens POST method for "Password authentication with scoped authorization".

When sets project-scoped with project ID key but the value is a domain id as following:
{
    "auth": {
        "identity": {
            "methods": [
                "password"
            ],
            "password": {
                "user": {
                    "id": "a83947b5fc594f3ca92f1f2f254f6459",
                    "password": "devstack"
                }
            }
        },
        "scope": {
            "project": {
                "id": "default"
            }
        }
    }
}

It returns:
{
    "error": {
        "message": "object of type 'NoneType' has no len()",
        "code": 400,
        "title": "Bad Request"
    }
}

This message is unreadable for users.

wangxiyuan (wangxiyuan)
summary: - Identity API v3 (CURRENT) : POST method for "Password authentication
- with scoped authorization" returns message: "object of type 'NoneType'
- has no len()" when sets "default" for "project"
+ issue token with project-scope get error: "object of type 'NoneType' has
+ no len()"
description: updated
Revision history for this message
Deepak Mourya (mourya007) wrote :

So what exactly the expected result in this situation.?

Revision history for this message
wangxiyuan (wangxiyuan) wrote :

I think it should raise 404 project not found internal but 401 to end user.

Bi wei (biwei)
Changed in keystone:
assignee: nobody → Bi wei (biwei)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

Changed in keystone:
status: New → In Progress
wangxiyuan (wangxiyuan)
Changed in keystone:
importance: Undecided → Low
Changed in keystone:
milestone: none → rocky-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/587368
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=3831fe785774a4385086c2a3c3a8eb5252bbe5b4
Submitter: Zuul
Branch: master

commit 3831fe785774a4385086c2a3c3a8eb5252bbe5b4
Author: biwei <kkttaa678@163.com>
Date: Tue Jul 31 05:43:01 2018 -0400

    Expose a bug that issue token with project-scope gets error

    When sets project-scoped with project ID key but the value is a
    domain id, it retures 400 BadRequest: "object of type 'NoneType'
    has no len()".
    The expected code should be 404 project not found internal and
    401 to end user.

    This patch exposes this bug and it will be fixed in the following patch.

    Partial-bug: #1784536
    Change-Id: I67983bdd300452a5bff947ca3bcfb77a0e6b4574

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/587399
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=ec3fbf34e37c0c8130996c6cb7851ee7777dba7b
Submitter: Zuul
Branch: master

commit ec3fbf34e37c0c8130996c6cb7851ee7777dba7b
Author: biwei <kkttaa678@163.com>
Date: Tue Jul 31 08:04:16 2018 -0400

    Fix a bug that issue token with project-scope gets error

    Make sure the project ref contains domain info before
    looking up domain.

    Change-Id: Iea82898c213bf833b6d2fdbf7cca694a4e0afd33
    Closes-bug: #1784536

Changed in keystone:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystone 15.0.0.0rc1

This issue was fixed in the openstack/keystone 15.0.0.0rc1 release candidate.

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.