{"record":{"id":"7e5255e58693aff6","repo":"theforeman/foreman","slug":"unknown-host-status-status-was-specified-in-h","errorCode":null,"errorMessage":"Unknown host status \"%{status}\" was specified in host_status macro, use one of %{statuses}","messagePattern":"Unknown host status \"%(.+?)\" was specified in host_status macro, use one of %(.+?)","errorType":"exception","errorClass":"Foreman::Renderer::Errors::UnknownHostStatusError","httpStatus":null,"severity":"error","filePath":"app/services/foreman/renderer/scope/macros/base.rb","lineNumber":240,"sourceCode":"            returns object_of: Hash, desc: 'Hash representing all statuses for a given host in human-readable format'\n            example 'all_host_statuses_labels(@host) # => {\"Build\"=>\"Installed\", \"Compliance\"=>\"Not applicable\", \"Configuration\"=>\"No reports\", \"Errata\"=>\"Security errata applicable\", \"Execution\"=>\"Last execution succeeded\", \"Role\"=>\"Unknown\", \"Service Level\"=>\"Unknown\", \"Subscription\"=>\"Simple Content Access\", \"System Purpose\"=>\"Unknown\", \"Traces\"=>\"No processes require restarting\", \"Usage\"=>\"Unknown\"}'\n            example \"<%- load_hosts.each_record do |host| -%>\\n<%= host.name -%>, <%=   all_host_statuses_labels(host)['Subscription'] %>\\n<%- end -%>\"\n          end\n          def all_host_statuses_labels_hash(host)\n            all_host_statuses.map { |status| [status.status_name, host_status(host, status.status_name).to_label] }.to_h\n          end\n\n          apipie :method, 'Returns a specific status for a given host' do\n            desc \"The return value is a human readable representation of the status.\n              For details about the number meaning, see documentation for every status class.\"\n            required :host, 'Host::Managed', desc: 'a host object for which the status will be checked'\n            required :name, HostStatus.status_registry.to_a.map(&:status_name).sort, desc: 'name of the host substatus to be checked'\n            returns String, desc: 'A human readable, textual representation of the status for a given host'\n            example 'host_status(@host, \"Subscription\") # => \"Fully entitled\"'\n          end\n          def host_status(host, name)\n            klass = all_host_statuses.find { |status| status.status_name == name }\n            raise UnknownHostStatusError.new(status: name, statuses: all_host_statuses.map(&:status_name).join(',')) if klass.nil?\n            host.get_status(klass)\n          end\n\n          apipie :method, desc: \"Returns a name of a given users auth source\" do\n            required :user, 'User', desc: 'a user for which the auth source name will be returned'\n            returns String, desc: 'An auth source name of specified user, nil if auth source could not be found'\n            example '<% load_users(search: \"admin = true\").each_record { |u| report_row login: u.login, auth_source: user_auth_source_name(u)  } -%>\\n<%= report_render %>'\n          end\n          def user_auth_source_name(user)\n            user.auth_source&.name\n          end\n\n          apipie :method, 'Returns true if template rendering is running in preview mode' do\n            desc \"This is useful if the template would execute commands, that shouldn't be\n              executed while previewing the template output. Examples may be performance\n              heavy operations, destructive operations etc.\"\n            returns one_of: [true, false], desc: 'A boolean value, true for preview mode, false otherwise'\n            example '<%= preview? ? \"# skipping in preview mode\" : @host.facts_hash[\"ssh::rsa::fingerprints::sha256\"] -%>'","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/theforeman/foreman/blob/6b05625475cfe6aac31a88f8c8ee6e62e4efe620/app/services/foreman/renderer/scope/macros/base.rb#L222-L258","documentation":"Error \"Unknown host status \"%{status}\" was specified in host_status macro, use one of %{statuses}\" thrown in theforeman/foreman.","triggerScenarios":"Thrown at app/services/foreman/renderer/scope/macros/base.rb:240 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6b05625475cfe6aac31a88f8c8ee6e62e4efe620","analyzedAt":"2026-08-23T17:46:34.094Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}