Bug 1994212

Summary: Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
Product: Red Hat Satellite Reporter: Ganesh Payelkar <gpayelka>
Component: RepositoriesAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: Sam Bible <sbible>
Severity: medium Docs Contact:
Priority: high    
Version: 6.10.0CC: ahumbe, jbhatia, jkrajice, jsherril, pcreech, sbible
Target Milestone: 6.11.0Keywords: EasyFix, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2030445 (view as bug list) Environment:
Last Closed: 2022-07-05 14:29:34 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 Ganesh Payelkar 2021-08-17 03:53:30 UTC
Description of problem:

Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass

Version-Release number of selected component (if applicable):
satellite-6.10.0-0.6.beta

How reproducible:
New installation of satellite 6.10 Beta

Steps to Reproduce:
1. Install satellite 6.10 Beta
2. Try to enable repos through WebUI 
3. Check the logs

Actual results:

2021-08-17T09:15:18 [I|bac|d0db5e92] Task {label: Actions::Katello::RepositorySet::ScanCdn, id: c2607c7e-488e-4448-990a-5917c117fa26, execution_plan_id: d6af3cd0-f4d7-4efa-b70b-1414b592c794} state changed: running 
2021-08-17T09:15:19 [E|app|d0db5e92] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-17T09:15:19 [E|app|d0db5e92] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-17T09:15:19 [E|app|d0db5e92] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-17T09:15:19 [E|app|d0db5e92] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-17T09:15:19 [E|app|d0db5e92] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-17T09:15:19 [E|app|d0db5e92] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-17T09:15:19 [E|app|d0db5e92] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-17T09:15:21 [E|app|d0db5e92] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-17T09:15:21 [E|app|d0db5e92] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-17T09:15:21 [E|app|d0db5e92] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-17T09:15:21 [E|app|d0db5e92] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-17T09:15:21 [E|app|d0db5e92] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-17T09:15:21 [I|bac|d0db5e92] Task {label: Actions::Katello::RepositorySet::ScanCdn, id: c2607c7e-488e-4448-990a-5917c117fa26, execution_plan_id: d6af3cd0-f4d7-4efa-b70b-1414b592c794} state changed: stopped  result: success


Expected results:


Additional info:


# hammer ping 
database:         
    Status:          ok
    Server Response: Duration: 0ms
candlepin:        
    Status:          ok
    Server Response: Duration: 32ms
candlepin_auth:   
    Status:          ok
    Server Response: Duration: 28ms
candlepin_events: 
    Status:          ok
    message:         20 Processed, 0 Failed
    Server Response: Duration: 0ms
katello_events:   
    Status:          ok
    message:         0 Processed, 0 Failed
    Server Response: Duration: 0ms
pulp3:            
    Status:          ok
    Server Response: Duration: 68ms
foreman_tasks:    
    Status:          ok
    Server Response: Duration: 3ms


# satellite-maintain service status -b
Running Status Services
================================================================================
Get status of applicable services: 

Displaying the following service(s):
rh-redis5-redis, postgresql, pulpcore-api, pulpcore-content, rh-redis5-redis, pulpcore-worker, pulpcore-worker, pulpcore-worker, pulpcore-worker, tomcat, dynflow-sidekiq@orchestrator, foreman, httpd, puppetserver, dynflow-sidekiq@worker-1, dynflow-sidekiq@worker-hosts-queue-1, foreman-proxy, foreman-cockpit
\ displaying rh-redis5-redis                       [OK]                         
| displaying postgresql                            [OK]                         
| displaying pulpcore-api                          [OK]                         
| displaying pulpcore-content                      [OK]                         
| displaying rh-redis5-redis                       [OK]                         
| displaying pulpcore-worker             [OK]                         
| displaying pulpcore-worker             [OK]                         
| displaying pulpcore-worker             [OK]                         
| displaying pulpcore-worker             [OK]                         
| displaying tomcat                                [OK]                         
| displaying dynflow-sidekiq@orchestrator          [OK]                         
| displaying foreman                               [OK]                         
| displaying httpd                                 [OK]                         
| displaying puppetserver                          [OK]                         
| displaying dynflow-sidekiq@worker-1              [OK]                         
| displaying dynflow-sidekiq@worker-hosts-queue-1  [OK]                         
| displaying foreman-proxy                         [OK]                         
| displaying foreman-cockpit                       [OK]                         
| All services are running                                            [OK]      
--------------------------------------------------------------------------------

Comment 1 Brad Buckingham 2021-08-19 15:03:17 UTC
Is this for specific repositories?
Is this only for a particular manifest?
Do the repositories get enabled despite the error message?

Thanks!

Comment 2 Ashish Humbe 2021-08-19 16:36:36 UTC
This is not specific to any repository set, when we try to expand the repository set then we see the below messages in the logs.

2021-08-19T12:29:36 [I|app|09c02915] Started GET "/katello/api/v2/products/36/repository_sets/4117/available_repositories" for 10.74.9.96 at 2021-08-19 12:29:36 -0400
2021-08-19T12:29:36 [I|app|09c02915] Processing by Katello::Api::V2::RepositorySetsController#available_repositories as JSON
2021-08-19T12:29:36 [I|app|09c02915]   Parameters: {"api_version"=>"v2", "product_id"=>"36", "id"=>"4117"}
2021-08-19T12:29:36 [E|app|16c8c4e0] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-19T12:29:36 [E|app|16c8c4e0] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-19T12:29:36 [E|app|16c8c4e0] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-19T12:29:36 [E|app|16c8c4e0] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-19T12:29:36 [E|app|16c8c4e0] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-19T12:29:36 [E|app|16c8c4e0] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass
2021-08-19T12:29:36 [E|app|16c8c4e0] Failed at scanning for repository: undefined method `resolve_substitutions' for nil:NilClass

Comment 5 Justin Sherrill 2021-08-31 16:48:13 UTC
I'm suggesting we move this off of 6.10 for these reasons:

1. Its easily reproducible on 6.8 and 6.9 (not a regression)
2. This only adds some errors to the logs, scanning the repository causes no issues
3. It only happens with certain content sets, such as 'rhel-7-server-extras-rpms'


Steps to reproduce:

1.  import a manifest
2.  go to the RH repos page, scan repos for the 'rhel-7-server-extras-rpms' content set
3.  Notice you see no errors, and see the repository as expected.  You can enable it with no issue
4.  Check /var/log/foreman/production.log for errors, notice the errors mentioned here.

Thanks for the reproducer details Ganesh!

Comment 7 Justin Sherrill 2021-08-31 16:50:38 UTC
Created redmine issue https://projects.theforeman.org/issues/33383 from this bug

Comment 8 Bryan Kearney 2021-08-31 20:05:36 UTC
Upstream bug assigned to jsherril

Comment 9 Bryan Kearney 2021-08-31 20:05:39 UTC
Upstream bug assigned to jsherril

Comment 10 Bryan Kearney 2021-11-08 16:04:52 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/33383 has been resolved.

Comment 11 Sam Bible 2022-04-29 19:44:16 UTC
Verified on:
6.11 - 18

Steps to reproduce:
1.  import a manifest
2.  go to the RH repos page, scan repos for the 'rhel-7-server-extras-rpms' content set
3.  Notice you see no errors, and see the repository as expected.
4.  Check /var/log/foreman/production.log for errors.

Expected Results:
No errors appearing in the production log

Actual Results:
No errors in the production log.

Comment 14 errata-xmlrpc 2022-07-05 14:29:34 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5498