Bug 1842903 - Error performing ForemanInventoryUpload::Async::UploadReportJob : NoMethodError (undefined method `[]' for nil:NilClass)
Summary: Error performing ForemanInventoryUpload::Async::UploadReportJob : NoMethodErr...
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: RH Cloud - Inventory
Version: 6.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Shimon Shtein
QA Contact: Mirek Długosz
URL:
Whiteboard:
: 1847464 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-02 11:17 UTC by Mirek Długosz
Modified: 2020-10-02 12:41 UTC (History)
3 users (show)

Fixed In Version: 2.0.11
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Mirek Długosz 2020-06-02 11:17:34 UTC
When testing rh_cloud plugin 1.0.6 on Satellite 6.7.1 snap 2, I noticed error from subject in /var/log/foreman/production.log . See attached file for full log.


This is very basic Satellite with manifest uploaded and one client registered to Satellite. Client is *not* subscribed (I disabled auto-attach in activation key) to any content.

As far as I can tell, report is generated successfully. UI says upload completed as well (I don't have access to debugging tools on cloud side, so I can't tell what happens there).

Reporting just in case this is something we should worry about.


Versions:
foreman-1.24.1.21-1.el7sat.noarch
satellite-6.7.1-1.el7sat.noarch
katello-3.14.0-6.el7sat.noarch
pulp-server-2.21.0.1-1.el7sat.noarch
tfm-rubygem-foreman_rh_cloud-1.0.6-1.el7sat.noarch

Comment 2 Mirek Długosz 2020-06-03 15:13:00 UTC
I was investigating auto upload feature today and while using foreman-rake console, I stumbled upon this:

#v+
> Organization.find(3).owner_details['upstreamConsumer']['idCert']
Traceback (most recent call last):
        2: from lib/tasks/console.rake:5:in `block in <top (required)>'
        1: from (irb):5
NoMethodError (undefined method `[]' for nil:NilClass)
#v-

This seems to be exact error I was seeing in production.log. Organization with id 3 does not have manifest uploaded, so I guess it makes sense for it to not have upstreamConsumer set.

While I think it would be good if plugin could catch this situation silently instead of putting entire stacktrace into log, I'm fairly confident this is not error that we have to worry about.

I'm leaving this bugzilla open, as I'd appreciate confirmation that my understanding is correct.
We can also use this BZ as reference if we ever decide to silent this exception.

Comment 3 Lukáš Hellebrandt 2020-06-17 08:51:11 UTC
*** Bug 1847464 has been marked as a duplicate of this bug. ***

Comment 4 Mirek Długosz 2020-10-02 12:08:51 UTC
That was delivered in 6.8 snap 17, moving to ON_QA.

Comment 6 Mirek Długosz 2020-10-02 12:41:37 UTC
Organizations without manifest don't generate full stacktrace in production.log file. Instead, short explanation is included:

#v+
2020-10-02T08:21:46 [I|bac|] Skipping organization '<redacted>', no candlepin certificate defined.
#v-


Tested on:
Satellite 6.8 snap 17
satellite-6.8.0-1.el7sat.noarch
katello-3.16.0-1.el7sat.noarch
foreman-2.1.2.17-1.el7sat.noarch
pulp-server-2.21.3-1.el7sat.noarch
tfm-rubygem-foreman_rh_cloud-2.0.12-1.el7sat.noarch


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