Authentication failure results in useless error message

Bug #1400531 reported by Alex Gaynor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Undecided
Steve Martinelli

Bug Description

If I provide insufficient credentials, the error message that is printed isn't very useful:

$ openstack --os-auth-type="password" --os-url="https://identity.api.rackspacecloud.com" --os-password='a' flavor list
ERROR: openstack

Revision history for this message
Terry Howe (thowe-g) wrote :

What version of cliff are you using there? There was a fix to cliff for this type of thing.

Revision history for this message
Alex Gaynor (alex-gaynor) wrote :

From `pip freeze`: cliff==1.9.0

Revision history for this message
Steve Martinelli (stevemar) wrote :

Confirmed with master, and no environment variables yet.
Alex, did this work for you before? Is it a regression?

Changed in python-openstackclient:
status: New → Confirmed
Revision history for this message
Steve Martinelli (stevemar) wrote :
Download full text (17.5 KiB)

With --debug

steve:keystone$ openstack --os-auth-type="password" --os-url="https://identity.api.rackspacecloud.com" --os-password='a' user list --debug
DEBUG: cliff.commandmanager found command 'security_group_create'
DEBUG: cliff.commandmanager found command 'security_group_rule_list'
DEBUG: cliff.commandmanager found command 'keypair_list'
DEBUG: cliff.commandmanager found command 'keypair_delete'
DEBUG: cliff.commandmanager found command 'host_list'
DEBUG: cliff.commandmanager found command 'keypair_create'
DEBUG: cliff.commandmanager found command 'server_pause'
DEBUG: cliff.commandmanager found command 'server_reboot'
DEBUG: cliff.commandmanager found command 'server_migrate'
DEBUG: cliff.commandmanager found command 'server_set'
DEBUG: cliff.commandmanager found command 'host_show'
DEBUG: cliff.commandmanager found command 'server_unrescue'
DEBUG: cliff.commandmanager found command 'server_add_volume'
DEBUG: cliff.commandmanager found command 'server_unlock'
DEBUG: cliff.commandmanager found command 'security_group_set'
DEBUG: cliff.commandmanager found command 'compute_agent_create'
DEBUG: cliff.commandmanager found command 'server_rescue'
DEBUG: cliff.commandmanager found command 'server_add_security_group'
DEBUG: cliff.commandmanager found command 'console_log_show'
DEBUG: cliff.commandmanager found command 'compute_agent_delete'
DEBUG: cliff.commandmanager found command 'server_ssh'
DEBUG: cliff.commandmanager found command 'server_lock'
DEBUG: cliff.commandmanager found command 'server_unset'
DEBUG: cliff.commandmanager found command 'server_show'
DEBUG: cliff.commandmanager found command 'server_suspend'
DEBUG: cliff.commandmanager found command 'keypair_show'
DEBUG: cliff.commandmanager found command 'server_image_create'
DEBUG: cliff.commandmanager found command 'flavor_list'
DEBUG: cliff.commandmanager found command 'server_remove_volume'
DEBUG: cliff.commandmanager found command 'security_group_delete'
DEBUG: cliff.commandmanager found command 'aggregate_add_host'
DEBUG: cliff.commandmanager found command 'aggregate_remove_host'
DEBUG: cliff.commandmanager found command 'server_remove_security_group'
DEBUG: cliff.commandmanager found command 'ip_floating_remove'
DEBUG: cliff.commandmanager found command 'aggregate_create'
DEBUG: cliff.commandmanager found command 'hypervisor_show'
DEBUG: cliff.commandmanager found command 'ip_floating_list'
DEBUG: cliff.commandmanager found command 'aggregate_delete'
DEBUG: cliff.commandmanager found command 'security_group_rule_create'
DEBUG: cliff.commandmanager found command 'compute_agent_set'
DEBUG: cliff.commandmanager found command 'server_rebuild'
DEBUG: cliff.commandmanager found command 'flavor_delete'
DEBUG: cliff.commandmanager found command 'server_delete'
DEBUG: cliff.commandmanager found command 'server_resume'
DEBUG: cliff.commandmanager found command 'hypervisor_list'
DEBUG: cliff.commandmanager found command 'flavor_create'
DEBUG: cliff.commandmanager found command 'console_url_show'
DEBUG: cliff.commandmanager found command 'ip_fixed_add'
DEBUG: cliff.commandmanager found command 'server_create'
DEBUG: cliff.commandmanager found command 'aggregate_show'
DEBUG: cliff.command...

Revision history for this message
Alex Gaynor (alex-gaynor) wrote :

Not a regression (as far as I know) -- I hit this randomly messing around with the CLI today, I'm sure there's several errors in the parameters I've passed and god knows what else, all I'm asking for is a pretty error message :-)

summary: - Errors results in useless message
+ Authentication failure results in useless error message
Revision history for this message
Steve Martinelli (stevemar) wrote :

Just making notes here...

The minimum set of params needed for v2 password would be:
  --os-auth-url http://localhost:5000/v2.0
  --os-username admin
  --os-project-name admin

*note that if password is not provided, the user will be prompted for one*

We should check if --os-auth-type is password and then maybe do some light parameter checking for ensuring auth-url is set, and username, and project.

Doing a check for v3 password should be similar.

If --os-auth-type is set to token, then we should check for --os-url and --os-token.

We can provide our own custom error messages that are likely to be more helpful than what is currently being printed.

Revision history for this message
Dean Troyer (dtroyer) wrote :

I think it is the '#' in the bug message: implemented in https://review.openstack.org/#/c/147768/

Changed in python-openstackclient:
milestone: none → m7
status: Confirmed → In Progress
assignee: nobody → Steve Martinelli (stevemar)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-openstackclient (master)

Reviewed: https://review.openstack.org/147768
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=fff4a1cd23057160af13f157a6fde2c172fae7a9
Submitter: Jenkins
Branch: master

commit fff4a1cd23057160af13f157a6fde2c172fae7a9
Author: Steve Martinelli <email address hidden>
Date: Fri Jan 16 02:20:52 2015 -0500

    Add helpful messages when authN'ing with password

    Setting up auth options can be complicated, and we currently don't
    do any checking before we build all our auth parameters to send off
    to keystoneclient. We should do some basic checking to guide new
    users.

    Change-Id: I9c88f1c9637b3870c151952ecc797aaf65be271a
    Closes-Bug: #1400531

Changed in python-openstackclient:
status: In Progress → Fix Committed
Dean Troyer (dtroyer)
Changed in python-openstackclient:
status: Fix Committed → Fix Released
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.