Bug #18868
closedunable to submit Parallels PSBM facts
Description
I operate many PSBM (Paralells Server for Bare Metall) nodes. This is a patched CentOS 6 based operating system from parallels. The facts are a bit different to a normal CentOS 6 machine. You can see an example here: https://github.com/theforeman/puppet-puppet/pull/487
I get a long error when I try to submit the facts to foreman:
2017-03-11 11:49:38 df26fb2c [app] [W] Action failed | ActiveRecord::RecordInvalid: Validation failed: Minor version is not a number ... 2017-03-11 11:49:38 df26fb2c [app] [I] Rendered api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout (0.6ms) 2017-03-11 11:49:38 df26fb2c [app] [I] Completed 500 Internal Server Error in 909ms (Views: 1.5ms | ActiveRecord: 354.1ms)
The full error message:
https://gist.github.com/bastelfreak/204cabf82f428b47c3881a30071dc6df
The facts are available here:
https://gist.github.com/bastelfreak/2c396428e3435aec77bb8bf998a16bb7#file-gistfile1-txt-L98
I had to trim some sensitive information, but I guess the os hash is the important one. I'm running the latest foreman on CentOS 7:
~ # rpm -qa | grep foreman tfm-rubygem-foreman_hooks-0.3.13-1.fm1_14.el7.noarch tfm-rubygem-foreman_column_view-0.3.0-1.fm1_14.el7.noarch foreman-release-scl-3-1.el7.noarch tfm-rubygem-foreman-tasks-core-0.1.1-1.fm1_14.el7.noarch foreman-selinux-1.14.2-1.el7.noarch foreman-1.14.2-1.el7.noarch tfm-rubygem-puppetdb_foreman-2.0.0-1.fm1_14.el7.noarch tfm-rubygem-foreman-tasks-0.8.6-1.fm1_14.el7.noarch foreman-postgresql-1.14.2-1.el7.noarch foreman-debug-1.14.2-1.el7.noarch foreman-proxy-1.14.2-1.el7.noarch ~ #
And the packages on my puppetserver/foreman-proxy node:
~ # rpm -qa | grep foreman foreman-postgresql-1.14.2-1.el7.noarch tfm-rubygem-foreman-tasks-0.8.6-1.fm1_14.el7.noarch tfm-rubygem-foreman_hooks-0.3.13-1.fm1_14.el7.noarch tfm-rubygem-foreman-tasks-core-0.1.1-1.fm1_14.el7.noarch foreman-selinux-1.14.2-1.el7.noarch tfm-rubygem-puppetdb_foreman-2.0.0-1.fm1_14.el7.noarch foreman-debug-1.14.2-1.el7.noarch foreman-1.14.2-1.el7.noarch foreman-proxy-selinux-1.14.2-1.el7.noarch tfm-rubygem-foreman_column_view-0.3.0-1.fm1_14.el7.noarch foreman-release-scl-3-1.el7.noarch foreman-proxy-1.14.2-1.el7.noarch
I digged through my logs. I started with foreman 1.14.0. This bug was already present in that release and all upcoming. Let me know if you need any additional information
Updated by Anonymous over 7 years ago
- Category set to Facts
could you try the following patch?
diff --git a/app/services/puppet_fact_parser.rb b/app/services/puppet_fact_parser.rb index 0c1453d06..31c019054 100644 --- a/app/services/puppet_fact_parser.rb +++ b/app/services/puppet_fact_parser.rb @@ -28,6 +28,9 @@ class PuppetFactParser < FactParser orel.gsub!(/\-RELEASE\-p[0-9]+/, '') elsif os_name[/Solaris/i] orel.gsub!(/_u/, '.') + elsif os_name[/PSBM/i] + majorpsbm, minorpsbm = orel.split(".") + orel = majorpsbm + "." + minorpsbm end major, minor = orel.split('.', 2) major = major.to_s.gsub(/\D/, '')
Updated by Tim Meusel over 7 years ago
Moin,
thanks for the quick patch! This is working very good. Facts are now properly submitted and the nodes are listed as "PSBM 2.6" in the foreman UI.
Updated by Anonymous over 7 years ago
Allright. Would it be possible to get a full, unobfuscated output of "facter --json" from such an install (some install in a VM is sufficient)? Otherwise I'd have to mingle one from CentOS 6 facts and your gist to have a testset.
Updated by Tim Meusel over 7 years ago
This should work: https://gist.github.com/bastelfreak/d755fe22dffbddd03e74228a4660c3e8
I removed a few mountpoints to make it more readable and replaced some critical information with "REMOVED". IP-Adresses got replaced with fake ones.But this should be a functional json. let me know if you need any additional information.
Updated by The Foreman Bot over 7 years ago
- Status changed from New to Ready For Testing
- Assignee set to Anonymous
- Pull request https://github.com/theforeman/foreman/pull/4369 added
Updated by Anonymous over 7 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 65c0d14226a0956e2eb4b5b07440d271d95c17c6.
Updated by Ohad Levy over 7 years ago
- Translation missing: en.field_release set to 209