Bug 784679 - Getting undefined method `[]' for nil:NilClass when looking at subscription for a system
Summary: Getting undefined method `[]' for nil:NilClass when looking at subscription f...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: WebUI
Version: 6.0.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: Unspecified
Assignee: Jason E. Rist
QA Contact: Katello QA List
URL:
Whiteboard:
: 784701 784704 (view as bug list)
Depends On:
Blocks: katello-blockers
TreeView+ depends on / blocked
 
Reported: 2012-01-25 19:32 UTC by Og Maciel
Modified: 2019-09-26 13:29 UTC (History)
6 users (show)

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


Attachments (Terms of Use)
katello log (202.70 KB, text/x-log)
2012-01-25 19:32 UTC, Og Maciel
no flags Details
Now using RHEL6.2 (43.49 KB, text/x-log)
2012-01-25 19:37 UTC, Og Maciel
no flags Details

Description Og Maciel 2012-01-25 19:32:19 UTC
Created attachment 557505 [details]
katello log

Description of problem:

Registered a RHEL 6.1 (minimal install) system through the subscription-manager. Went to the web ui, selected the system and clicked on Subscriptions tab. Got "undefined method `[]' for nil:NilClass" displayed in the ui

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

Katello Version: 0.1.195-1.el6 

How reproducible:


Steps to Reproduce:
1. Log in as the admin and create new Org named "NY Data Center" with a "Development environment
2. Create a new "wbos" user with password "password", assigning him the "NY Data Center" org
3. Boot a minimal installation of RHEL 6.1 and follow the instructions here (https://fedorahosted.org/katello/wiki/GuideSystemRegistrationClient) to register the system
  
Actual results:

Got "undefined method `[]' for nil:NilClass" displayed in the ui

Expected results:


Additional info:

Comment 1 Og Maciel 2012-01-25 19:37:35 UTC
Created attachment 557508 [details]
Now using RHEL6.2

This shows a different error when using RHEL 6.2

Comment 2 Lukas Zapletal 2012-01-26 08:26:45 UTC
Hello,

package profile upload is allowed when:

- user that is uploading using katello cli has edit_user permission OR
- user uploading from RHSM has valid client certificate

Otherwise Permission denied is raised. Looking at the code I think rule number 1 is not valid anymore (we are not able to upload package profiles from the CLI) so I will remove it. But this is another story. Back to your bug, couple of questions:

You did not assign this user register_systems according to the steps provided. How did you register this system? Under the admin username? I dont have full log.

What was the rhsm registration commant exactly? Did you use activation keys? In this case there is existing bz: https://bugzilla.redhat.com/show_bug.cgi?id=751407

What particular version of rhsm are you using here?

You see this error in the UI? I don't get it. Where in the UI exactly? Should I hand this over to the UI guys?

Comment 3 Lukas Zapletal 2012-01-26 08:59:08 UTC
Please provide me more info since you had to be registering under different username. Without proper pemissions one cannot register a system:

[root@ofed ~]# kk user create --username test --password testtest --email test
Successfully created user [ test ]

[root@ofed ~]# subscription-manager register --username=test --password=testtest --force --org=ACME_Corporation --environment=testing
User test is not allowed to access api/environments/index

Comment 4 Lukas Zapletal 2012-01-26 11:44:33 UTC
Can you please do:

# grep insecure /etc/rhsm/rhsm.conf

on the client?

Comment 5 Og Maciel 2012-01-26 14:17:55 UTC
(In reply to comment #3)
> Please provide me more info since you had to be registering under different
> username. Without proper pemissions one cannot register a system:


I followed the instructions here (https://fedorahosted.org/katello/wiki/GuideSystemRegistrationClient) for registering a new client. As far as granting permissions/roles to the user that was doing the registration, wbogs, I've been told that simply giving a standard user a default Org and Env would suffice to allow him to register a system... But to be clear, the user who attempted the registration was "wbogs" and the logs are attached to the issue.

Comment 6 Jordan OMara 2012-01-26 14:19:55 UTC
*** Bug 784704 has been marked as a duplicate of this bug. ***

Comment 7 Jeff Weiss 2012-01-26 14:20:40 UTC
*** Bug 784701 has been marked as a duplicate of this bug. ***

Comment 8 Og Maciel 2012-01-26 14:27:43 UTC
(In reply to comment #4)
> Can you please do:
> 
> # grep insecure /etc/rhsm/rhsm.conf

# grep insecure /etc/rhsm/rhsm.conf
insecure = 1

> on the client?

Yes

Comment 9 Og Maciel 2012-01-26 15:17:55 UTC
<lzap> OgMaciel, rpm -q subscription-manager for https://bugzilla.redhat.com/show_bug.cgi?id=784679 pls

As I have tried this with 2 different systems:

RHEL 6.1:  subscription-manager-0.95.11-1.el6.x86_64
RHEL 6.2:  subscription-manager-0.96.17-1.el6.x86_64

Comment 10 Lukas Zapletal 2012-01-26 15:22:09 UTC
Are you absolutely sure 6.2 version does not work?

subscription-manager-0.96.17-1.el6.x86_64

Comment 11 Lukas Zapletal 2012-01-26 15:32:05 UTC
OK. This is a bug or behavior of RHSM that sends out package profile with HTTP AUTH headers instead of already deployed consumer cert.

It has been fixed in the master: https://bugzilla.redhat.com/show_bug.cgi?id=767265

But as we need to support rhsm's that are in the wild (RHEL 6.1/6.2), we must support both.

Thomas is working on a patch that will accept also HTTP AUTH headers. We were not checking for right permissions in this case. New versions (6.3+) will send consumer certificate, so the request will be passed on.

But this is another story ^^^^^^

The name of this bug is:

Getting undefined method `[]' for nil:NilClass when looking at subscription for a system

and this is something different in the UI. I hope somebody will take care of it :-)

Comment 12 Jordan OMara 2012-01-26 15:33:02 UTC
committed c8e05b8f070a9239ffa06832c3f8f06150c835e8  (thanks to tom)

Comment 13 Mike McCune 2012-01-26 19:07:21 UTC
mass ON_QA move

Comment 14 Og Maciel 2012-01-27 14:32:28 UTC
Verified on Katello Version: 0.1.198-1.el6

Comment 17 Mike McCune 2013-08-16 18:10:30 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.