Bug 1673898 - Registered Hosts report: "Cannot eagerly load the polymorphic association :owner" [NEEDINFO]
Summary: Registered Hosts report: "Cannot eagerly load the polymorphic association :ow...
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Reporting
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
medium vote
Target Milestone: Released
Assignee: Marek Hulan
QA Contact: Lukáš Hellebrandt
Depends On:
Blocks: 1655628
TreeView+ depends on / blocked
Reported: 2019-02-08 12:15 UTC by Lukáš Hellebrandt
Modified: 2019-10-07 17:19 UTC (History)
6 users (show)

Fixed In Version: foreman-,foreman-
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-05-14 19:57:59 UTC
Target Upstream Version:
mhulan: needinfo? (zhunting)

Attachments (Terms of Use)
foreman-tail (35.51 KB, text/plain)
2019-04-10 14:00 UTC, Lukáš Hellebrandt
no flags Details

System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 26033 0 Normal Closed Registered Hosts report: "Cannot eagerly load the polymorphic association :owner" 2020-03-05 11:29:04 UTC
Foreman Issue Tracker 26162 0 Normal Closed Support preloading for load_hosts macro 2020-03-05 11:29:04 UTC
Foreman Issue Tracker 26467 0 Normal Closed Registered Hosts report: free text form for host search does not work 2020-03-05 11:29:04 UTC

Description Lukáš Hellebrandt 2019-02-08 12:15:33 UTC
Description of problem:
When using any filter when generating the Registered Hosts report, the following red pop-up message is shown together with attached traceback:

"Cannot eagerly load the polymorphic association :owner".

This may or may not have been caused by fixing bug 1655628. This is a regression
because filtering worked in this report in some previous snap.

Version-Release number of selected component (if applicable):
Reproduced on Sat 6.5 snap 14.

How reproducible:

Steps to Reproduce:
1. Monitor -> Report Templates -> generate Registered Hosts report -> enter some filter -> Submit

Actual results:
Error message, traceback, nothing generated

Expected results:
Report generated without errors

Comment 5 Marek Hulan 2019-02-12 08:24:35 UTC
Created redmine issue https://projects.theforeman.org/issues/26033 from this bug

Comment 6 Bryan Kearney 2019-02-26 15:02:32 UTC
Upstream bug assigned to oprazak@redhat.com

Comment 7 Bryan Kearney 2019-02-26 15:02:33 UTC
Upstream bug assigned to oprazak@redhat.com

Comment 8 Marek Hulan 2019-02-28 16:17:24 UTC
Lukáš, I'm unable to reproduce. Do you have an env where I could test the fix?

Comment 9 Lukáš Hellebrandt 2019-03-01 08:55:01 UTC
Just reproduced. Will provide env, but it's nothing special, just a Satellite snap 17.

Comment 15 Lukáš Hellebrandt 2019-03-27 14:47:48 UTC
FailedQA with Sat 6.5 snap 21.

The reproducer from OP now indeed doesn't show any error. However, it also doesn't search correctly:

In Hosts -> All Hosts, the search field in form <system_name> correctly finds system with that name. Here, it finds nothing and returns empty set. For example, I have a system "fish-3.example.com". Entering "fish-3.example.com" in the Hosts filter and submitting returns an empty file. No error, no traceback.

Comment 16 Marek Hulan 2019-03-27 15:39:39 UTC
Did you look at production.log? Given the history with the reproducability, could you share the reproducing env?

Comment 17 Lukáš Hellebrandt 2019-03-27 15:43:13 UTC
As I said, I haven't noticed any traceback in foreman-tail.

Comment 18 Marek Hulan 2019-03-28 11:59:34 UTC
So this is another issue but we can use this BZ to track it too. The fix has been applied to your test env, please verify and ideally let us know in the upstream PR that fixes it.

Comment 19 Bryan Kearney 2019-03-28 12:02:48 UTC
Upstream bug assigned to mhulan@redhat.com

Comment 20 Bryan Kearney 2019-03-28 12:02:49 UTC
Upstream bug assigned to mhulan@redhat.com

Comment 22 Lukáš Hellebrandt 2019-04-03 14:15:35 UTC
Failed with Sat 6.5 snap 22.

I understand that the template is not yet present in the snap but that just means the BZ (which is ON_QA) failed with the current snap (which is even filled in Fixed In Version).

Comment 25 Lukáš Hellebrandt 2019-04-10 13:59:21 UTC
I hate to say it but FailedQA with Sat 6.5 snap 23.

I have a Satellite with two systems. Everything works correctly for:
1) no filter
2) filter matching no system
3) filter matching one system in form "name~<name>"
But generating takes absurdly long (probably forever) for filter matching one system in form like: "<name>"

Output of foreman-tail attached.

Comment 26 Lukáš Hellebrandt 2019-04-10 14:00:03 UTC
Created attachment 1554242 [details]

Comment 28 Lukáš Hellebrandt 2019-04-10 14:22:38 UTC
Update: "forever" was incorrect, generating took 15 minutes and the results were correct.

Comment 29 Lukáš Hellebrandt 2019-04-10 14:28:16 UTC
Marek, that makes sense. I can verify this BZ once you can confirm the issue is not caused by fixing this BZ.

Comment 30 Marek Hulan 2019-04-10 15:52:27 UTC
This is unrelated issue caused by including applicable rpms. On your instance, it seems to create too huge list. As a workaround (or expected fix in future), open the template (you need to unlock or clone first), remove ", :applicable_rpms" from includes on line with load_hosts. Please open a separate BZ for this. It would be great that after removing this the report still gives you what is expected.

Comment 31 Lukáš Hellebrandt 2019-04-11 09:26:34 UTC
As this is unrelated issue, I am marking this BZ as verified because it is fixed. Verified on Sat 6.5 snap 23.

Comment 32 Bryan Kearney 2019-05-14 19:57:59 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, and where to find the updated
files, follow the link below.

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


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