Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 751375

Summary: Katello ping - undefined method `pulp_oauth_header' for nil:NilClass - When not 'admin' user
Product: Red Hat Satellite Reporter: Clifford Perry <cperry>
Component: katello-agentAssignee: Bryan Kearney <bkearney>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.1CC: cwelton, lzap
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-22 18:04:37 UTC Type: ---
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: 747354    

Description Clifford Perry 2011-11-04 14:22:32 UTC
Description of problem:

[root@rhnscripts1-webdev ~]# katello -ufooadmin -pbaradmin ping
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                     Katello Status

 Status   Service          Result   Duration   Message                                                
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 fail                                                                                                 
          candlepin        ok       21ms                                                              
          candlepin_auth   ok       37ms                                                              
          pulp             ok       57ms                                                              
          pulp_auth        fail                undefined method `pulp_oauth_header' for nil:NilClass  
[root@rhnscripts1-webdev ~]#


Version-Release number of selected component (if applicable):


How reproducible:
Very, every time. 

Steps to Reproduce:
1. Edit seeds file:
vi /usr/share/katello/db/seeds.rb

Change admin to 'fooadmin' and password to 'baradmin' 

2. Edit pulp.conf file
vi /etc/pulp/pulp.conf
Change lines to match:
default_login: fooadmin
default_password: baradmin
3. Cos test system, reset all DBs!
/usr/share/katello/script/katello-reset-dbs

At end, try katello ping as this new user and note pulp oauth fails. 

Likely due to hard coded admin within :
  /usr/share/katello/app/controllers/api/ping_controller.rb
(maybe other places as well)


Actual results:
Fails...

Expected results:
Works...

Additional info:
I can confirm pulp oauth works when using - oauth-test.rb script from katello.git repo. 

Also note:
katello -uadmin -padmin ping
will give same message (it is authenticated)
[root@rhnscripts1-webdev ~]# katello -uadmin -padmin ping
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                     Katello Status

 Status   Service          Result   Duration   Message                                                
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 fail                                                                                                 
          candlepin        ok       20ms                                                              
          candlepin_auth   ok       39ms                                                              
          pulp             ok       53ms                                                              
          pulp_auth        fail                undefined method `pulp_oauth_header' for nil:NilClass  
[root@rhnscripts1-webdev ~]# katello -uadmin -padmin user list
Invalid credentials or unable to authenticate
[root@rhnscripts1-webdev ~]# katello -ufooadmin -pbaradmin user list
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                       User List

 Id   Username   Disabled  
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 19   fooadmin   False     
 20   anonymous  True      
[root@rhnscripts1-webdev ~]# katello -ufooadmin -pbaradmin ping
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                     Katello Status

 Status   Service          Result   Duration   Message                                                
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 fail                                                                                                 
          candlepin        ok       42ms                                                              
          candlepin_auth   ok       53ms                                                              
          pulp             ok       45ms                                                              
          pulp_auth        fail                undefined method `pulp_oauth_header' for nil:NilClass  
[root@rhnscripts1-webdev ~]#

Comment 1 Lukas Zapletal 2011-11-04 14:34:28 UTC
d289dd6 751375 - Katello ping - undefined method `pulp_oauth_header'

Comment 2 Corey Welton 2012-01-19 14:52:50 UTC
QA Verified.

Comment 5 Mike McCune 2013-08-16 18:01:12 UTC
getting rid of 6.0.0 version since that doesn't exist