Bug 1277256 - Encountering "TypeError: string indices must be integers, not str" when getting a Response: status=202 during an orgs query
Summary: Encountering "TypeError: string indices must be integers, not str" when getti...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-02 20:09 UTC by John Sefler
Modified: 2015-11-16 20:08 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-16 20:08:15 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1277261 0 unspecified CLOSED Encountering "KeyError: 'idCert'" when getting a Response: status=202 during registration 2021-02-22 00:41:40 UTC

Internal Links: 1277261

Description John Sefler 2015-11-02 20:09:09 UTC
Description of problem:
Encountering "TypeError: string indices must be integers, not str" when getting a Response: status=202 from production candlepin environment.  Note that this bug was written to capture and fix the traceback on the client.  The bigger problem is that the server should not be returning a 202. 




Version-Release number of selected component (if applicable):
[root@jsefler-7 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 0.9.26.11-1
subscription management rules: 5.15
subscription-manager: 1.15.9-15.el7
python-rhsm: 1.15.4-5.el7


How reproducible:
I suspect this issue is caused by the aftermath of the weekend outage https://mojo.redhat.com/docs/DOC-1053566
This bug is normally not reproducible.


Steps to Reproduce:
[root@jsefler-7 ~]# subscription-manager orgs --username=qa@redhat.com --serverurl=subscription.rhn.redhat.com:443/subscription
Password: 
+-------------------------------------------+
          qa@redhat.com Organizations
+-------------------------------------------+

string indices must be integers, not str               <========== BANG!
[root@jsefler-7 ~]# 
[root@jsefler-7 ~]# tail -9 /var/log/rhsm/rhsm.log
2015-11-02 14:55:40,050 [DEBUG] subscription-manager:22500 @connection.py:523 - Making request: GET /subscription/users/qa%40redhat.com/owners
2015-11-02 14:55:40,592 [DEBUG] subscription-manager:22500 @connection.py:555 - Response: status=202
2015-11-02 14:55:40,595 [INFO] subscription-manager:22500 @managercli.py:707 - Successfully retrieved org list from server.
2015-11-02 14:55:40,598 [ERROR] subscription-manager:22500 @managercli.py:160 - Error: Unable to retrieve org list from server
2015-11-02 14:55:40,599 [ERROR] subscription-manager:22500 @managercli.py:161 - string indices must be integers, not str
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 715, in _do_command
    owner['displayName'], owner['key']) + "\n"
TypeError: string indices must be integers, not str

[root@jsefler-7 ~]# curl --stderr /dev/null -k -u qa@redhat.com:REDACTED https://subscription.rhn.redhat.com:443/subscription/users/qa%40redhat.com/owners | python -m json/tool
{
    "displayMessage": "The system is unable to complete the requested transaction",
    "requestUuid": "52f1e38e-97eb-4f5b-8c8d-ffe1783b2e5a"
}







For comparison, let's demonstrate the same calls against a happier stage environment with redacted stage credentials...

[root@jsefler-7 ~]# subscription-manager orgs --username=qa@redhat.com --serverurl=subscription.rhn.stage.redhat.com:443/subscription
Password: 
+-------------------------------------------+
          qa@redhat.com Organizations
+-------------------------------------------+

Name: Quality Assurance
Key:  711497

[root@jsefler-7 ~]# 
[root@jsefler-7 ~]# tail -3 /var/log/rhsm/rhsm.log
2015-11-02 15:00:18,199 [DEBUG] subscription-manager:22597 @connection.py:523 - Making request: GET /subscription/users/qa%40redhat.com/owners
2015-11-02 15:00:19,575 [DEBUG] subscription-manager:22597 @connection.py:555 - Response: status=200, requestUuid=c486cc3c-49cb-4381-8892-1af7188fe5b2
2015-11-02 15:00:19,579 [INFO] subscription-manager:22597 @managercli.py:707 - Successfully retrieved org list from server.

[root@jsefler-7 ~]# curl --stderr /dev/null -k -u qa@redhat.com:REDACTED https://subscription.rhn.stage.redhat.com:443/subscription/users/qa%40redhat.com/owners | python -m json/tool
[
    {
        "contentPrefix": null,
        "created": "2011-02-24T13:43:53.000+0000",
        "defaultServiceLevel": null,
        "displayName": "Quality Assurance",
        "href": "/owners/711497",
        "id": "8a85f9812e4f4c84012e57e9561b0258",
        "key": "711497",
        "logLevel": null,
        "parentOwner": null,
        "updated": "2011-02-24T13:43:53.000+0000",
        "upstreamConsumer": null
    }
]

Comment 2 Barnaby Court 2015-11-16 20:08:15 UTC
Too low a priority to fix as it appears to be a gremlin related to a larger data center outage


Note You need to log in before you can comment on or make changes to this bug.