I am trying to provision a host that has been just discovered in Foreman,
and every time I try this (I tried it with a few different discovered
hosts) I am running into the same problem.
Once all parameters have been entered in the host creation/provisioning UI,
I press submit and I get an error saying "*Unable to save: *Unable to
render PXELinux template 'Preseed default PXELinux': undefined local
variable or method `request' for #<Nic::Managed:0x007f0d44d31348>". If I
navigate to the Interfaces tab, I see an additional error saying "Some of
the interfaces are invalid. Please check the table below.", without
pointing out which interface has an issue, as in other cases.
I've looked repeatedly into what can be the problem with the interface(s),
I even deleted all but the provisioning interface, I always get the same
error. Again, this behavior is consistent, regardless of what discovered
host I am trying to provision.
Attached is a picture of the problem.
Please let me know if you are aware of a problem in this Foreman build - it
seems like version 1.14.1 may not have this problem.
> Please let me know if you are aware of a problem in this Foreman build -
> it seems like version 1.14.1 may not have this problem.
Just verified on fresh 1.14.1 and 1.15.0 installs this is still an issue.
However, we do have several upgraded into 1.14.1 and 1.14.2 Foreman
instances where we don't see this issue at all.
Any suggestions on next steps of figuring out the issue? Going to turn the
debug now. Any interest in collected debug info?
BTW, we've tried both included community PXELinux templates and our own
ones and none them actually has a direct call of blamed "request" method:
Unable to render PXELinux template 'Preseed default PXELinux': undefined
local variable or method `request' for #<Nic::Managed:0x007f0d44d31348>
LOL, with debugging on we quickly found the issue:
2017-05-19 12:05:01 0c04f9fc [app] [W] Unable to render PXELinux template
'custom_Ubuntu_PXELinux': undefined local variable or method
request' for #<Nic::Managed:0x00000008764f50> > NameError: undefined local variable or methodrequest' for
method_missing' > /usr/share/foreman/lib/foreman/renderer.rb:44:inforeman_url'
The new instances were not auto-configured with foreman_url and
unattended_url (need to figure this out), but after populating proper URL,
things are back to normal.
Sorry for a false alarm, folks.