Bug #38569
openFix error handling for global registration while submitting built status
Description
Right now, if access to port 80 is disabled, then any system trying to register with foreman will be completed successfully , it will seem that the everything went fine but actually the system would remain in pending installation state. And after 24 hours, The same build status for the host would show up as Token Expired.
This started happening after the implementation of one extra "subscription-manager facts --update" within the "built" snippet via https://github.com/theforeman/foreman/commit/cd049d53d98c992ddf466bb21fc894b51fd70aa8 .
Even if for the unavailability of port 80 i.e. http access to foreman, the built completion update via curl would fail, it will fail silently but then as the sub-man facts --update command is executed, it would change the exit code of the snippet execution to be 0 i.e success.
Hence, here is https://github.com/theforeman/foreman/blob/develop/app/views/unattended/provisioning_templates/host_init_config/host_init_config_default.erb#L91-L98 , Global Reg would never show as failed. It will always show successful.
Updated by The Foreman Bot 8 months ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/10608 added
Updated by The Foreman Bot 7 months ago
- Pull request deleted (
https://github.com/theforeman/foreman/pull/10608)
Updated by Sayan Das 7 months ago
Sayan Das wrote:
Right now, if access to port 80 is disabled, then any system trying to register with foreman will be completed successfully , it will seem that the everything went fine but actually the system would remain in pending installation state. And after 24 hours, The same build status for the host would show up as Token Expired.
This started happening after the implementation of one extra "subscription-manager facts --update" within the "built" snippet via https://github.com/theforeman/foreman/commit/cd049d53d98c992ddf466bb21fc894b51fd70aa8 .
Even if for the unavailability of port 80 i.e. http access to foreman, the built completion update via curl would fail, it will fail silently but then as the sub-man facts --update command is executed, it would change the exit code of the snippet execution to be 0 i.e success.
Hence, here is https://github.com/theforeman/foreman/blob/develop/app/views/unattended/provisioning_templates/host_init_config/host_init_config_default.erb#L91-L98 , Global Reg would never show as failed. It will always show successful.
Please close this one as https://projects.theforeman.org/issues/38458 should solve the same issue and has been merged in the upstream. Please link the JIRA to the other redmine if possible.