keystone-manage bootstrap raises ValueError

Bug #1804700 reported by Shuayb Popoola on 2018-11-22
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Low
Gage Hugo

Bug Description

The 'keystone-manage bootstrap' command still raises Value Error despite 'keystone-manage fernet_setup' command was successful. The whole bug is:

shuayb@shuayb-HP-EliteBook-Folio-9470m:~/keystone$ keystone-manage bootstrap
Either --bootstrap-password argument or OS_BOOTSTRAP_PASSWORD must be set.
2018-11-22 21:51:51.394 3884 CRITICAL keystone [-] Unhandled error: ValueError
2018-11-22 21:51:51.394 3884 ERROR keystone Traceback (most recent call last):
2018-11-22 21:51:51.394 3884 ERROR keystone File "/home/shuayb/anaconda3/bin/keystone-manage", line 10, in <module>
2018-11-22 21:51:51.394 3884 ERROR keystone sys.exit(main())
2018-11-22 21:51:51.394 3884 ERROR keystone File "/home/shuayb/keystone/keystone/cmd/manage.py", line 41, in main
2018-11-22 21:51:51.394 3884 ERROR keystone cli.main(argv=sys.argv, developer_config_file=developer_config)
2018-11-22 21:51:51.394 3884 ERROR keystone File "/home/shuayb/keystone/keystone/cmd/cli.py", line 1349, in main
2018-11-22 21:51:51.394 3884 ERROR keystone CONF.command.cmd_class.main()
2018-11-22 21:51:51.394 3884 ERROR keystone File "/home/shuayb/keystone/keystone/cmd/cli.py", line 178, in main
2018-11-22 21:51:51.394 3884 ERROR keystone klass.do_bootstrap()
2018-11-22 21:51:51.394 3884 ERROR keystone File "/home/shuayb/keystone/keystone/cmd/cli.py", line 156, in do_bootstrap
2018-11-22 21:51:51.394 3884 ERROR keystone raise ValueError
2018-11-22 21:51:51.394 3884 ERROR keystone ValueError
2018-11-22 21:51:51.394 3884 ERROR keystone

Lance Bragstad (lbragstad) wrote :

I think bootstrap is handling this case properly. The keystone-manage bootstrap command needs to have a password to bootstrap with the administrator. It doesn't look like it was provided.

I suggest rerunning the command with an additional argument (--bootstrap-password) or sourcing it from your ENV with OS_BOOTSTRAP_PASSWORD.

Changed in keystone:
status: New → Invalid
Colleen Murphy (krinkle) wrote :

bootstrap is doing the right thing by requiring a password, but it's not acceptable to be emitting a traceback. The error message "Either --bootstrap-password argument or OS_BOOTSTRAP_PASSWORD must be set." and an appropriate exit code is correct, causing a traceback is not.

Changed in keystone:
status: Invalid → Triaged
Lance Bragstad (lbragstad) wrote :

Currently, 1 is returned as the error code [0]. Do you think we should be returning something else?

[0] https://pasted.tech/pastes/b9430facdc00855a601c46369d0b73d90c9a09ed

Changed in keystone:
importance: Undecided → Low
tags: added: low-hanging-fruit

Fix proposed to branch: master
Review: https://review.opendev.org/660203

Changed in keystone:
assignee: nobody → Gage Hugo (gagehugo)
status: Triaged → In Progress

Reviewed: https://review.opendev.org/660203
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=295b07cc76c8387adc2fd9a8f3efb769f260ff02
Submitter: Zuul
Branch: master

commit 295b07cc76c8387adc2fd9a8f3efb769f260ff02
Author: Gage Hugo <email address hidden>
Date: Mon May 20 15:19:39 2019 -0500

    Don't throw valueerror on bootstrap

    When keystone-manage bootstrap is ran without providing a value
    to set as the admin password, keystone-manage will throw an
    unhandled ValueError while displaying the proper warning
    message.

    This change removes the ValueError and simply has the CLI
    exit out when this condition is met.

    Closes-Bug: #1804700

    Change-Id: I4e7d5eeb2e48ff354b44196bd11d62d51a73357b

Changed in keystone:
status: In Progress → Fix Released

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

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers