Bug 865528

Summary: Incorrect credentials shows strange bug "string indices must be integers"
Product: Red Hat Satellite Reporter: Aaron Weitekamp <aweiteka>
Component: Content ManagementAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Og Maciel <omaciel>
Severity: low Docs Contact:
Priority: high    
Version: 6.0.0CC: achan, gkhachik, jomara, lzap, omaciel, tomckay
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
When katello-configure is run more than once with the same credentials, the previous admin user will fail to authenticate on the System Engine webpage. Error handling in the command line code was improved to ensure that the issue does not occur. The previously created user should be able to successfully authenticate to System Engine regardless of repeated execution of the katello-configure command.
Story Points: ---
Clone Of:
: 872332 (view as bug list) Environment:
Last Closed: 2012-12-04 19:57:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 816564, 872332    
Attachments:
Description Flags
katello/client.log none

Description Aaron Weitekamp 2012-10-11 16:58:42 UTC
Created attachment 625590 [details]
katello/client.log

Description of problem:
If katello-configure is run more than once the previous admin user fails to authenticate

Version-Release number of selected component (if applicable):
1.1 
[root@localhost katello]# rpm -qa |grep katello
katello-glue-pulp-1.1.12-12.el6cf.noarch
katello-certs-tools-1.1.8-1.el6cf.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-cli-common-1.1.8-6.el6cf.noarch
katello-selinux-1.1.1-1.el6cf.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
katello-common-1.1.12-12.el6cf.noarch
katello-1.1.12-12.el6cf.noarch
katello-qpid-client-key-pair-1.0-1.noarch
katello-configure-1.1.9-6.el6cf.noarch
katello-all-1.1.12-12.el6cf.noarch
katello-cli-1.1.8-6.el6cf.noarch
katello-glue-candlepin-1.1.12-12.el6cf.noarch


How reproducible:
100%

Steps to Reproduce:
1. `katello-configure` with default options
2. run `katello-configure` again with --user-name=[new_username] --user-pass=[new_user_pass]
3a. run katello CLI with credentials from step 2, e.g. `katello -v -u [new_username] -p [new_user_pass]
3b. login WebUI
  
Actual results:
CLI error returned: "error: string indices must be integers (more in the log file /var/log/katello/client.log)"
WebUI display: no error displayed, no page load

Expected results:
successful authentication

Additional info:

Comment 2 Lukas Zapletal 2012-10-30 13:49:52 UTC
I reproduced today.

Looks like this one is the same. https://bugzilla.redhat.com/show_bug.cgi?id=871086

Comment 3 Lukas Zapletal 2012-10-31 11:39:00 UTC
Ok reproduced but I got another priority now, putting back to NEW. I apologize.

Comment 4 Lukas Zapletal 2012-10-31 13:02:08 UTC
Just a head up. This is the error:

2012-10-31 12:51:47,433 [ERROR][MainThread] error() @ base.py:190 - Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/katello/client/cli/base.py", line 202, in main
    ret_code = super(KatelloCLI, self).main(args, command_name, parent_usage)
  File "/usr/lib/python2.6/site-packages/katello/client/core/base.py", line 298, in main
    return subcommand.main(self.args[1:], self.args[0], self._get_usage_line(command_name, parent_usage))
  File "/usr/lib/python2.6/site-packages/katello/client/core/base.py", line 392, in main
    msg = ", ".join(re.args[1]["errors"])
TypeError: string indices must be integers

And if you wait for few minutes after katello-configure run, it will disappear and everything is working fine then.

Comment 5 Lukas Zapletal 2012-10-31 13:23:14 UTC
https://github.com/Katello/katello/pull/959

Comment 7 Lukas Zapletal 2012-11-05 12:25:24 UTC
7d29467 865528 - improving error handling in the cli code (cherry picked from commit 54d61c10f73ace4959c789f490f642bcb8af978d)

Comment 9 Og Maciel 2012-11-06 19:52:08 UTC
Failed QA:

[root@qetello04 ~]# katello-configure --deployment=cfse --user-name=omaciel --user-pass=foobar
Starting Katello configuration
The top-level log file is [/var/log/katello/katello-configure-20121106-124008/main.log]
[root@qetello04 ~]# katello -u omaciel -p foobar user list
Invalid credentials

* candlepin-0.7.8.1-1.el6cf.noarch
* candlepin-selinux-0.7.8.1-1.el6cf.noarch
* candlepin-tomcat6-0.7.8.1-1.el6cf.noarch
* katello-1.1.12-20.el6cf.noarch
* katello-all-1.1.12-20.el6cf.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.1.8-1.el6cf.noarch
* katello-cli-1.1.8-12.el6cf.noarch
* katello-cli-common-1.1.8-12.el6cf.noarch
* katello-common-1.1.12-20.el6cf.noarch
* katello-configure-1.1.9-11.el6cf.noarch
* katello-glue-candlepin-1.1.12-20.el6cf.noarch
* katello-glue-pulp-1.1.12-20.el6cf.noarch
* katello-qpid-broker-key-pair-1.0-1.noarch
* katello-qpid-client-key-pair-1.0-1.noarch
* katello-selinux-1.1.1-2.el6cf.noarch
* pulp-1.1.14-1.el6cf.noarch
* pulp-common-1.1.14-1.el6cf.noarch
* pulp-selinux-server-1.1.14-1.el6cf.noarch

Comment 10 Og Maciel 2012-11-07 15:24:26 UTC
Verified:

Turns out this BZ was about displaying "Invalid credentials" as an error message to the user instead of "string indices must be integers"

* candlepin-0.7.8.1-1.el6cf.noarch
* candlepin-selinux-0.7.8.1-1.el6cf.noarch
* candlepin-tomcat6-0.7.8.1-1.el6cf.noarch
* katello-1.1.12-20.el6cf.noarch
* katello-all-1.1.12-20.el6cf.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.1.8-1.el6cf.noarch
* katello-cli-1.1.8-12.el6cf.noarch
* katello-cli-common-1.1.8-12.el6cf.noarch
* katello-common-1.1.12-20.el6cf.noarch
* katello-configure-1.1.9-11.el6cf.noarch
* katello-glue-candlepin-1.1.12-20.el6cf.noarch
* katello-glue-foreman-0.1.318-1.el6cf.noarch
* katello-glue-pulp-1.1.12-20.el6cf.noarch
* katello-qpid-broker-key-pair-1.0-1.noarch
* katello-qpid-client-key-pair-1.0-1.noarch
* katello-selinux-1.1.1-2.el6cf.noarch
* pulp-1.1.14-1.el6cf.noarch
* pulp-common-1.1.14-1.el6cf.noarch
* pulp-selinux-server-1.1.14-1.el6cf.noarch

Comment 12 errata-xmlrpc 2012-12-04 19:57:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-1543.html