Bug 1385843

Summary: apache denies to serve repodata: "Got a GET call, but auth_client declined" on /GET-REQ/<channel>/repodata/repomd.xml
Product: Red Hat Satellite 5 Reporter: Jan Hutař <jhutar>
Component: ServerAssignee: Tomáš Kašpárek <tkasparek>
Status: CLOSED CURRENTRELEASE QA Contact: Patrik Segedy <psegedy>
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: dyordano, maurizio.antillon, psegedy, rdrazny, tkasparek, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-backend-2.5.3-22-sat Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-21 12:16:11 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:
Bug Depends On:    
Bug Blocks: 1340444    

Description Jan Hutař 2016-10-17 19:19:24 UTC
Description of problem:
I have clean installation of latest 5.8.0 compose and RHEL 7 client and Apache denies to serve repodata: "Got a GET call, but auth_client declined" on /GET-REQ/<channel>/repodata/repomd.xml


Version-Release number of selected component (if applicable):
Server: spacewalk-backend-2.5.3-15.el6sat.noarch
Client: yum-rhn-plugin-2.0.1-5.el7.noarch


How reproducible:
probably always (seen on more independent installs)


Steps to Reproduce:
1. Install 5.8.0 with embedded PostgreSQL
2. Sync some channels, let taskomatic generate repodata, verify they exists in
   /var/cache/rhn/repodata/<channel>/
3. Register client and attempt to get repodata


Actual results:
Client reports 0 packages in channel, this is in the error log multiple times:

[Mon Oct 17 15:11:12 2016] [error] Spacewalk 24181 2016/10/17 15:11:12 -04:00: ('Got a GET call, but auth_client declined', '/GET-REQ/rhel-x86_64-server-7/repodata/repomd.xml')


Expected results:
Client should show correct number of packages in channel.

Comment 1 Jan Hutař 2016-10-17 19:24:06 UTC
I have altered (added that "print") auth_client function code to get more info on whats wrong and authentication process fails here:

    token = rhnFlags.get("AUTH_SESSION_TOKEN")
    print ">>>>>>>>>", token
    # Check to see if everything we need to compute the signature is there
    for k in ('X-RHN-Server-Id',
              'X-RHN-Auth',
              'X-RHN-Auth-Server-Time',
              'X-RHN-Auth-Expire-Offset'):
        if k not in token:
            # No auth information; decline any action
            log_debug(4, "Declined auth of client for GET requests; "
                         "incomplete header info.")
            return 0

After `service httpd reload` on server and `yum clean all; yum repolist` on client I got this:

[Mon Oct 17 15:23:08 2016] [error] >>>>>>>>> {'x-rhn-auth-user-id': '', 'x-rhn-auth-server-time': '1476732187.59', 'x-rhn-auth': 'CXmIzThGTr83gkAlh9jRBoDVzvlIJuIB5X4B+aP1hY0=', 'x-rhn-auth-expire-offset': '3600.0', 'x-rhn-server-id': '1000010000'}
[Mon Oct 17 15:23:08 2016] [error] Spacewalk 24375 2016/10/17 15:23:08 -04:00: ('Got a GET call, but auth_client declined', '/GET-REQ/rhel-x86_64-server-7/repodata/repomd.xml')

Looks like headers gets to the function in lower-case only :-/

Comment 3 Tomáš Kašpárek 2016-10-19 11:45:56 UTC
spacewalk.git(master):
aeb9a3a5f4ab5c1d6946d920d29704781046aa87
1f6e9cfb5bdd0cc53f25520a422c864ea7f0e795

Comment 8 Tomáš Kašpárek 2016-10-25 14:13:38 UTC
spacewalk.git(master): ec87f006acd3e6f62f6e7663a641093dbdc588a8