Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud database user creation failure #246

Closed
pattu777 opened this issue Nov 12, 2013 · 5 comments
Closed

Cloud database user creation failure #246

pattu777 opened this issue Nov 12, 2013 · 5 comments

Comments

@pattu777
Copy link

Hi,

I was using pyrax to create cloud database instance, a test database and a user in it.

Suddenly I am getting this error while creating a user.(Instance and db were successfully created.)

user = inst.create_user(name="groucho", password="top secret", database_names=[db])
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/pyrax/clouddatabases.py", line 423, in create_user
database_names=database_names, return_none=True)
File "/usr/local/lib/python2.7/dist-packages/pyrax/manager.py", line 116, in create
return_response=return_response)
File "/usr/local/lib/python2.7/dist-packages/pyrax/manager.py", line 187, in _create
resp, resp_body = self.api.method_post(uri, body=body)
File "/usr/local/lib/python2.7/dist-packages/pyrax/client.py", line 288, in method_post
return self._api_request(uri, "POST", *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/pyrax/client.py", line 264, in _api_request
resp, body = self._time_request(safe_uri, method, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/pyrax/client.py", line 225, in _time_request
resp, body = self.request(uri, method, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pyrax/client.py", line 218, in request
raise exc.from_response(resp, body)
pyrax.exceptions.BadRequest: Validation error: users[0]['host'] None is not of type 'string' (HTTP 400)

I followed the documentation and arrived at the above error.

Were there any changes made to the API..?? Any help is appreciated..

@EdLeafe
Copy link
Contributor

EdLeafe commented Nov 12, 2013

The host parameter was added as an option in the last release, but it should work without it. Let me dig a little.

@ghost ghost assigned EdLeafe Nov 12, 2013
@EdLeafe
Copy link
Contributor

EdLeafe commented Nov 12, 2013

OK, just confirmed that this is a bug. I'll try to post a fix ASAP. In the meantime you can add host="%" to the create_user() call as a workaround, since that is the default value if no host is specified.

@pattu777
Copy link
Author

Thanks for the quick fix. But I am getting type error now.

user = inst.create_user(name="groucho", password="top secret", database_names=[db], host="%")
Traceback (most recent call last):
File "", line 1, in
TypeError: create_user() got an unexpected keyword argument 'host'

When is the approximate next release date..??

@EdLeafe
Copy link
Contributor

EdLeafe commented Nov 13, 2013

I'm aiming to push a new release out today.

@pattu777
Copy link
Author

Thanks for the update.....Can you please take a look at #248..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants