Occasional ERF50-7522 on facts_refresh

Hello all!

On my 1.14.1 Foreman I occasionally see facts_refresh for a newly
registered node failing with this error:

  • *Error: *ERF50-7522 [Foreman::WrappedException]: Failed to refresh
    facts for mac90e2bac5b1a0 with error Could not get facts from proxy
    https://10.158.31.188:8443: undefined local variable or method `reports'
    for #<Host::Discovered:0x0000000aa08a20> ([RuntimeError]: Could not get
    facts from proxy https://10.158.31.188:8443: undefined local variable or
    …)

I'm using latest 3.3.1 discovery image. I've noticed this mostly within
first 5 minutes after new host is discovered. After that it just stops
failing and refreshes the facts as expected. Below are the logs entries
a mac90e2bac5b1a0 system registering on its own after a boot (in green),
then my attempts to refresh facts on it (failing for about 5 minutes, in
red) and then just starts working (in green):

2017-02-16 13:15:41 b7647900 [app] [I] Parameters:
{"authenticity_token"=>"O5TZLBWNnK0kTJxIbMwDkEFxH6ilQugaGdLNY80R2nW7Cz6YTKnVw+jsxPNJCCl40YF4ZRgL6zoIkr4INSy3bQ==",
"id"=>"mac90e2bac5b1a0"}
2017-02-16 13:15:52 0b185848 [audit] [I] [mac90e2bac5b1a0] deleted 0 (5.7ms)
2017-02-16 13:15:52 0b185848 [audit] [I] [mac90e2bac5b1a0] updated 0 (1.8ms)
2017-02-16 13:15:53 0b185848 [audit] [I] [mac90e2bac5b1a0] added 169
(1018.4ms)
2017-02-16 13:15:53 0b185848 [app] [I] Import facts for 'mac90e2bac5b1a0'
completed. Added: 169, Updated: 0, Deleted 0 facts

2017-02-16 13:16:06 b7647900 [app] [I] Started GET
"/discovered_hosts/mac90e2bac5b1a0/refresh_facts" for 10.153.19.149 at
2017-02-16 13:16:06 -0700
2017-02-16 13:16:06 b7647900 [app] [I] Parameters:
{"id"=>"mac90e2bac5b1a0"}
2017-02-16 13:16:08 b7647900 [audit] [I] [mac90e2bac5b1a0] deleted 7 (8.6ms)
2017-02-16 13:16:08 b7647900 [audit] [I] [mac90e2bac5b1a0] updated 2
(290.7ms)
2017-02-16 13:16:08 b7647900 [audit] [I] [mac90e2bac5b1a0] added 0 (3.0ms)
2017-02-16 13:16:08 b7647900 [app] [I] Import facts for 'mac90e2bac5b1a0'
completed. Added: 0, Updated: 2, Deleted 7 facts
2017-02-16 13:16:08 b7647900 [app] [W] ERF50-7522
[Foreman::WrappedException]: Failed to refresh facts for mac90e2bac5b1a0
with error Could not get facts from proxy https://10.158.31.188:8443:
undefined local variable or method `reports' for
#<Host::Discovered:0x007f0ae0d6c2d8> ([RuntimeError]: Could not get facts
from proxy https://10.158.31.188:8443: undefined local variable or …)
2017-02-16 13:16:55 ce8ac368 [audit] [I] [mac90e2bac5b1a0] deleted 0 (8.2ms)
2017-02-16 13:16:55 ce8ac368 [audit] [I] [mac90e2bac5b1a0] updated 2
(223.9ms)
2017-02-16 13:16:55 ce8ac368 [audit] [I] [mac90e2bac5b1a0] added 7 (31.8ms)
2017-02-16 13:16:55 ce8ac368 [app] [I] Import facts for 'mac90e2bac5b1a0'
completed. Added: 7, Updated: 2, Deleted 0 facts

2017-02-16 13:17:45 b7647900 [app] [I] Started GET
"/discovered_hosts/mac90e2bac5b1a0/refresh_facts" for 10.153.19.149 at
2017-02-16 13:17:45 -0700
2017-02-16 13:17:45 b7647900 [app] [I] Parameters:
{"id"=>"mac90e2bac5b1a0"}
2017-02-16 13:17:47 b7647900 [audit] [I] [mac90e2bac5b1a0] deleted 7
(12.4ms)
2017-02-16 13:17:47 b7647900 [audit] [I] [mac90e2bac5b1a0] updated 2
(240.0ms)
2017-02-16 13:17:47 b7647900 [audit] [I] [mac90e2bac5b1a0] added 0 (2.0ms)
2017-02-16 13:17:47 b7647900 [app] [I] Import facts for 'mac90e2bac5b1a0'
completed. Added: 0, Updated: 2, Deleted 7 facts
2017-02-16 13:17:47 b7647900 [app] [W] ERF50-7522
[Foreman::WrappedException]: Failed to refresh facts for mac90e2bac5b1a0
with error Could not get facts from proxy https://10.158.31.188:8443:
undefined local variable or method `reports' for
#<Host::Discovered:0x0000000cafda00> ([RuntimeError]: Could not get facts
from proxy https://10.158.31.188:8443: undefined local variable or …)
2017-02-16 13:17:58 bf26d7e9 [audit] [I] [mac90e2bac5b1a0] deleted 0 (8.8ms)
2017-02-16 13:17:58 bf26d7e9 [audit] [I] [mac90e2bac5b1a0] updated 2
(200.5ms)
2017-02-16 13:17:58 bf26d7e9 [audit] [I] [mac90e2bac5b1a0] added 7 (31.6ms)
2017-02-16 13:17:58 bf26d7e9 [app] [I] Import facts for 'mac90e2bac5b1a0'
completed. Added: 7, Updated: 2, Deleted 0 facts

2017-02-16 13:18:31 b7647900 [app] [I] Started GET
"/discovered_hosts/mac90e2bac5b1a0/refresh_facts" for 10.153.19.149 at
2017-02-16 13:18:31 -0700
2017-02-16 13:18:31 b7647900 [app] [I] Parameters:
{"id"=>"mac90e2bac5b1a0"}
2017-02-16 13:18:33 b7647900 [audit] [I] [mac90e2bac5b1a0] deleted 7 (8.6ms)
2017-02-16 13:18:33 b7647900 [audit] [I] [mac90e2bac5b1a0] updated 2
(209.8ms)
2017-02-16 13:18:33 b7647900 [audit] [I] [mac90e2bac5b1a0] added 0 (2.3ms)
2017-02-16 13:18:33 b7647900 [app] [I] Import facts for 'mac90e2bac5b1a0'
completed. Added: 0, Updated: 2, Deleted 7 facts
2017-02-16 13:18:33 b7647900 [app] [W] ERF50-7522
[Foreman::WrappedException]: Failed to refresh facts for mac90e2bac5b1a0
with error Could not get facts from proxy https://10.158.31.188:8443:
undefined local variable or method `reports' for
#<Host::Discovered:0x007f0af62e1af0> ([RuntimeError]: Could not get facts
from proxy https://10.158.31.188:8443: undefined local variable or …)

2017-02-16 13:18:59 b7647900 [app] [I] Started GET
"/discovered_hosts/mac90e2bac5b1a0/refresh_facts" for 10.153.19.149 at
2017-02-16 13:18:59 -0700
2017-02-16 13:19:00 b7647900 [app] [I] Parameters:
{"id"=>"mac90e2bac5b1a0"}
2017-02-16 13:19:00 19330891 [audit] [I] [mac90e2bac5b1a0] deleted 0 (8.1ms)
2017-02-16 13:19:00 19330891 [audit] [I] [mac90e2bac5b1a0] updated 2
(225.1ms)
2017-02-16 13:19:00 19330891 [audit] [I] [mac90e2bac5b1a0] added 7 (32.7ms)
2017-02-16 13:19:00 19330891 [app] [I] Import facts for 'mac90e2bac5b1a0'
completed. Added: 7, Updated: 2, Deleted 0 facts
2017-02-16 13:19:01 b7647900 [audit] [I] [mac90e2bac5b1a0] deleted 7 (6.9ms)
2017-02-16 13:19:02 b7647900 [audit] [I] [mac90e2bac5b1a0] updated 2
(332.3ms)
2017-02-16 13:19:02 b7647900 [audit] [I] [mac90e2bac5b1a0] added 0 (3.2ms)
2017-02-16 13:19:02 b7647900 [app] [I] Import facts for 'mac90e2bac5b1a0'
completed. Added: 0, Updated: 2, Deleted 7 facts
2017-02-16 13:19:02 b7647900 [app] [W] ERF50-7522
[Foreman::WrappedException]: Failed to refresh facts for mac90e2bac5b1a0
with error Could not get facts from proxy https://10.158.31.188:8443:
undefined local variable or method `reports' for
#<Host::Discovered:0x007f0ad8c88338> ([RuntimeError]: Could not get facts
from proxy https://10.158.31.188:8443: undefined local variable or …)

2017-02-16 13:19:28 b7647900 [app] [I] Started GET
"/discovered_hosts/mac90e2bac5b1a0/refresh_facts" for 10.153.19.149 at
2017-02-16 13:19:28 -0700
2017-02-16 13:19:28 b7647900 [app] [I] Parameters:
{"id"=>"mac90e2bac5b1a0"}
2017-02-16 13:19:29 b7647900 [audit] [I] [mac90e2bac5b1a0] deleted 0 (7.1ms)
2017-02-16 13:19:30 b7647900 [audit] [I] [mac90e2bac5b1a0] updated 0
(214.2ms)
2017-02-16 13:19:30 b7647900 [audit] [I] [mac90e2bac5b1a0] added 0 (2.6ms)
2017-02-16 13:19:30 b7647900 [app] [I] Import facts for 'mac90e2bac5b1a0'
completed. Added: 0, Updated: 0, Deleted 0 facts
2017-02-16 13:19:30 b7647900 [app] [W] ERF50-7522
[Foreman::WrappedException]: Failed to refresh facts for mac90e2bac5b1a0
with error Could not get facts from proxy https://10.158.31.188:8443:
undefined local variable or method `reports' for
#<Host::Discovered:0x007f0ae67b5e60> ([RuntimeError]: Could not get facts
from proxy https://10.158.31.188:8443: undefined local variable or …)
2017-02-16 13:20:01 2a85f753 [audit] [I] [mac90e2bac5b1a0] deleted 0 (6.2ms)
2017-02-16 13:20:01 2a85f753 [audit] [I] [mac90e2bac5b1a0] updated 2
(210.6ms)
2017-02-16 13:20:01 2a85f753 [audit] [I] [mac90e2bac5b1a0] added 7 (32.7ms)
2017-02-16 13:20:01 2a85f753 [app] [I] Import facts for 'mac90e2bac5b1a0'
completed. Added: 7, Updated: 2, Deleted 0 facts

2017-02-16 13:20:15 b7647900 [app] [I] Started GET
"/discovered_hosts/mac90e2bac5b1a0/refresh_facts" for 10.153.19.149 at
2017-02-16 13:20:15 -0700
2017-02-16 13:20:15 b7647900 [app] [I] Parameters:
{"id"=>"mac90e2bac5b1a0"}
2017-02-16 13:20:17 b7647900 [audit] [I] [mac90e2bac5b1a0] deleted 7 (6.9ms)
2017-02-16 13:20:17 b7647900 [audit] [I] [mac90e2bac5b1a0] updated 2
(190.3ms)
2017-02-16 13:20:17 b7647900 [audit] [I] [mac90e2bac5b1a0] added 0 (1.9ms)
2017-02-16 13:20:17 b7647900 [app] [I] Import facts for 'mac90e2bac5b1a0'
completed. Added: 0, Updated: 2, Deleted 7 facts
2017-02-16 13:20:17 b7647900 [app] [W] ERF50-7522
[Foreman::WrappedException]: Failed to refresh facts for mac90e2bac5b1a0
with error Could not get facts from proxy https://10.158.31.188:8443:
undefined local variable or method `reports' for
#<Host::Discovered:0x007f0ad805b2e0> ([RuntimeError]: Could not get facts
from proxy https://10.158.31.188:8443: undefined local variable or …)

2017-02-16 13:21:01 b7647900 [app] [I] Started GET
"/discovered_hosts/mac90e2bac5b1a0/refresh_facts" for 10.153.19.149 at
2017-02-16 13:21:01 -0700
2017-02-16 13:21:01 b7647900 [app] [I] Parameters:
{"id"=>"mac90e2bac5b1a0"}
2017-02-16 13:21:01 5ea3caa9 [audit] [I] [mac90e2bac5b1a0] deleted 0 (7.5ms)
2017-02-16 13:21:02 5ea3caa9 [audit] [I] [mac90e2bac5b1a0] updated 2
(253.1ms)
2017-02-16 13:21:02 5ea3caa9 [audit] [I] [mac90e2bac5b1a0] added 7 (41.1ms)
2017-02-16 13:21:02 5ea3caa9 [app] [I] Import facts for 'mac90e2bac5b1a0'
completed. Added: 7, Updated: 2, Deleted 0 facts
2017-02-16 13:21:02 b7647900 [audit] [I] [mac90e2bac5b1a0] deleted 7 (6.6ms)
2017-02-16 13:21:03 b7647900 [audit] [I] [mac90e2bac5b1a0] updated 2
(193.6ms)
2017-02-16 13:21:03 b7647900 [audit] [I] [mac90e2bac5b1a0] added 0 (2.5ms)
2017-02-16 13:21:03 b7647900 [app] [I] Import facts for 'mac90e2bac5b1a0'
completed. Added: 0, Updated: 2, Deleted 7 facts
2017-02-16 13:21:03 b7647900 [audit] [I] [mac90e2bac5b1a0] deleted 0 (5.9ms)
2017-02-16 13:21:03 b7647900 [audit] [I] [mac90e2bac5b1a0] updated 0
(203.7ms)
2017-02-16 13:21:03 b7647900 [audit] [I] [mac90e2bac5b1a0] added 0 (2.7ms)
2017-02-16 13:21:03 b7647900 [app] [I] Import facts for 'mac90e2bac5b1a0'
completed. Added: 0, Updated: 0, Deleted 0 facts
2017-02-16 13:23:38 b7647900 [app] [I] Started GET
"/discovered_hosts/mac90e2bac5b1a0/refresh_facts" for 10.153.19.149 at
2017-02-16 13:23:38 -0700
2017-02-16 13:23:38 b7647900 [app] [I] Parameters:
{"id"=>"mac90e2bac5b1a0"}
2017-02-16 13:23:40 b7647900 [audit] [I] [mac90e2bac5b1a0] deleted 0
(10.8ms)
2017-02-16 13:23:40 b7647900 [audit] [I] [mac90e2bac5b1a0] updated 0
(252.0ms)
2017-02-16 13:23:40 b7647900 [audit] [I] [mac90e2bac5b1a0] added 0 (2.7ms)
2017-02-16 13:23:40 b7647900 [app] [I] Import facts for 'mac90e2bac5b1a0'
completed. Added: 0, Updated: 0, Deleted 0 facts
2017-02-16 13:23:40 b7647900 [audit] [I] [mac90e2bac5b1a0] deleted 0 (5.1ms)
2017-02-16 13:23:40 b7647900 [audit] [I] [mac90e2bac5b1a0] updated 0
(284.9ms)
2017-02-16 13:23:40 b7647900 [audit] [I] [mac90e2bac5b1a0] added 0 (2.7ms)
2017-02-16 13:23:40 b7647900 [app] [I] Import facts for 'mac90e2bac5b1a0'
completed. Added: 0, Updated: 0, Deleted 0 facts

Any suggestions/ideas?
Thanks!

Nobody else sees this issue?

Lukas #lzap Zapletal, do you have any thoughts on this? I do have a bunch
issues with discovered hosts at the moment and I think it is related - I
have many duplicate hosts discovered - the same MAC name, but no other
data/facts, anything:

<https://lh3.googleusercontent.com/-tkrJttYlYx8/WLSgLfXnpLI/AAAAAAAAAC0/zNSiP4zygro7WPy1iBV5Uw5y0awGH7G5QCLcB/s1600/Screen%2BShot%2B2017-02-27%2Bat%2B1.54.19%2BPM.png>
As you can see, there's 1 more or less "normal" entry and bunch of
duplicate ones. If I expand a "normal" one, all the facts are actually
there and correct, however, for some reason not all of them are shown in a
dashboard page - some facts are shown as "N/A" (like model/productname),
the others are just empty (like an IP), but those facts although they are
certainly reported and known:

<https://lh3.googleusercontent.com/-vvrAyWDoa6w/WLShkPoeh1I/AAAAAAAAADA/vAnUK6Sh28w3R7BgHcdzivWhw5do5WqCACLcB/s1600/Screen%2BShot%2B2017-02-27%2Bat%2B1.58.51%2BPM.png>

Going back to a lot duplicate hosts. My production.log is full of these
entries:

2017-02-27 15:21:56 5b38d3e9 [app] [I] Started POST
"/api/v2/discovered_hosts/facts" for 10.170.19.170 at 2017-02-27 15:21:56
-0700
2017-02-27 15:21:56 5b38d3e9 [app] [I] Processing by
Api::V2::DiscoveredHostsController#facts as JSON
2017-02-27 15:21:56 5b38d3e9 [app] [I] Parameters:
{"facts"=>"[FILTERED]", "apiv"=>"v2",
"discovered_host"=>{"facts"=>"[FILTERED]"}}
2017-02-27 15:21:57 5b38d3e9 [audit] [I] [mac7cd30abf30ac] deleted 0
(367.8ms)
2017-02-27 15:21:57 5b38d3e9 [audit] [I] [mac7cd30abf30ac] updated 0
(374.3ms)
2017-02-27 15:21:57 5b38d3e9 [audit] [I] [mac7cd30abf30ac] added 0 (3.2ms)
2017-02-27 15:21:57 5b38d3e9 [app] [I] Import facts for 'mac7cd30abf30ac'
completed. Added: 0, Updated: 0, Deleted 0 facts
2017-02-27 15:21:57 5b38d3e9 [app] [W] Subnet could not be detected for
10.170.19.170
2017-02-27 15:21:57 5b38d3e9 [app] [W] Host discovery failed, facts: {
<snip all host facts> }
2017-02-27 15:21:57 5b38d3e9 [app] [I] Completed 422 Unprocessable Entity
in 974ms (Views: 0.4ms | ActiveRecord: 466.3ms)

On a host side the above results in these entries:

Fact cache invalid, reloading to foreman
Parsing kernel line: <snip>
Discovered by URL: https://foreman.domain.com
Registering host with Foreman (https://foreman.domain.com)
Response from Foreman 422: {"message":"Validation failed: Name has already
been taken"}

And this keeps going on every 30 seconds. I don't see the number of
duplicate invalid hosts increasing on such attempts, yet I can't figure out
why and how they were created in a first place.
When delete such invalid duplicate hosts while keeping "semi-good" one and
restart discovery on a host side, things get back to normal. Even dashboard
view starts showing model now, but still no IP:

<https://lh3.googleusercontent.com/-XOIRJQ_XODQ/WLSthYiLTTI/AAAAAAAAADU/UuanXjdNLHsAO2nhoF2c3lWgmZv5Pij6ACLcB/s1600/Screen%2BShot%2B2017-02-27%2Bat%2B2.51.29%2BPM.png>

At first I thought this situation with duplicate hosts is somehow related
to older discovery agent running on my hosts (foreman-proxy version 1.10.4,
discovery GEM version 3.0.5 that runs on in-memory Ubuntu 14.04, our own
version of FDI discussed here -
https://groups.google.com/d/topic/foreman-users/G-hvzJm3nVM/discussion) and
that's why I tried latest FDI 3.3.1 image but ran into issue with facts
refresh (my original post). Now, since I'm able to make things work after
duplicates deletion, I don't think this is an agent problem, but something
on discovery plugin side.

I'd much appreciate your help here to figure out what's happening. I have
not seen such issues on 1.12 or earlier and did not run on 1.13 for enough
time to notice this either.

>
> On my 1.14.1 Foreman I occasionally see facts_refresh for a newly
> registered node failing with this error:
>
>
> - *Error: *ERF50-7522 [Foreman::WrappedException]: Failed to refresh
> facts for mac90e2bac5b1a0 with error Could not get facts from proxy
> https://10.158.31.188:8443: undefined local variable or method
> `reports' for #<Host::Discovered:0x0000000aa08a20> ([RuntimeError]: Could
> not get facts from proxy https://10.158.31.188:8443: undefined local
> variable or …)
>
>
At this point I'm 99% convinced that above error is the source of
duplicated records, which is obviously causing an impact.

Any assistance in figuring this out is much appreciated.

Thanks!

One more thing to note - if I delete a discovered host from Foreman and
re-run older discovery agent, it gets the following errors from Foreman for
about 5 minutes, but after that successfully registers, closely resembling
behavior observed on FDI 3.3.1:

<snip>
Fact cache invalid, reloading to foreman
Parsing kernel line: <snip>
Discovered by URL: https://foreman.domain.com
Registering host with Foreman (https://foreman.domain.com)
Response from Foreman 422: {"message":"undefined local variable or method
reports&#39; for #\u003cHost::Discovered:0x007f0a485be538\} Fact cache invalid, reloading to foreman Parsing kernel line: &lt;snip&gt; Discovered by URL: https://foreman.domain.com Registering host with Foreman (https://foreman.domain.com) Response from Foreman 422: {&quot;message&quot;:&quot;undefined local variable or methodreports' for #\u003cHost::Discovered:0x007f0a1ed98ee0}
Fact cache invalid, reloading to foreman
Parsing kernel line: <snip>
Discovered by URL: https://foreman.domain.com
Registering host with Foreman (https://foreman.domain.com)
Response from Foreman 201:
{"id":426240,"name":"mac7cd30abf30ac","last_compile":null,"last_report":"2017-02-27T23:07:19.016Z","up
<snip>

As you can see, both older and latest discovery agents even on official FDI
3.3.1 get very similar errors that "self-correct" themselves in ~5 minutes
after initial registration.

Thanks again!

Created a bug report for this - Bug #19212: Unable refresh facts on newly-registered systems within first 3-5 minutes - Discovery - Foreman

Sorry I kinda missed this thread. Can you attach full trace to the
issue? I can't reproduce this.

LZ

··· On Fri, Apr 7, 2017 at 1:04 AM, 'Konstantin Orekhov' via Foreman users wrote: > Created a bug report for this - http://projects.theforeman.org/issues/19212 > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-users+unsubscribe@googlegroups.com. > To post to this group, send email to foreman-users@googlegroups.com. > Visit this group at https://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout.


Later,
Lukas @lzap Zapletal

Do you have some extra plugins installed? Like OpenSCAP? I cannot
reproduce here.

There should be full trace in logs, I don't know why you don't have
it. Have you deleted it, Can you increase logging to DEBUG?

LZ

··· On Fri, Apr 7, 2017 at 10:17 AM, Lukas Zapletal wrote: > Sorry I kinda missed this thread. Can you attach full trace to the > issue? I can't reproduce this. > > LZ > > On Fri, Apr 7, 2017 at 1:04 AM, 'Konstantin Orekhov' via Foreman users > wrote: >> Created a bug report for this - http://projects.theforeman.org/issues/19212 >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to foreman-users+unsubscribe@googlegroups.com. >> To post to this group, send email to foreman-users@googlegroups.com. >> Visit this group at https://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. > > > > -- > Later, > Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

> Do you have some extra plugins installed? Like OpenSCAP? I cannot
> reproduce here.
>

List of installed plug-ins:

<https://lh3.googleusercontent.com/-faxAApAlmzo/WOfWvMSrgqI/AAAAAAAAADo/VgTdnjRVLGA-UdqI4gsJL41jNs6NyiegACLcB/s1600/Screen%2BShot%2B2017-04-07%2Bat%2B10.56.38%2BAM.png>

This Foreman is an upgraded 1.14.1. I did not run foreman-installer after
the upgrade. Would it make sense for me to try that? The reason I'm
doubtful is that "undefined local variable or method `reports'" error comes
from agent to Foreman when the latter asks for the facts. However, the
issue magically disappears after first 3-5 minutes.

> There should be full trace in logs, I don't know why you don't have
> it. Have you deleted it, Can you increase logging to DEBUG?
>

Gists with debug log level on Foreman side and a host discover process logs
are:

Please let me know if I can provide more data.

Hello,

unfortunately due to bug, root exception is swallowed so I can't tell what
is wrong. Can you manually apply this patch on your instance and retest,
send me production.log again.

https://github.com/theforeman/foreman_discovery/pull/338

It's oneliner, exception block only. LZ

··· On Fri, Apr 7, 2017 at 8:36 PM, 'Konstantin Orekhov' via Foreman users < foreman-users@googlegroups.com> wrote:

Do you have some extra plugins installed? Like OpenSCAP? I cannot

reproduce here.

List of installed plug-ins:

https://lh3.googleusercontent.com/-faxAApAlmzo/WOfWvMSrgqI/AAAAAAAAADo/VgTdnjRVLGA-UdqI4gsJL41jNs6NyiegACLcB/s1600/Screen%2BShot%2B2017-04-07%2Bat%2B10.56.38%2BAM.png

This Foreman is an upgraded 1.14.1. I did not run foreman-installer after
the upgrade. Would it make sense for me to try that? The reason I’m
doubtful is that “undefined local variable or method `reports’” error
comes from agent to Foreman when the latter asks for the facts. However,
the issue magically disappears after first 3-5 minutes.

There should be full trace in logs, I don’t know why you don’t have
it. Have you deleted it, Can you increase logging to DEBUG?

Gists with debug log level on Foreman side and a host discover process
logs are:

https://gist.github.com/korekhov/91472cdb225da5cb631162e2e9274de9

https://gist.github.com/korekhov/8b8931d95e696ab545f9385c6b465b9f

Please let me know if I can provide more data.


You received this message because you are subscribed to the Google Groups
“Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Later,
Lukas @lzap Zapletal

Sorry for a delay - please see production.log and corresponding host.log here https://gist.github.com/korekhov/c691c40dbe8ac61eadd2ebb8d395559c

I was working on mac248a078b7886 specifically here - removed it from discovered hosts first, then booted into discovery OS that started Foreman proxy.
Thanks!
Konstantin Orekhov

··· From: Lukas Zapletal To: Foreman users Sent: Monday, April 10, 2017 1:04 AM Subject: Re: [foreman-users] Re: Occasional ERF50-7522 on facts_refresh

Hello,
unfortunately due to bug, root exception is swallowed so I can’t tell what is wrong. Can you manually apply this patch on your instance and retest, send me production.log again.
https://github.com/theforeman/foreman_discovery/pull/338

It’s oneliner, exception block only. LZ
On Fri, Apr 7, 2017 at 8:36 PM, ‘Konstantin Orekhov’ via Foreman users foreman-users@googlegroups.com wrote:

Do you have some extra plugins installed? Like OpenSCAP? I cannot
reproduce here.

List of installed plug-ins:

This Foreman is an upgraded 1.14.1. I did not run foreman-installer after the upgrade. Would it make sense for me to try that? The reason I’m doubtful is that “undefined local variable or method `reports’” error comes from agent to Foreman when the latter asks for the facts. However, the issue magically disappears after first 3-5 minutes.

There should be full trace in logs, I don’t know why you don’t have
it. Have you deleted it, Can you increase logging to DEBUG?

Gists with debug log level on Foreman side and a host discover process logs are:

https://gist.github.com/ korekhov/ 91472cdb225da5cb631162e2e9274d e9

https://gist.github.com/ korekhov/ 8b8931d95e696ab545f9385c6b465b 9f

Please let me know if I can provide more data.


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-users+unsubscribe@ googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com .
Visit this group at https://groups.google.com/ group/foreman-users.
For more options, visit https://groups.google.com/d/ optout.


Later, Lukas @lzap Zapletal–
You received this message because you are subscribed to a topic in the Google Groups “Foreman users” group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/foreman-users/XzT9iEhpjRg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Hey, unfortunately I do not see "Unable to get facts from proxy" in your
log at all.

LZ

··· On Mon, Apr 17, 2017 at 9:25 PM, 'Konstantin Orekhov' via Foreman users < foreman-users@googlegroups.com> wrote:

Sorry for a delay - please see production.log and corresponding host.log
here https://gist.github.com/korekhov/c691c40dbe8ac61eadd2ebb8d395559c

I was working on mac248a078b7886 specifically here - removed it from
discovered hosts first, then booted into discovery OS that started Foreman
proxy.

Thanks!

Konstantin Orekhov


From: Lukas Zapletal lzap@redhat.com
To: Foreman users foreman-users@googlegroups.com
Sent: Monday, April 10, 2017 1:04 AM
Subject: Re: [foreman-users] Re: Occasional ERF50-7522 on facts_refresh

Hello,

unfortunately due to bug, root exception is swallowed so I can’t tell what
is wrong. Can you manually apply this patch on your instance and retest,
send me production.log again.

https://github.com/theforeman/foreman_discovery/pull/338

It’s oneliner, exception block only. LZ

On Fri, Apr 7, 2017 at 8:36 PM, ‘Konstantin Orekhov’ via Foreman users < > foreman-users@googlegroups.com> wrote:

Do you have some extra plugins installed? Like OpenSCAP? I cannot
reproduce here.

List of installed plug-ins:

https://lh3.googleusercontent.com/-faxAApAlmzo/WOfWvMSrgqI/AAAAAAAAADo/VgTdnjRVLGA-UdqI4gsJL41jNs6NyiegACLcB/s1600/Screen%2BShot%2B2017-04-07%2Bat%2B10.56.38%2BAM.png

This Foreman is an upgraded 1.14.1. I did not run foreman-installer after
the upgrade. Would it make sense for me to try that? The reason I’m
doubtful is that “undefined local variable or method `reports’” error
comes from agent to Foreman when the latter asks for the facts. However,
the issue magically disappears after first 3-5 minutes.

There should be full trace in logs, I don’t know why you don’t have
it. Have you deleted it, Can you increase logging to DEBUG?

Gists with debug log level on Foreman side and a host discover process
logs are:

https://gist.github.com/ korekhov/ 91472cdb225da5cb631162e2e9274d e9
https://gist.github.com/korekhov/91472cdb225da5cb631162e2e9274de9

https://gist.github.com/ korekhov/ 8b8931d95e696ab545f9385c6b465b 9f
https://gist.github.com/korekhov/8b8931d95e696ab545f9385c6b465b9f

Please let me know if I can provide more data.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@ googlegroups.com
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com .
Visit this group at https://groups.google.com/ group/foreman-users
https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/ optout
https://groups.google.com/d/optout.


Later,
Lukas @lzap Zapletal

You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/foreman-users/XzT9iEhpjRg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Later,
Lukas @lzap Zapletal

There are several occurrences of "unprocessible entry" in a log that correspond to agent's attempts to register a newly discovered system. That results in "invalid/unknown reports" errors seen in both logs. That is the same one that disappears after first 5 minutes so system is eventually able to finish registration.

Thanks!
Konstantin.

··· > On Apr 19, 2017, at 02:05, Lukas Zapletal wrote: > > Hey, unfortunately I do not see "Unable to get facts from proxy" in your log at all. > > LZ > >> On Mon, Apr 17, 2017 at 9:25 PM, 'Konstantin Orekhov' via Foreman users wrote: >> Sorry for a delay - please see production.log and corresponding host.log here https://gist.github.com/korekhov/c691c40dbe8ac61eadd2ebb8d395559c >> >> I was working on mac248a078b7886 specifically here - removed it from discovered hosts first, then booted into discovery OS that started Foreman proxy. >> >> Thanks! >> >> Konstantin Orekhov >> >> >> From: Lukas Zapletal >> To: Foreman users >> Sent: Monday, April 10, 2017 1:04 AM >> Subject: Re: [foreman-users] Re: Occasional ERF50-7522 on facts_refresh >> >> Hello, >> >> unfortunately due to bug, root exception is swallowed so I can't tell what is wrong. Can you manually apply this patch on your instance and retest, send me production.log again. >> >> https://github.com/theforeman/foreman_discovery/pull/338 >> >> It's oneliner, exception block only. LZ >> >> On Fri, Apr 7, 2017 at 8:36 PM, 'Konstantin Orekhov' via Foreman users wrote: >> >> Do you have some extra plugins installed? Like OpenSCAP? I cannot >> reproduce here. >> >> >> List of installed plug-ins: >> >> >> This Foreman is an upgraded 1.14.1. I did not run foreman-installer after the upgrade. Would it make sense for me to try that? The reason I'm doubtful is that "undefined local variable or method `reports'" error comes from agent to Foreman when the latter asks for the facts. However, the issue magically disappears after first 3-5 minutes. >> >> >> There should be full trace in logs, I don't know why you don't have >> it. Have you deleted it, Can you increase logging to DEBUG? >> >> Gists with debug log level on Foreman side and a host discover process logs are: >> >> https://gist.github.com/ korekhov/ 91472cdb225da5cb631162e2e9274d e9 >> >> https://gist.github.com/ korekhov/ 8b8931d95e696ab545f9385c6b465b 9f >> >> Please let me know if I can provide more data. >> >> -- >> You received this message because you are subscribed to the Google Groups "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an email to foreman-users+unsubscribe@ googlegroups.com. >> To post to this group, send email to foreman-users@googlegroups.com . >> Visit this group at https://groups.google.com/ group/foreman-users. >> For more options, visit https://groups.google.com/d/ optout. >> >> >> >> -- >> Later, >> Lukas @lzap Zapletal >> -- >> You received this message because you are subscribed to a topic in the Google Groups "Foreman users" group. >> To unsubscribe from this topic, visit https://groups.google.com/d/topic/foreman-users/XzT9iEhpjRg/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to foreman-users+unsubscribe@googlegroups.com. >> To post to this group, send email to foreman-users@googlegroups.com. >> Visit this group at https://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. >> >> >> -- >> You received this message because you are subscribed to the Google Groups "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an email to foreman-users+unsubscribe@googlegroups.com. >> To post to this group, send email to foreman-users@googlegroups.com. >> Visit this group at https://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. > > > > -- > Later, > Lukas @lzap Zapletal > -- > You received this message because you are subscribed to a topic in the Google Groups "Foreman users" group. > To unsubscribe from this topic, visit https://groups.google.com/d/topic/foreman-users/XzT9iEhpjRg/unsubscribe. > To unsubscribe from this group and all its topics, send an email to foreman-users+unsubscribe@googlegroups.com. > To post to this group, send email to foreman-users@googlegroups.com. > Visit this group at https://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout.

Ah I get it now.

It's a bug in


where it expects "reports" to be present

2017-04-17 11:48:26 e3962d8a [app] [D] undefined local variable or
method reports&#39; for #&lt;Host::Discovered:0x0000000c8dc078&gt; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activemodel-4.2.5.1/lib/active_model/attribute_methods.rb:433:inmethod_missing'
> /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_default_hostgroup-4.0.0/lib/default_hostgroup_base_host_patch.rb:66:in
host_new_or_forced?&#39; &gt; /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_default_hostgroup-4.0.0/lib/default_hostgroup_base_host_patch.rb:16:inimport_facts_with_match_hostgroup'
> /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-8.0.0/app/models/host/discovered.rb:75:in
import_facts&#39; &gt; /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-8.0.0/app/models/host/discovered.rb:67:inimport_host'

I'd like to ask Greg to take a look, he has experience with both
plugins. I am not available for the whole next week.

··· On Wed, Apr 19, 2017 at 5:12 PM, 'Konstantin Orekhov' via Foreman users < foreman-users@googlegroups.com> wrote:

There are several occurrences of “unprocessible entry” in a log that
correspond to agent’s attempts to register a newly discovered system. That
results in “invalid/unknown reports” errors seen in both logs. That is the
same one that disappears after first 5 minutes so system is eventually able
to finish registration.

Thanks!
Konstantin.

On Apr 19, 2017, at 02:05, Lukas Zapletal lzap@redhat.com wrote:

Hey, unfortunately I do not see “Unable to get facts from proxy” in your
log at all.

LZ

On Mon, Apr 17, 2017 at 9:25 PM, ‘Konstantin Orekhov’ via Foreman users < > foreman-users@googlegroups.com> wrote:

Sorry for a delay - please see production.log and corresponding host.log
here https://gist.github.com/korekhov/c691c40dbe8ac61eadd2ebb8d395559c

I was working on mac248a078b7886 specifically here - removed it from
discovered hosts first, then booted into discovery OS that started Foreman
proxy.

Thanks!

Konstantin Orekhov


From: Lukas Zapletal lzap@redhat.com
To: Foreman users foreman-users@googlegroups.com
Sent: Monday, April 10, 2017 1:04 AM
Subject: Re: [foreman-users] Re: Occasional ERF50-7522 on facts_refresh

Hello,

unfortunately due to bug, root exception is swallowed so I can’t tell
what is wrong. Can you manually apply this patch on your instance and
retest, send me production.log again.

https://github.com/theforeman/foreman_discovery/pull/338

It’s oneliner, exception block only. LZ

On Fri, Apr 7, 2017 at 8:36 PM, ‘Konstantin Orekhov’ via Foreman users < >> foreman-users@googlegroups.com> wrote:

Do you have some extra plugins installed? Like OpenSCAP? I cannot
reproduce here.

List of installed plug-ins:

https://lh3.googleusercontent.com/-faxAApAlmzo/WOfWvMSrgqI/AAAAAAAAADo/VgTdnjRVLGA-UdqI4gsJL41jNs6NyiegACLcB/s1600/Screen%2BShot%2B2017-04-07%2Bat%2B10.56.38%2BAM.png

This Foreman is an upgraded 1.14.1. I did not run foreman-installer after
the upgrade. Would it make sense for me to try that? The reason I’m
doubtful is that “undefined local variable or method `reports’” error
comes from agent to Foreman when the latter asks for the facts. However,
the issue magically disappears after first 3-5 minutes.

There should be full trace in logs, I don’t know why you don’t have
it. Have you deleted it, Can you increase logging to DEBUG?

Gists with debug log level on Foreman side and a host discover process
logs are:

https://gist.github.com/ korekhov/ 91472cdb225da5cb631162e2e9274d e9
https://gist.github.com/korekhov/91472cdb225da5cb631162e2e9274de9

https://gist.github.com/ korekhov/ 8b8931d95e696ab545f9385c6b465b 9f
https://gist.github.com/korekhov/8b8931d95e696ab545f9385c6b465b9f

Please let me know if I can provide more data.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@ googlegroups.com
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com .
Visit this group at https://groups.google.com/ group/foreman-users
https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/ optout
https://groups.google.com/d/optout.


Later,
Lukas @lzap Zapletal

You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit https://groups.google.com/d/to
pic/foreman-users/XzT9iEhpjRg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Later,
Lukas @lzap Zapletal


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/foreman-users/XzT9iEhpjRg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Later,
Lukas @lzap Zapletal

>
> It's a bug in
> https://github.com/theforeman/foreman_default_hostgroup/blob/develop/lib/default_hostgroup_base_host_patch.rb#L66
> where it expects "reports" to be present
>
> 2017-04-17 11:48:26 e3962d8a [app] [D] undefined local variable or method reports&#39; for #&lt;Host::Discovered:0x0000000c8dc078&gt; &gt; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activemodel-4.2.5.1/lib/active_model/attribute_methods.rb:433:inmethod_missing'
> > /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_default_hostgroup-4.0.0/lib/default_hostgroup_base_host_patch.rb:66:in host_new_or_forced?&#39; &gt; &gt; /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_default_hostgroup-4.0.0/lib/default_hostgroup_base_host_patch.rb:16:inimport_facts_with_match_hostgroup'
> > /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-8.0.0/app/models/host/discovered.rb:75:in import_facts&#39; &gt; &gt; /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-8.0.0/app/models/host/discovered.rb:67:inimport_host'
>
> I'd like to ask Greg to take a look, he has experience with both plugins. I am not available for the whole next week.
>
>
Lukas and/or Greg - any updates on this?

Hey, Greg is at Red Hat Summit this week, in the meantime uninstall
the foreman_default_hostgroup or disable it or something. Or apply a
dirty patch on the line 66:

unless new_host && hostgroup.nil? && reports.empty?

change to

unless new_host && hostgroup.nil? && !respond_to(:reports) && reports.empty?

··· On Wed, May 3, 2017 at 3:44 AM, Konstantin Orekhov wrote: > >> >> It's a bug in >> https://github.com/theforeman/foreman_default_hostgroup/blob/develop/lib/default_hostgroup_base_host_patch.rb#L66 >> where it expects "reports" to be present >> >> 2017-04-17 11:48:26 e3962d8a [app] [D] undefined local variable or method >> `reports' for # >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activemodel-4.2.5.1/lib/active_model/attribute_methods.rb:433:in >> `method_missing' >> > >> /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_default_hostgroup-4.0.0/lib/default_hostgroup_base_host_patch.rb:66:in >> `host_new_or_forced?' >> > >> /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_default_hostgroup-4.0.0/lib/default_hostgroup_base_host_patch.rb:16:in >> `import_facts_with_match_hostgroup' >> > >> /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-8.0.0/app/models/host/discovered.rb:75:in >> `import_facts' >> > >> /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-8.0.0/app/models/host/discovered.rb:67:in >> `import_host' >> >> I'd like to ask Greg to take a look, he has experience with both plugins. >> I am not available for the whole next week. > > > Lukas and/or Greg - any updates on this?


Later,
Lukas @lzap Zapletal

Hi, guys! Didn't get a chance to look into this until to today, but here are the results.
Tried dirty patching first - did not help as after patching the message on a client side changed to this:
<snip>Discovered by URL: https://spc.vip
Registering host with Foreman (https://spc.vip)
Response from Foreman 422: {"message":"undefined method `respond_to' for #\u003cHost::Discovered:0x007f102410e8a8\u003e"}<snip>
The behavior did not change.
Disabling hostgroup plugin by renaming its config file /etc/foreman/plugins/foreman_default_hostgroup.yaml did not help either.
Only after I removed a whole tfm-rubygem-foreman_default_hostgroup-4.0.0-1.fm1_13.el7.noarch package, the client was able to register in Foreman on a first attempt:
<snip>Discovered by URL: https://spc.vip
Registering host with Foreman (https://spc.vip)
Response from Foreman 201: {<snip>

This is a good workaround, but I do like an ability to force a system w/o any HG to be assigned into a default HG, which does some common things applicable to all systems for us.
So, my next question is how this can actually be fixed - I'd happy to try some other patches, etc to help out on this as much as possible. I'm currently running on 1.14.3.
Thanks!
Konstantin Orekhov

Hey, Greg is at Red Hat Summit this week, in the meantime uninstall
the foreman_default_hostgroup or disable it or something. Or apply a
dirty patch on the line 66:

unless new_host && hostgroup.nil? && reports.empty?

change to

unless new_host && hostgroup.nil? && !respond_to(:reports) && reports.empty?

··· On Wed, May 3, 2017 at 3:44 AM, Konstantin Orekhov wrote: > >> >> It's a bug in >> https://github.com/theforeman/foreman_default_hostgroup/blob/develop/lib/default_hostgroup_base_host_patch.rb#L66 >> where it expects "reports" to be present >> >> 2017-04-17 11:48:26 e3962d8a [app] [D] undefined local variable or method >> `reports' for #

Lukas or Greg, any suggestions based on the above report of mine?
Thanks!

Well, you can easily fix this, I thought it is obvious sorry:

change to:

unless new_host && hostgroup.nil? && reports.nil? && reports.empty?

··· On Fri, May 19, 2017 at 12:56 AM, 'Konstantin Orekhov' via Foreman users wrote: > Lukas or Greg, any suggestions based on the above report of mine? > Thanks! > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-users+unsubscribe@googlegroups.com. > To post to this group, send email to foreman-users@googlegroups.com. > Visit this group at https://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout.


Later,
Lukas @lzap Zapletal

Sorry I mean:

unless new_host && hostgroup.nil? && respond_to?(:reports) && reports.empty?

Send a PR to discuss this with Greg for a proper fix, this is dirty.

··· On Fri, May 19, 2017 at 10:54 AM, Lukas Zapletal wrote: > unless new_host && hostgroup.nil? && reports.nil? && reports.empty?


Later,
Lukas @lzap Zapletal

> unless new_host && hostgroup.nil? && respond_to?(:reports) &&
> reports.empty?
>
>
Well, that's what I was trying to tell you - this patch did not work for
me. I tried it out as you suggested on May 3rd, the only difference it made
is the error message changed from

Discovered by URL: https://foreman.domain.com
Registering host with Foreman (https://foreman.domain.com)
Response from Foreman 422: {"message":"undefined local variable or method
`reports' for #\u003cHost::Discovered:0x007f0a485be538}

to

Discovered by URL: https://spc.vip
Registering host with Foreman (https://spc.vip)
Response from Foreman 422: {"message":"undefined method `respond_to' for
#\u003cHost::Discovered:0x007f102410e8a8\u003e"}

So, only a complete removal of that RPM helped me so far.