Project

General

Profile

Actions

Bug #37589

closed

Monitor -> Host statusses shows "Pending Installation" instead of Installed

Added by Bernhard Suttner 6 months ago. Updated 4 months ago.

Status:
Closed
Priority:
High
Category:
Unattended installations
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

I have found (any mostly) analyzed the issuse, that after provisioning a host the build status is not stored on DB. Means, the BuildStatus->to_status is 1 but BuildStatus->status is 0. the before_validation to refresh_build_status in host/managed is called and the status in the object is changed from pending installation to installed but it doesn't change the status object in DB. Therefore, if you go to HostOverview page and click on "Details" the Host is still in "Pending Installation". If you go to the host directly the "to_status" (or to_label) method is called which doesn't grab the value from DB but uses the "build" flag

irb(main):082:0> Host.last.host_statuses.first
=> #<HostStatus::BuildStatus id: 35, type: "HostStatus::BuildStatus", status: 1, host_id: 9, reported_at: [FILTERED]>
irb(main):083:0> Host.last.host_statuses.first.to_label
=> "Pending installation" 
irb(main):084:0> Host.last.host_statuses.first.to_status
=> 1
irb(main):085:0> Host.second.host_statuses.first
=> #<HostStatus::BuildStatus id: 2, type: "HostStatus::BuildStatus", status: 1, host_id: 2, reported_at: [FILTERED]>
irb(main):086:0> Host.second.host_statuses.first.to_label
=> "Installed" 
irb(main):087:0> Host.second.host_statuses.first.to_status
=> 0

First impression was: its just a UI issue. But if you have a closer look, the BuildStatus is now saved correctly in the DB which may have some other strange drawbacks.

Actions #1

Updated by The Foreman Bot 6 months ago

  • Status changed from New to Ready For Testing
  • Assignee set to Bernhard Suttner
  • Pull request https://github.com/theforeman/foreman/pull/10224 added
Actions #2

Updated by The Foreman Bot 5 months ago

  • Fixed in Releases 3.12.0 added
Actions #3

Updated by Bernhard Suttner 5 months ago

  • Status changed from Ready For Testing to Closed
Actions #4

Updated by Ewoud Kohl van Wijngaarden 4 months ago

  • Category set to Unattended installations
  • Triaged changed from No to Yes
Actions

Also available in: Atom PDF