I don´t know with which versionupdate that issue comes into play, but in our Foreman-UI (DEV / PROD) we have the issue that if you searching for hosts, the hosts are registered and reports that the puppetrun was successful, but the fields with the information “Operating System” and “Environment” are empty. I don´t know with which versionupdate this issue comes into play, because we recognized that few days ago after joining new nodes to puppet.
The puppetruns working fine and the node.rb execution works also well.
I don´t know if this issue comes from foreman or puppetserver / puppetdb.
Expected outcome:
Outcome should be that foreman shows again “OS” and “Environment” information in the hosts-tab
This issue seems to be in all of our environments the same.
[root@<pp-master> ~]# /etc/puppetlabs/puppet/node.rb <nodename>
<nodenam>: During the fact upload the server responded with: 500 Internal Server Error. Error is ignored and the execution continues.
{
"error": {"message":"Internal Server Error: the server was unable to finish the request. This may be caused by unavailability of some required service, incorrect API call or a server-side bug. There may be more information in the server's logs."}
}
---
classes: []
parameters:
puppetmaster: ''
hostname: pp-client-test-01
fqdn: <nodename>
foreman_subnets: []
foreman_interfaces:
- ip: <ip>
ip6:
mac: fa:16:3e:a1:48:ca
name: <nodename>
attrs:
bindings:
- address: <ip>
netmask: <netmask>
network: <network>
bindings6:
- address: fe80::f816:3eff:fea1:48ca
netmask: 'ffff:ffff:ffff:ffff::'
network: 'fe80::'
scope6: link
flags:
- permanent
mtu: 1500
dhcp: <ip>
netmask: <netmask>
network: <network>
netmask6: 'ffff:ffff:ffff:ffff::'
network6: 'fe80::'
scope6: link
virtual: false
link: true
identifier: eth0
managed: true
primary: true
provision: true
subnet:
subnet6:
tag:
attached_to:
type: Interface
domainname: ict.dev.ttw
root_pw:
host_packages: ''
host_registration_insights: false
host_registration_remote_execution: true
foreman - production.log - debug mode
2021-12-21T19:07:37 [I|app|b4d2d015] Started POST "/api/hosts/facts" for <ip> at 2021-12-21 19:07:37 +0100
2021-12-21T19:07:37 [I|app|b4d2d015] Processing by Api::V2::HostsController#facts as JSON
2021-12-21T19:07:37 [I|app|b4d2d015] Parameters: {"facts"=>"[FILTERED]", "name"=>"pp-client-test-01.ict.dev.ttw", "certname"=>"<nodename>", "apiv"=>"v2", "host"=>{"certname"=>"nodename", "name"=>"<nodename>"}}
2021-12-21T19:07:37 [D|app|b4d2d015] Importer Katello::RhsmFactImporter does not implement authorized_smart_proxy_features.
2021-12-21T19:07:37 [D|app|b4d2d015] Importer DiscoveryFactImporter does not implement authorized_smart_proxy_features.
2021-12-21T19:07:37 [D|app|b4d2d015] Client sent certificate with subject 'pp-master' and subject alt names '["puppet", "<pp-master>"]'
2021-12-21T19:07:37 [D|app|b4d2d015] CN and SANs were extracted from a client certificate.
2021-12-21T19:07:37 [D|app|b4d2d015] Verifying request from ["puppet", "pp-master-test-02.ict.dev.ttw"] against ["<pp-master>", "<pp-master>"]
2021-12-21T19:07:37 [I|app|b4d2d015] Import facts for '<nodename>' completed. Added: 0, Updated: 0, Deleted 0 facts
2021-12-21T19:07:37 [D|tax|b4d2d015] Current location set to Default Location
2021-12-21T19:07:37 [D|tax|b4d2d015] Current organization set to Default Organization
2021-12-21T19:07:37 [D|app|b4d2d015] skipping interface with identifier 'lo' since it was matched by 'ignored_interface_identifiers' setting
2021-12-21T19:07:37 [D|app|b4d2d015] We have following interfaces 'eth0' based on facts
2021-12-21T19:07:37 [D|app|b4d2d015] Interface eth0 facts: {"macaddress"=>"fa:16:3e:a1:48:ca", "bindings"=>[{"address"=>"<ip>", "netmask"=>"<netmask>", "network"=>"<network>"}], "bindings6"=>[{"address"=>"fe80::f816:3eff:fea1:48ca", "netmask"=>"ffff:ffff:ffff:ffff::", "n
etwork"=>"fe80::", "scope6"=>"link", "flags"=>["permanent"]}], "mtu"=>1500, "dhcp"=>"<ip>", "ipaddress"=>"<ip>", "netmask"=>"<netmask>", "network"=>"<network>", "ipaddress6"=>"fe80::f816:3eff:fea1:48ca", "netmask6"=>"ffff:ffff:ffff:ffff::", "network6"=>"fe80::",
"scope6"=>"link"}
2021-12-21T19:07:37 [W|app|b4d2d015] Action failed
2021-12-21T19:07:37 [I|app|b4d2d015] Backtrace for 'Action failed' error (NoMethodError): undefined method `values' for "[\"sda\"]":String
b4d2d015 | /usr/share/foreman/app/services/puppet_fact_parser.rb:145:in `disks_total'
b4d2d015 | /usr/share/foreman/app/models/host_facets/reported_data_facet.rb:11:in `populate_fields_from_facts'
b4d2d015 | /usr/share/foreman/app/models/concerns/facets/base_host_extensions.rb:22:in `block in populate_facet_fields'
b4d2d015 | /usr/share/foreman/app/models/concerns/facets/base_host_extensions.rb:21:in `each'
b4d2d015 | /usr/share/foreman/app/models/concerns/facets/base_host_extensions.rb:21:in `populate_facet_fields'
b4d2d015 | /usr/share/foreman/app/models/host/managed.rb:492:in `populate_fields_from_facts'
b4d2d015 | /usr/share/foreman/app/services/host_fact_importer.rb:50:in `block (2 levels) in parse_facts'
b4d2d015 | /usr/share/foreman/app/services/foreman/telemetry_helper.rb:27:in `telemetry_duration_histogram'
b4d2d015 | /usr/share/foreman/app/services/host_fact_importer.rb:49:in `block in parse_facts'
b4d2d015 | /usr/share/foreman/app/services/host_fact_importer.rb:90:in `block in skipping_orchestration'
b4d2d015 | /usr/share/foreman/app/models/concerns/orchestration.rb:124:in `without_orchestration'
b4d2d015 | /usr/share/foreman/app/services/host_fact_importer.rb:89:in `skipping_orchestration'
b4d2d015 | /usr/share/foreman/app/services/host_fact_importer.rb:45:in `parse_facts'
b4d2d015 | /usr/share/foreman/app/services/host_fact_importer.rb:34:in `import_facts'
b4d2d015 | /usr/share/foreman/app/controllers/api/v2/hosts_controller.rb:313:in `facts'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/abstract_controller/base.rb:195:in `process_action'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/rendering.rb:30:in `process_action'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:112:in `block in run_callbacks'
b4d2d015 | /usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
b4d2d015 | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
b4d2d015 | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.9.0/lib/audited/sweeper.rb:14:in `around'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.9.0/lib/audited/sweeper.rb:14:in `around'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:139:in `run_callbacks'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/abstract_controller/callbacks.rb:41:in `process_action'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/rescue.rb:22:in `process_action'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/notifications.rb:180:in `block in instrument'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/notifications.rb:180:in `instrument'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/abstract_controller/base.rb:136:in `process'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.3.7/lib/action_view/rendering.rb:39:in `process'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal.rb:190:in `dispatch'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_controller/metal.rb:254:in `dispatch'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/routing/route_set.rb:33:in `serve'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/routing/mapper.rb:18:in `block in <class:Constraints>'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/routing/mapper.rb:48:in `serve'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/journey/router.rb:49:in `block in serve'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/journey/router.rb:32:in `each'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/journey/router.rb:32:in `serve'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/routing/route_set.rb:834:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-dsl-2.4.0/lib/apipie_dsl/static_dispatcher.rb:67:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.17/lib/apipie/static_dispatcher.rb:66:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.17/lib/apipie/extractor/recorder.rb:137:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/static.rb:126:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/static.rb:126:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/static.rb:126:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/static.rb:126:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/static.rb:126:in `call'
b4d2d015 | /usr/share/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
b4d2d015 | /usr/share/foreman/lib/foreman/middleware/telemetry.rb:10:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.17/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
b4d2d015 | /usr/share/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/tempfile_reaper.rb:15:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/etag.rb:27:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/conditional_get.rb:40:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/head.rb:12:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/http/content_security_policy.rb:18:in `call'
b4d2d015 | /usr/share/foreman/lib/foreman/middleware/logging_context_session.rb:22:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:266:in `context'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:260:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/cookies.rb:648:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:101:in `run_callbacks'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/railties-6.0.3.7/lib/rails/rack/logger.rb:37:in `call_app'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/railties-6.0.3.7/lib/rails/rack/logger.rb:28:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:13:in `call'
b4d2d015 | /usr/share/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/request_id.rb:27:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/method_override.rb:24:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/runtime.rb:22:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/executor.rb:14:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/static.rb:126:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/host_authorization.rb:76:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-cors-1.0.2/lib/rack/cors.rb:97:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/secure_headers-6.3.0/lib/secure_headers/middleware.rb:11:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/railties-6.0.3.7/lib/rails/engine.rb:527:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/railties-6.0.3.7/lib/rails/railtie.rb:190:in `public_send'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/railties-6.0.3.7/lib/rails/railtie.rb:190:in `method_missing'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/urlmap.rb:74:in `block in call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `each'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/puma-5.5.0/lib/puma/configuration.rb:249:in `call'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/puma-5.5.0/lib/puma/request.rb:77:in `block in handle_request'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/puma-5.5.0/lib/puma/thread_pool.rb:340:in `with_force_shutdown'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/puma-5.5.0/lib/puma/request.rb:76:in `handle_request'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/puma-5.5.0/lib/puma/server.rb:447:in `process_client'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/puma-5.5.0/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
b4d2d015 | /opt/theforeman/tfm/root/usr/share/gems/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2021-12-21T19:07:37 [I|app|b4d2d015] Rendering api/v2/errors/custom_error.json.rabl within api/v2/layouts/error_layout
2021-12-21T19:07:37 [I|app|b4d2d015] Rendered api/v2/errors/custom_error.json.rabl within api/v2/layouts/error_layout (Duration: 4.4ms | Allocations: 5227)
2021-12-21T19:07:37 [I|app|b4d2d015] Completed 500 Internal Server Error in 343ms (Views: 8.6ms | ActiveRecord: 72.2ms | Allocations: 86724)
2021-12-21T19:07:37 [D|app|b4d2d015] Cache write: _session_id:2::c4e666c6902e41a38227763a141b1d313f818d725cce2f97fe0171d8fe68211c ({:expires_in=>86400})
2021-12-21T19:07:37 [I|app|12ff3087] Started GET "/node/pp-client-test-01.ict.dev.ttw?format=yml" for 10.115.155.54 at 2021-12-21 19:07:37 +0100
2021-12-21T19:07:37 [I|app|12ff3087] Processing by HostsController#externalNodes as YML
2021-12-21T19:07:37 [I|app|12ff3087] Parameters: {"name"=>"<nodename>"}
2021-12-21T19:07:37 [D|app|12ff3087] Client sent certificate with subject '<pp-master>' and subject alt names '["puppet", "<pp-master>"]'
2021-12-21T19:07:37 [D|app|12ff3087] CN and SANs were extracted from a client certificate.
2021-12-21T19:07:37 [D|app|12ff3087] Verifying request from ["puppet", "pp-master-test-02.ict.dev.ttw"] against ["pp-master-test-02.ict.dev.ttw", "pp-master-test-02.ict.dev.ttw"]
2021-12-21T19:07:37 [D|app|12ff3087] Client sent certificate with subject 'pp-master-test-02.ict.dev.ttw' and subject alt names '["puppet", "<pp-master>"]'
2021-12-21T19:07:37 [D|app|12ff3087] CN and SANs were extracted from a client certificate.
2021-12-21T19:07:37 [D|app|12ff3087] Verifying request from ["puppet", "<pp-master>"] against ["<pp-master>", "<pp-master>"]
2021-12-21T19:07:37 [I|app|12ff3087] Rendering text template
2021-12-21T19:07:37 [I|app|12ff3087] Rendered text template (Duration: 0.0ms | Allocations: 1)
2021-12-21T19:07:37 [I|app|12ff3087] Completed 200 OK in 26ms (Views: 0.5ms | ActiveRecord: 6.0ms | Allocations: 6932)
2021-12-21T19:07:37 [D|app|12ff3087] Cache write: _session_id:2::ae7638818114a6abe0143e0041707354d37b675fcd69f18f56640cb0e5fc5d52 ({:expires_in=>86400})
Looks like a regression was introduced in Feature #32170: Add disks_total to reported data - Foreman. I wonder which facts you’re uploading that it fails. Do you by any chance have a custom fact named disks that masks Facter’s built in fact disks?
That said, we shouldn’t fail on that but rather emit a warning it was unable to extract the total disk size.
i found that we using the foreman-plugin bootdisk, but this should not be an issue right ?
include ::profile::foreman
include ::profile::foreman::compute::libvirt
include ::profile::foreman::compute::openstack
include ::profile::foreman::plugin::bootdisk
include ::profile::foreman::plugin::dhcp_browser
include ::profile::foreman::plugin::discovery
include ::profile::foreman::plugin::expire_hosts
include ::profile::foreman::plugin::hooks
include ::profile::foreman::plugin::host_extra_validator
include ::profile::foreman::plugin::memcache
include ::profile::foreman::plugin::monitoring
include ::profile::foreman::plugin::openscap
include ::profile::foreman::plugin::puppet
include ::profile::foreman::plugin::puppetdb
include ::profile::foreman::plugin::tasks
include ::profile::foreman::plugin::templates
i checked what you said:
[root@<pp-master> ~]# /etc/puppetlabs/puppet/node.rb <nodename> | grep disks -R
<nodename>: During the fact upload the server responded with: 500 Internal Server Error. Error is ignored and the execution continues.
{
"error": {"message":"Internal Server Error: the server was unable to finish the request. This may be caused by unavailability of some required service, incorrect API call or a server-side bug. There may be more information in the server's logs."}
}
.puppetlabs/bolt/.resource_types/zpool.pp: # Log disks for this pool. This type does not currently support mirroring of log disks.
.puppetlabs/bolt/.resource_types/zpool.pp: # Cache disks for this pool.
Binary file .gem/specs/rubygems.org%443/latest_specs.4.8 matches
yes facter also works for that what you mentioned in that way
This isn’t what I asked. Please run grep disks -R /opt/puppetlabs/puppet/cache/lib/facter
Puppet caches all custom facts from your whole environment in /opt/puppetlabs/puppet/cache/lib/facter, even from modules that you don’t apply to that machine. So even a completely unused module with a custom fact named disks can break this for you.
[root@<nodename> ~]# grep disks -R /opt/puppetlabs/puppet/cache/lib/facter
/opt/puppetlabs/puppet/cache/lib/facter/partitions.rb:# partitions per disk and disks.
/opt/puppetlabs/puppet/cache/lib/facter/partitions.rb:# We support most of generic SATA and PATA disks, plus Hewlett-Packard
/opt/puppetlabs/puppet/cache/lib/facter/partitions.rb: # We store a list of disks (or block devices if you wish) here ...
/opt/puppetlabs/puppet/cache/lib/facter/partitions.rb: disks = []
/opt/puppetlabs/puppet/cache/lib/facter/partitions.rb: # All disks ... This might even be sda, sdaa, sdab, sdac, etc ...
/opt/puppetlabs/puppet/cache/lib/facter/partitions.rb: disks << disk
/opt/puppetlabs/puppet/cache/lib/facter/partitions.rb: Facter.add('disks') do
/opt/puppetlabs/puppet/cache/lib/facter/partitions.rb: setcode { disks.sort.uniq.join(',') }
```:
hmm this seems to be the file where it comes from and i guess this could be a module that someone in my company installed ?
#
# partitions.rb
#
# This fact provides an alphabetic list of blocks per disk and/or partition,
# partitions per disk and disks.
#
# We support most of generic SATA and PATA disks, plus Hewlett-Packard
# Smart Array naming format ... This also should work for systems running
# as Virtual Machine guest at least for Xen and KVM ...
#
require 'thread'
require 'facter'
if Facter.value(:kernel) == 'Linux'
mutex = Mutex.new
# We store a list of disks (or block devices if you wish) here ...
disks = []
# We store number of blocks per disk and/or partition here ...
blocks = {}
# We store a list of partitions on per-disk basis here ...
partitions = Hash.new { |k,v| k[v] = [] }
#
# Support for the following might not be of interest ...
#
# MMC is Multi Media Card which can be either SD or microSD, etc ...
# MTD is Memory Technology Device also known as Flash Memory
#
exclude = %w(backdev.* dm loop md mmcblk mtdblock ramzswap)
#
# Modern Linux kernels provide "/proc/partitions" in the following format:
#
# major minor #blocks name
#
# 8 0 244198584 sda
# 8 1 3148708 sda1
# 8 2 123804922 sda2
# 8 3 116214210 sda3
# 8 4 1028160 sda4
#
# Make regular expression form our patterns ...
exclude = Regexp.union(*exclude.collect { |i| Regexp.new(i) })
#
# We utilise rely on "cat" for reading values from entries under "/proc".
# This is due to some problems with IO#read in Ruby and reading content of
# the "proc" file system that was reported more than once in the past ...
#
Facter::Util::Resolution.exec('cat /proc/partitions 2> /dev/null').each_line do |line|
# Remove bloat ...
line.strip!
# Line of interest should start with a number ...
next if line.empty? or line.match(/^[a-zA-Z]+/)
# We have something, so let us apply our device type filter ...
next if line.match(exclude)
# Only blocks and partitions matter ...
block = line.split(/\s+/)[2]
partition = line.split(/\s+/)[3]
if partition.match(/^cciss/)
#
# Special case for Hewlett-Packard Smart Array which probably
# nobody is using any more nowadays anyway ...
#
partition = partition.split('/')[1]
if match = partition.match(/^([a-zA-Z0-9]+)[pP][0-9]+/)
# Handle the case when "cciss/c0d0p1" is given ...
disk = match[1]
elsif partition.match(/^[a-zA-Z0-9]+/)
# Handle the case when "cciss/c0d0" is given ...
disk = partition
end
else
# Everything else ...
disk = partition.scan(/^[a-zA-Z]+/)
end
# Convert back into a string value ...
disk = disk.to_s
# We have something rather odd that did not parse at all, so ignore ...
next if disk.empty?
mutex.synchronize do
# All disks ... This might even be sda, sdaa, sdab, sdac, etc ...
disks << disk
# Store details about number of blocks per disk and/or partition ...
blocks[partition] = block
# A disk is not a partition, therefore we ignore ...
partitions[disk] << partition unless partition == disk
end
end
Facter.add('disks') do
confine :kernel => :linux
setcode { disks.sort.uniq.join(',') }
end
blocks.each do |k,v|
Facter.add("blocks_#{k}") do
confine :kernel => :linux
setcode { v }
end
end
partitions.each do |k,v|
Facter.add("partitions_#{k}") do
confine :kernel => :linux
# To ensure proper sorting order by the interface name ...
v = v.sort_by { |i| i.scan(/\d+/).shift.to_i }
setcode { v.sort.join(',') }
end
end
end
# vim: set ts=2 sw=2 et :
# encoding: utf-8
Yes, that would be it. This may predate Facter 3 which introduced the disks fact. You also see it’s in the common environment which would explain why all hosts suffer from this.
I will discuss this issue with my expert puppet colleaque after his christmas vacation and will give you then feedback, as i see it thats a pretty old selfwritten module, so maybe it is deprecated and we can disable it. Then maybe everything will be fine
lets see - thank you for your help, j appreciate it that you helping me / us every time
@ekohl, after moving the file all our foreman-UIs are getting now the facts again
thank you very much for your help.
I have a last question. In the Foreman-UI under “All Hosts” i can remember there was formerly a column “environment” … but i guess since update from Foreman 2.5 to 3.1 this column is not even more visible.
I’m not sure. It may be that the new foreman_puppet plugin doesn’t add the column and that was missed in the extraction from core. Please file an issue at Foreman