Bug 751375 - Katello ping - undefined method `pulp_oauth_header' for nil:NilClass - When not 'admin' user
Summary: Katello ping - undefined method `pulp_oauth_header' for nil:NilClass - When n...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: katello-agent
Version: 6.0.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Unspecified
Assignee: Bryan Kearney
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks: katello-blockers
TreeView+ depends on / blocked
 
Reported: 2011-11-04 14:22 UTC by Clifford Perry
Modified: 2019-09-26 13:23 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-22 18:04:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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


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