[Openstack] keystone api: create user raises 'domain_id' cannot be null"

Michael Hearn mrhearn at gmail.com
Tue Jun 24 23:47:22 UTC 2014


Hitting an issue with icehouse when using python & the keystone api to
create a new user.  Have tried both v2.0 and v3 of the api, both failing
with the same error. Specifically, the latter part of the exception
indicates the value of the domain given in the users.create method isn't
being passed on (or so it seems) causing the sql insert to fail.  While I
am not passing a domain name when using v2.0 I am when using v3.

Has anyone come up against this before and can offer any advice?

  File "/usr/lib/python2.7/dist-packages/keystoneclient/session.py", line
251, in request
    raise exceptions.from_response(resp, method, url)
keystoneclient.apiclient.exceptions.InternalServerError: An unexpected
error prevented the server from fulfilling your request. (OperationalError)
(1048, "Column 'domain_id' cannot be null") 'INSERT INTO user (id, name,
domain_id, password, enabled, extra, default_project_id) VALUES (%s, %s,
%s, %s, %s, %s, %s)' ('25119086c00543e9b2237176c8413b9d', 'foo', None,
'$6$rounds=40000$CIv4ypG0UQkAU45i$39Y3MbfILnU1KbJtNcuCpIdhL/7cHxWomv6YKDapMx1zTM7Trdzu3rQC.2zWQyNIRrekNMFhaoNttdyHlF5Ca0',
1, '{"email": "foo at email.com"}', 'default') (HTTP 500)


#Snippet of V3 code
from keystoneclient.v3 import client
keystone = client.Client(user_domain_name = "Default",
                            username="admin",
                            password="xxxxxxxx",
                            project_name="admin",
                            auth_url="http://server:5000/v3/")

keystone.users.create(domain='Default',
                                   name="foo",
                                   password="bar",
                                   email="foo at email.com",
                                   enabled=True)

# Snippet of v2 code
from keystoneclient.v2_0 import client
keystone = client.Client(username="admin",
                                   password="xxxxxxxx",
                                   project_name="admin",
                                   auth_url="http://server:5000/v2.0/")

keystone.users.create( name="foo",
                                   password="bar",
                                   email="foo at email.com",
                                   enabled=True)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20140625/ea170add/attachment.html>


More information about the Openstack mailing list