Host fails to complete build when provisioning interface != primary interface

I just discovered a host fails to tell Foreman that provisioning is
complete when the primary interface is different from the provisioning
interface. During kickstart the host's interfaces are setup such that all
communication to Foreman changes from private (provision) to public
(primary).

I am running 1.8.2. Is this an issue that may have been fixed in newer
releases, or should I open a new ticket for this issue? The last query in
logs makes it seem like the query is incorrect as 'nics.provision = 1'
assumes that the IP used to contact foreman (nics.ip = OMIT_PRIMARY_IP) is
the same as the provision IP.

Thanks,

  • Trey

Started GET "/unattended/built?token=58ac07da-f4be-40eb-8f95-640a07dd3273"
for OMIT_PRIMARY_IP at 2015-09-11 12:11:22 -0500
2015-09-11 12:11:22 [I] Processing by UnattendedController#built as /
2015-09-11 12:11:22 [I] Parameters:
{"token"=>"58ac07da-f4be-40eb-8f95-640a07dd3273"}
2015-09-11 12:11:22 [D] Setting Load (0.4ms) SELECT settings.* FROM
settings WHERE settings.name = 'authorize_login_delegation' ORDER BY
name LIMIT 1
2015-09-11 12:11:22 [D] Host::Managed Load (0.5ms) SELECT hosts.* FROM
hosts INNER JOIN tokens ON tokens.host_id = hosts.id WHERE
hosts.type IN ('Host::Managed') AND tokens.value =
'58ac07da-f4be-40eb-8f95-640a07dd3273' AND (expires >= '2015-09-11
17:11:22') LIMIT 1
2015-09-11 12:11:22 [D] Host::Managed Load (0.9ms) SELECT hosts.* FROM
hosts INNER JOIN nics ON nics.host_id = hosts.id AND
nics.provision = 1 WHERE hosts.type IN ('Host::Managed') AND
nics.ip = 'OMIT_PRIMARY_IP' LIMIT 1
2015-09-11 12:11:22 [I] unattended: unable to find a host that matches the
request from OMIT_PRIMARY_IP
2015-09-11 12:11:22 [I] Filter chain halted as :get_host_details rendered
or redirected
2015-09-11 12:11:22 [I] Completed 404 Not Found in 10ms (ActiveRecord:
1.7ms)
2015-09-11 12:12:25 [I]

Somehow the host successfully notified Foreman the build after I cancelled
the build and set the system back to build on a second attempt. The SQL
queries in logs differ on the successful attempt. The second
'Host::Managed Load' query doesn't appear in the logs when successful. Now
that I think about it, the token may have expired. I had initially created
the host in Foreman some time ago and never got around to actually building
till today.

Started GET "/unattended/built?token=030a6e44-ee27-48c7-8ad0-ddfe24890444"
for 128.194.165.71 at 2015-09-11 15:35:00 -0500
2015-09-11 15:35:00 [I] Processing by UnattendedController#built as /
2015-09-11 15:35:00 [I] Parameters:
{"token"=>"030a6e44-ee27-48c7-8ad0-ddfe24890444"}
2015-09-11 15:35:00 [D] Setting Load (0.4ms) SELECT settings.* FROM
settings WHERE settings.name = 'authorize_login_delegation' ORDER BY
name LIMIT 1
2015-09-11 15:35:00 [D] Host::Managed Load (0.4ms) SELECT hosts.* FROM
hosts INNER JOIN tokens ON tokens.host_id = hosts.id WHERE
hosts.type IN ('Host::Managed') AND tokens.value =
'030a6e44-ee27-48c7-8ad0-ddfe24890444' AND (expires >= '2015-09-11
20:35:00') LIMIT 1
2015-09-11 15:35:00 [D] Operatingsystem Load (0.1ms) SELECT
operatingsystems.* FROM operatingsystems WHERE operatingsystems.id
= 7 ORDER BY title LIMIT 1
2015-09-11 15:35:00 [I] Found OMIT_HOSTNAME

ยทยทยท On Friday, September 11, 2015 at 12:46:12 PM UTC-5, trey...@tamu.edu wrote: > > I just discovered a host fails to tell Foreman that provisioning is > complete when the primary interface is different from the provisioning > interface. During kickstart the host's interfaces are setup such that all > communication to Foreman changes from private (provision) to public > (primary). > > I am running 1.8.2. Is this an issue that may have been fixed in newer > releases, or should I open a new ticket for this issue? The last query in > logs makes it seem like the query is incorrect as 'nics.provision = 1' > assumes that the IP used to contact foreman (nics.ip = OMIT_PRIMARY_IP) is > the same as the provision IP. > > Thanks, > - Trey > > Started GET "/unattended/built?token=58ac07da-f4be-40eb-8f95-640a07dd3273" > for OMIT_PRIMARY_IP at 2015-09-11 12:11:22 -0500 > 2015-09-11 12:11:22 [I] Processing by UnattendedController#built as */* > 2015-09-11 12:11:22 [I] Parameters: > {"token"=>"58ac07da-f4be-40eb-8f95-640a07dd3273"} > 2015-09-11 12:11:22 [D] Setting Load (0.4ms) SELECT `settings`.* FROM > `settings` WHERE `settings`.`name` = 'authorize_login_delegation' ORDER BY > name LIMIT 1 > 2015-09-11 12:11:22 [D] Host::Managed Load (0.5ms) SELECT hosts.* FROM > `hosts` INNER JOIN `tokens` ON `tokens`.`host_id` = `hosts`.`id` WHERE > `hosts`.`type` IN ('Host::Managed') AND `tokens`.`value` = > '58ac07da-f4be-40eb-8f95-640a07dd3273' AND (expires >= '2015-09-11 > 17:11:22') LIMIT 1 > 2015-09-11 12:11:22 [D] Host::Managed Load (0.9ms) SELECT `hosts`.* > FROM `hosts` INNER JOIN `nics` ON `nics`.`host_id` = `hosts`.`id` AND > `nics`.`provision` = 1 WHERE `hosts`.`type` IN ('Host::Managed') AND > `nics`.`ip` = 'OMIT_PRIMARY_IP' LIMIT 1 > 2015-09-11 12:11:22 [I] unattended: unable to find a host that matches the > request from OMIT_PRIMARY_IP > 2015-09-11 12:11:22 [I] Filter chain halted as :get_host_details rendered > or redirected > 2015-09-11 12:11:22 [I] Completed 404 Not Found in 10ms (ActiveRecord: > 1.7ms) > 2015-09-11 12:12:25 [I] >