Bug 1905419

Summary: global registration fails with ERROR: undefined method '#login' for NilClass::Jail (NilClass)
Product: Red Hat Satellite Reporter: Peter Ondrejka <pondrejk>
Component: HostsAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED NOTABUG QA Contact: tstrych
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: inecas, mmccune
Target Milestone: 6.9.0Keywords: Reopened, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-11 12:02:46 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:
Embargoed:

Description Peter Ondrejka 2020-12-08 10:10:21 UTC
Description of problem:

Attempt to register a host via global registration template with only AK setting supplied, the curl command exists after s-m registration with:

ERROR: There was an error rendering the Global Registration template: undefined method '#login' for NilClass::Jail (NilClass)


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

Sat 6.9 snap 4

How reproducible:
always

Steps to Reproduce:
1. have an AK, a registration template assigned to the os
2. hosts > register hosts 
3. fill in just the activation key, generate curl command
4. run the curl command on a host (the os matches the os in satellite)

Actual results:
no registration with the above error

Expected results:
success or better error messagee

Additional info:

Comment 1 Peter Ondrejka 2020-12-08 13:08:45 UTC
Closing after discussion with lstejskal, caused by mis-assignment of the global registration template to the OS, we will work on figuring out ways to prevent this in future

Comment 2 Mike McCune 2021-01-15 18:17:52 UTC
I filed the below to help reduce confusion:

https://bugzilla.redhat.com/show_bug.cgi?id=1916892

After associating my OS to the Global Registration Template, I still see the above error, and as a user I would have no idea how to resolve this. Going to re-open as the above error still occurs on Snap 9

Comment 3 Marek Hulan 2021-01-18 15:18:28 UTC
Mike, do you have reproducing steps? Are you sure you have associated Global Registration Template and not the Linux Registration Template like the reporter? Note that the automatic association of GRT is resolved and better UX for generic templates association is discussed at https://community.theforeman.org/t/rfc-operating-systems-and-templates/21604/28, anyone please add a comment there if you have a some other suggestion on how to improve it furter.

Comment 4 Marek Hulan 2021-01-25 07:23:21 UTC
Just for clarification, Global Registration Template is not meant to be assigned to host. Perhaps we could add a detection to GRT and display error in case @host is set (not nil) that would warn user, they probably assigned wrong template.

Comment 5 Marek Hulan 2021-02-11 12:02:46 UTC
I think this has been fixed meanwhile by auto-assigning HRT to newly created OS (RedHat), which was verified by https://bugzilla.redhat.com/show_bug.cgi?id=1905500, users should no longer encounter this. There's also a nicer fix in the upstream, that prevents assigning global registration template by changing its kind, but that's too big to cherrypick.

Given the above I'm closing this one. If you feel we should add extra warning even after the correct template is auto-assigned, pleaese reopen. However the BZ was reported on snap 4 where the manual step was still necessary and could lead to misconfiguration.

Comment 6 Red Hat Bugzilla 2023-09-15 00:52:39 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days